Skip to content

RUM-13018 - Add 'setVersion' method to the configuration#3137

Merged
hamorillo merged 4 commits into
developfrom
hector.morilloprieto/RUM-13018
Jan 22, 2026
Merged

RUM-13018 - Add 'setVersion' method to the configuration#3137
hamorillo merged 4 commits into
developfrom
hector.morilloprieto/RUM-13018

Conversation

@hamorillo

@hamorillo hamorillo commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Similar to what DataDog/dd-sdk-ios#2586 applies for the iOS SDK, this PR adds a setVersion method in the Configuration.Builder that allows applications to use a custom version that will be used by the SDK.

How

First Approach - Discarded

I noticed that there was already a way to set a custom version using additionalConfiguration:~~

.setAdditionalConfiguration(
    mapOf(Datadog.DD_APP_VERSION_TAG to "customVersion")
)

~~However Datadog.DD_APP_VERSION_TAG is internal an cannot be used directly by applications. (although it would be possible to rely on the raw string). In DatadogCore.applyAdditionalConfiguration if a value for the version is provided, it override the default value.

If a custom version is provided will be saved in the Configuration and used when initializing the CoreFeature. The priority order is:

Custom Version -> Package Version Name -> Package Version Code -> Default App Version

Apart from that, the version can be overridden via AdditionalConfig when used by cross-platform SDKs.

Additional Notes

The previous information raises the following question:
– I haven’t found any uses of Datadog.DD_APP_VERSION_TAG outside of that method. Can we remove it and go with a different implementation, or is there another reason to keep that code?

Edited: additionalConfig is used by cross-platforms for example so we should keep it there.

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)

@hamorillo
hamorillo force-pushed the hector.morilloprieto/RUM-13018 branch from 971ceb6 to e032f07 Compare January 21, 2026 11:25
@datadog-official

datadog-official Bot commented Jan 21, 2026

Copy link
Copy Markdown

🎯 Code Coverage
Patch Coverage: 100.00%
Overall Coverage: 66.13% (+0.04%)

View detailed report

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

@hamorillo
hamorillo force-pushed the hector.morilloprieto/RUM-13018 branch from e032f07 to 2120424 Compare January 21, 2026 12:46
@codecov-commenter

codecov-commenter commented Jan 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.93%. Comparing base (beacf35) to head (0f1f019).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3137      +/-   ##
===========================================
- Coverage    70.95%   70.93%   -0.03%     
===========================================
  Files          912      912              
  Lines        33519    33524       +5     
  Branches      5636     5635       -1     
===========================================
- Hits         23783    23777       -6     
- Misses        8159     8165       +6     
- Partials      1577     1582       +5     
Files with missing lines Coverage Δ
...atadog/android/core/configuration/Configuration.kt 99.09% <100.00%> (+0.03%) ⬆️
...n/com/datadog/android/core/internal/CoreFeature.kt 85.03% <100.00%> (+0.04%) ⬆️

... and 38 files with indirect coverage changes

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

@hamorillo
hamorillo marked this pull request as ready for review January 21, 2026 13:53
@hamorillo
hamorillo requested a review from a team as a code owner January 21, 2026 13:53
@0xnm

0xnm commented Jan 22, 2026

Copy link
Copy Markdown
Member

I think on Android we didn't have much demand to add such configuration option, however, once merged we can close the following issue #1550.

Worth also notify Cross-Platform teams that they can switch to this API.

…e changing the approach to store the custom version in the configuration.

The customVersion will be used when instantiating DefaultAppVersionProvider. The priority order is:

Custom Version -> Package Version Name -> Package Version Code -> Default App Version

Apart from that, the version can be overridden via AdditionalConfig when used by cross-platform SDKs.
@hamorillo
hamorillo force-pushed the hector.morilloprieto/RUM-13018 branch from 2120424 to 11a89da Compare January 22, 2026 08:51
@aleksandr-gringauz

aleksandr-gringauz commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

I think on Android we didn't have much demand to add such configuration option, however, once merged we can close the following issue #1550.

Worth also notify Cross-Platform teams that they can switch to this API.

Thanks for mentioning this. There is actually one important comment there. @hamorillo could you please check that this comment is relevant and if yes - I suggest adding a comment about this for the new setVersion function.

@hamorillo

Copy link
Copy Markdown
Contributor Author

Thanks for mentioning this. There is actually one important #1550 (comment) there.

Just to keep track of what we've discovered.
Looks like that comment don't apply anymore as we are no longer using version to match with the correct mapping file.

image

That change was merged in the SDK here.

@aleksandr-gringauz

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ 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".

@hamorillo
hamorillo merged commit 88de5ea into develop Jan 22, 2026
26 checks passed
@hamorillo
hamorillo deleted the hector.morilloprieto/RUM-13018 branch January 22, 2026 14:41
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.

4 participants