RUM-13018 - Add 'setVersion' method to the configuration#3137
Conversation
971ceb6 to
e032f07
Compare
|
🎯 Code Coverage 🔗 Commit SHA: 0f1f019 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
e032f07 to
2120424
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
|
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. |
…customized by SDK clients.
…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.
Fix related test.
2120424 to
11a89da
Compare
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 |
Just to keep track of what we've discovered.
That change was merged in the SDK here. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |

What does this PR do?
Similar to what DataDog/dd-sdk-ios#2586 applies for the iOS SDK, this PR adds a
setVersionmethod in theConfiguration.Builderthat 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_TAGis 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_TAGoutside of that method. Can we remove it and go with a different implementation, or is there another reason to keep that code?Edited:
additionalConfigis used by cross-platforms for example so we should keep it there.Review checklist (to be filled by reviewers)