Skip to content

[FFL-2929] Add composable assignment request transport - #3693

Draft
leoromanovsky wants to merge 2 commits into
developfrom
agent/ffe-precompute-timeout-retry
Draft

[FFL-2929] Add composable assignment request transport#3693
leoromanovsky wants to merge 2 commits into
developfrom
agent/ffe-precompute-timeout-retry

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

Applications need opt-in assignment-request latency bounds and transient-failure retries without changing default request behavior. Advanced Android callers also need an idiomatic OkHttp transport seam for assignment-specific proxy, TLS, interceptor, and client policy.

Changes

  • Add FlagsConfiguration.Builder.assignmentRequestTimeout(timeoutMs) and assignmentRequestRetryCount(retryCount), both defaulting to 0.
  • Add assignment-only FlagsConfiguration.Builder.assignmentRequestCallFactory(Call.Factory).
  • Keep SDK ownership of the URL, method, body, authentication, and custom headers; apply scalar timeout/retry policy to calls created by the supplied factory.
  • Use a fresh one-shot Call per retry and cover the complete response body with an explicitly configured per-attempt timeout.
  • Add construction-level builder wiring, real MockWebServer body-timeout tests, retry lifecycle tests, API fixtures, README, and changelog updates.

Decisions

  • Upgrading preserves request behavior: omitted timeout and retry settings make one request, add no call timeout, and leave the supplied/platform transport authoritative.
  • The custom Call.Factory affects assignments only. Exposure and evaluation uploads retain SDK transports, and the caller owns factory resources.
  • Retry I/O failures, HTTP 408, and HTTP 5xx; never retry HTTP 429. Honor bounded HTTP 503 Retry-After plus full jitter.
  • Preserve both legacy FlagsConfiguration.copy and copy$default JVM descriptors. The additive generated copy includes new fields, while the legacy overload preserves new transport settings.
  • Expose OkHttp as an API dependency because Call.Factory is public.

Validation

  • Exact CI-image Detekt and focused unit tests cover configuration, downloader retry policy, and production client transport wiring.
  • Default-policy regression proves exactly one newCall/execute, no Call.timeout() access, and no retry delay.
  • Isolated ktlint passes over every changed Kotlin file.
  • Exact API-surface parser comparison, checked fixtures, Kotlin compilation, javap descriptor comparison, and a legacy binary consumer pass.
  • Production downloader coverage includes delayed-body timeout, timeout 0 preserving custom client bounds, and successful delayed body with no SDK timeout.
  • The generated transitive-dependency manifest includes the public OkHttp/Okio API dependencies.

Jira

FFL-2929

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.70968% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.41%. Comparing base (2dafcfa) to head (36e415d).

Files with missing lines Patch % Lines
...s/internal/net/PrecomputedAssignmentsDownloader.kt 91.49% 0 Missing and 4 partials ⚠️
...in/kotlin/com/datadog/android/flags/FlagsClient.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3693      +/-   ##
===========================================
- Coverage    73.41%   73.41%   -0.00%     
===========================================
  Files          999      999              
  Lines        36564    36589      +25     
  Branches      6181     6190       +9     
===========================================
+ Hits         26842    26859      +17     
+ Misses        8000     7996       -4     
- Partials      1722     1734      +12     
Files with missing lines Coverage Δ
...in/com/datadog/android/flags/FlagsConfiguration.kt 91.84% <100.00%> (+5.79%) ⬆️
...in/kotlin/com/datadog/android/flags/FlagsClient.kt 44.34% <0.00%> (-0.85%) ⬇️
...s/internal/net/PrecomputedAssignmentsDownloader.kt 92.16% <91.49%> (-4.14%) ⬇️

... and 43 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leoromanovsky leoromanovsky changed the title [FFL-2929] Bound assignment request latency [FFL-2929] Bound Android assignment request latency Aug 3, 2026
@datadog-official

datadog-official Bot commented Aug 28, 2026

Copy link
Copy Markdown

Tests

All CI checks and tests passed. Datadog automation helped this PR pass.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 89.86%
Overall Coverage: 71.22% (+0.12%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 482c5b4 | Docs | View more details | Give us feedback!

@leoromanovsky leoromanovsky changed the title [FFL-2929] Bound Android assignment request latency [FFL-2929] Add assignment request timeout and retries Aug 28, 2026
@leoromanovsky leoromanovsky changed the title [FFL-2929] Add assignment request timeout and retries [FFL-2929] Add composable assignment request transport Aug 28, 2026
Add opt-in assignment request timeout and retry controls plus an OkHttp Call.Factory transport seam. Preserve upgrade behavior with zero SDK timeout and zero retries by default.

Environment: Datadog workspace
@leoromanovsky
leoromanovsky force-pushed the agent/ffe-precompute-timeout-retry branch from 1067781 to fed07a5 Compare August 28, 2026 23:20
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.

2 participants