Skip to content

Include sdk name/version for flag config requests#3162

Merged
greghuels merged 1 commit into
developfrom
greg.huels/FFL-1774/send-sdk-name-version
Jan 29, 2026
Merged

Include sdk name/version for flag config requests#3162
greghuels merged 1 commit into
developfrom
greg.huels/FFL-1774/send-sdk-name-version

Conversation

@greghuels

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a new source field to the /precompute-assignments endpoint request payload containing SDK identification information (sdk_name and sdk_version). This allows the backend to track which SDK and version is making feature flag configuration requests.

The resulting payload structure:

{
  "data": {
    "type": "precompute-assignments-request",
    "attributes": {
      "env": {
        "dd_env": "production"
      },
      "source": {
        "sdk_name": "dd-sdk-android",
        "sdk_version": "3.7.0"
      },
      "subject": {
        "targeting_key": "user123",
        "targeting_attributes": {...}
      }
    }
  }
}

Motivation

This change aligns with the iOS SDK implementation (DataDog/dd-sdk-ios#2656) to provide consistent SDK metadata across platforms. The source information will be used for logging feature flagging configuration requests to calculate usage metrics and track which SDK versions are being used.

Additional Notes

Changes made:

  • Added sdkVersion property to FlagsContext data class
  • Updated FlagsContext.create() to pass sdkVersion from DatadogContext
  • Added buildSourcePayload() method in PrecomputedAssignmentsRequestFactory
  • Added SDK_NAME = "dd-sdk-android" constant
  • Updated all relevant unit tests to include sdkVersion and validate the source field

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@datadog-official

datadog-official Bot commented Jan 27, 2026

Copy link
Copy Markdown

🎯 Code Coverage
Patch Coverage: 100.00%
Overall Coverage: 66.12% (+0.05%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: d06d781 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.99%. Comparing base (5910f8b) to head (d06d781).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3162      +/-   ##
===========================================
+ Coverage    70.89%   70.99%   +0.10%     
===========================================
  Files          912      912              
  Lines        33542    33549       +7     
  Branches      5640     5640              
===========================================
+ Hits         23779    23816      +37     
+ Misses        8183     8155      -28     
+ Partials      1580     1578       -2     
Files with missing lines Coverage Δ
...tadog/android/flags/internal/model/FlagsContext.kt 100.00% <100.00%> (ø)
...ternal/net/PrecomputedAssignmentsRequestFactory.kt 73.33% <100.00%> (+2.42%) ⬆️

... and 33 files with indirect coverage changes

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

@greghuels
greghuels marked this pull request as ready for review January 29, 2026 14:57
@greghuels
greghuels requested a review from a team as a code owner January 29, 2026 14:57
@greghuels
greghuels merged commit 405232a into develop Jan 29, 2026
27 checks passed
@greghuels
greghuels deleted the greg.huels/FFL-1774/send-sdk-name-version branch January 29, 2026 15:19
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