Skip to content

Fix temporal allocation reasons#15

Merged
leoromanovsky merged 2 commits into
mainfrom
leo.romanovsky/date-window-assignment-reasons
Jun 12, 2026
Merged

Fix temporal allocation reasons#15
leoromanovsky merged 2 commits into
mainfrom
leo.romanovsky/date-window-assignment-reasons

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Motivation

The date-window fixtures currently expect STATIC for allocations that only become active because their startAt / endAt scheduling window allows them. The evaluation reasons RFC says date-window fields are scheduling metadata, not targeting rules: they do not imply TARGETING_MATCH, but their presence means the result is not truly STATIC either.

Keeping these shared fixtures stale lets SDK and precompute implementations drift on the public assignment reason field even when the selected value is correct.

Changes and Decisions

This PR updates only the existing temporal evaluation fixtures for start-and-end-date-test and microsecond-date-test. The expected values are unchanged; only the successful assignment reason moves from STATIC to DEFAULT.

This matches the RFC rule for active date-window-only allocations: the active allocation returns a platform value, no targeting rule matched, no non-vacuous split resolved the subject, and date bounds preclude STATIC.

This is split from the broader precompute contract fixture PR so the behavior correction can be reviewed and merged independently.

Validation

Downstream validation is performed by dd-source/libdatadog-style evaluator tests that consume these fixtures and compare assignment outputs against the shared contract.

@leoromanovsky
leoromanovsky marked this pull request as ready for review June 12, 2026 03:11
@leoromanovsky
leoromanovsky requested a review from a team as a code owner June 12, 2026 03:11
@leoromanovsky
leoromanovsky requested review from dd-oleksii, greghuels and sameerank and removed request for a team June 12, 2026 03:11

@dd-oleksii dd-oleksii left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually want DEFAULT in those cases. See the doc

@leoromanovsky

Copy link
Copy Markdown
Collaborator Author

We actually want DEFAULT in those cases. See the doc

@dd-oleksii Thanks for linking that!

@leoromanovsky leoromanovsky changed the title Fix date-window assignment reasons Fix temporal allocation reasons Jun 12, 2026
@leoromanovsky
leoromanovsky merged commit d9d8020 into main Jun 12, 2026
1 check passed
@leoromanovsky
leoromanovsky deleted the leo.romanovsky/date-window-assignment-reasons branch June 12, 2026 12:42
gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/libdatadog that referenced this pull request Jun 12, 2026
## Motivation

The shared FFE fixtures now assert result metadata beyond returned values, including `reason` and `errorCode`. libdatadog was only checking fixture values, so it could accept shared fixture bumps while still drifting on public assignment metadata.

The latest `ffe-system-test-data` main also corrects temporal allocation fixtures to expect `DEFAULT` for active date-window-only allocations. Those allocations return a configured platform/default value, but no targeting rule matched and no non-vacuous split selected the subject.

## Changes

This updates the `ffe-system-test-data` submodule through `d9d8020`, including the merged temporal reason correction from DataDog/ffe-system-test-data#15.

The canonical fixture harness now asserts fixture-provided `reason` and `errorCode` fields in addition to values. Invalid or unsupported per-flag config is represented as a distinct evaluation error that maps to caller-default behavior while preserving isolation for valid flags in the same payload.

The evaluator now has an explicit `AssignmentReason::Default` for successful default/platform assignments. Active temporal allocations with no rules and no effective split now report `DEFAULT`, and the FFI mapping exposes that as `ddog_ffe_Reason::Default`.

## Decisions

Top-level configuration parse behavior is unchanged: a malformed full payload still fails configuration creation, while malformed individual flags are isolated and evaluate to caller defaults. Missing flags continue to report `FLAG_NOT_FOUND`. Optional `errorCode` fixture assertions remain optional because some existing shared cases omit that field even when the reason is `ERROR`.

Validation:
- `cargo +nightly-2026-02-08 fmt --all -- --check`
- `cargo check -p datadog-ffe -p datadog-ffe-ffi -p datadog-ffe-test-suite`
- `cargo nextest run -p datadog-ffe -p datadog-ffe-ffi -p datadog-ffe-test-suite --no-fail-fast`
- `cargo test --doc -p datadog-ffe -p datadog-ffe-ffi -p datadog-ffe-test-suite`
- `cargo +stable clippy -p datadog-ffe -p datadog-ffe-ffi -p datadog-ffe-test-suite --all-targets --all-features -- -D warnings`
- Earlier on this branch: `cargo +stable clippy --workspace --all-targets --all-features -- -D warnings`
- Earlier on this branch: `cargo ffi-test` built the FFI artifacts and the `ffe` example passed; the overall command failed in the unrelated `crashtracking` example with signal 5.

Co-authored-by: leo.romanovsky <leo.romanovsky@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants