Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05fcdef98b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
More details
The diagnostics preserve existing assignment data while maintaining a stable per-client identity and synchronized fetch sequence. The completed static review identified no actionable defect, but focused tests could not execute because a required aapt2 dependency was unavailable in the offline cache.
🤖 Bits Code Review · Commit 05fcdef
🎉 All green!🧪 All tests passed 🔄 Datadog retried 1 test - 1 passed on retry 🎯 Code Coverage (details) 🔗 Commit SHA: b29a633 | Docs | View more details | Give us feedback! |
vjfridge
left a comment
There was a problem hiding this comment.
Looks like we have merge conflict to resolve and I left a couple non-blocking comments but otherwise looks good to me!
61f6dce to
6cfb11c
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Deployed edge/proxy acceptance of the new payload and the prerequisite EVP schema remain unverified.
2 open issues
What changed in this PR
Adds per-instance and per-fetch diagnostics to Flags assignment requests, helping distinguish SDK clients and logical fetches when investigating repeated requests.
Changes:
- Generates a UUIDv7 instance ID and captures fetch sequence and trigger in an immutable snapshot.
- Passes diagnostics through the downloader and serializes them into the request body.
- Adds identity, sequencing, concurrency, UUID format, and request-body tests.
| File | Description |
|---|---|
features/dd-sdk-android-flags/src/test/kotlin/com/datadog/android/flags/utils/forge/ForgeConfigurator.kt |
Registers the diagnostics fixture factory. |
features/dd-sdk-android-flags/src/test/kotlin/com/datadog/android/flags/utils/forge/FlagsRequestDiagnosticsForgeryFactory.kt |
Generates diagnostics test fixtures. |
features/dd-sdk-android-flags/src/test/kotlin/com/datadog/android/flags/internal/net/PrecomputedAssignmentsRequestFactoryTest.kt |
Verifies diagnostic fields and unchanged request content. |
features/dd-sdk-android-flags/src/test/kotlin/com/datadog/android/flags/internal/evaluation/EvaluationsManagerTest.kt |
Tests instance identity and logical fetch sequencing. |
features/dd-sdk-android-flags/src/test/kotlin/com/datadog/android/flags/internal/diagnostics/UUIDv7GeneratorTest.kt |
Checks UUID timestamp, version, variant, and uniqueness. |
features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/net/PrecomputedAssignmentsRequestFactory.kt |
Adds optional diagnostics to request JSON. |
features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/net/PrecomputedAssignmentsReader.kt |
Accepts a diagnostics snapshot. |
features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/net/PrecomputedAssignmentsDownloader.kt |
Forwards diagnostics to the request factory. |
features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/evaluation/EvaluationsManager.kt |
Owns instance identity and allocates fetch diagnostics. |
features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/diagnostics/FlagsRequestDiagnostics.kt |
Defines diagnostics, triggers, and UUIDv7 generation. |
detekt_custom_unsafe_calls.yml |
Registers the JSON map constructor as potentially throwing. |
Review effort: Balanced
Capture typed diagnostics with each logical fetch and serialize them directly in the precomputed request body for edge request-log correlation.
6cfb11c to
b29a633
Compare

What does this PR do?
References FFLSDK-272.
Send 3 new fields in the precomputed assignments POST:
sdk.instance_id- uniquely identifies the in-memory configuration-owning client instancefetch.sequence- a logical fetch operation in the SDK's lifecyclefetch.trigger- the SDK's internal accounting of what triggered the fetchMotivation
Distinguish configuration-owning SDK instances and logical fetches when investigating repeated assignment requests in edge request logs.
Implementation
EvaluationsManagerowns the UUIDv7 instance ID and fetch sequence. Each accepted fetch captures an immutable diagnostics value, which travels with that fetch to the existing request factory. The factory adds its fields directly to the structured request body and serializes the complete body once.The in-package
UUIDv7Generatorsupplies the instance ID. A diagnostics trigger enum usesinitializationandcontext_change, consistently across SDKs.Additional Notes
Local validation: all 613 Flags unit tests, Detekt, ktlint and API checks passed. The API check used the unchanged generated reference with apiDump excluded to avoid the existing Gradle task-ordering conflict. Tests cover instance identity, logical sequencing, concurrent acceptance and the complete request body. Verify deployed edge/proxy acceptance and the EVP schema prerequisite before SDK release.
Review checklist (to be filled by reviewers)
Reviewer selection
🤖 Automatically generated · runs asynchronously. The FFE reviewer-routing workflow maintains this section; it does not replace human review.
✅ Complete — reviewer coverage verified.
What happened: The workflow matched this PR to the published registry, selected 2 reviewers for its initiative and any additional review areas, and checked their pending requests or submitted reviews on the evaluated head. Existing reviewers and teams were preserved. Coverage is not approval.
Decision
Initiative: fallback / android
Why this match: Android Flags SDK maintenance. The change adds an internal diagnostics object to the precomputed-assignments POST body. The object holds a UUIDv7 SDK instance ID, a logical fetch sequence and a fetch trigger (initialization or context_change), which help investigate repeated assignment requests in edge logs. EvaluationsManager creates one diagnostics value per fetch, and the downloader and request factory pass it into the request body. Initialization, readiness, configuration receipt and evaluation outcomes are unchanged. There is no onboarding or setup-verification behavior (guided-onboarding), no EVP evaluation telemetry or consent handling (flag-evaluation-evp), and no tag scoping or offline bootstrap. No registered project fits, so the Android fallback applies. The fallback's path and language constraints match the changed Kotlin flags sources.
Why these owners: The matched initiative has fewer than two approved, non-author candidates. The approved global pool supplies the remaining review owners; proposed memberships were not activated.
The PR author is excluded from reviewer selection.
Debug or fix a problem
Workflow run · Bits Code session
dry_run=false. Unchanged completed runs are skipped. If the receipt saysneeds_reconciliationor a write outcome is uncertain, ask the workflow owner to reconcile GitHub and the receipt before retrying; do not delete the lock blindly.Evidence and run details
Changed paths:
features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/diagnostics/FlagsRequestDiagnostics.kt,features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/evaluation/EvaluationsManager.kt,features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/net/PrecomputedAssignmentsDownloader.kt,features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/net/PrecomputedAssignmentsReader.kt,features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/net/PrecomputedAssignmentsRequestFactory.ktEvaluated head:
b29a63304c2e103f89dc2703fd7e267c2c121503Registry revision:
revision:54491247-28c5-4ac2-a03b-579fcf68b1c0Pinned skill source:
d214cfc65ae154b97d39af5cf32caf48aaec9bf0Instructions: workflow-injected snapshot (no plugin loaded)
Instruction snapshot SHA-256:
f23b2a88c13c0da90e2dd58246a14f257af91e2195c555039bd555b52e6f3516