Skip to content

Conversation

jonathanmos
Copy link
Member

@jonathanmos jonathanmos commented Oct 9, 2025

What does this PR do?

• Evaluation tracking through RUM

This is controlled by the rumIntegrationEnabled flag in FlagsConfiguration (enabled by default). No deduplication is performed for these requests.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

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)

@jonathanmos jonathanmos force-pushed the jmoskovich/ffl-1113/rum-ff-tracking branch from e904a4b to 8263dbf Compare October 9, 2025 15:30
@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 67.92453% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.76%. Comparing base (740290d) to head (82fe14a).

Files with missing lines Patch % Lines
.../flags/featureflags/internal/DatadogFlagsClient.kt 66.67% 9 Missing and 2 partials ⚠️
...android/internal/flags/RumFlagEvaluationMessage.kt 0.00% 3 Missing ⚠️
...in/com/datadog/android/flags/FlagsConfiguration.kt 71.43% 2 Missing ⚠️
...lin/com/datadog/android/rum/internal/RumFeature.kt 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feature/feature-flagging    #2926      +/-   ##
============================================================
+ Coverage                     70.69%   70.76%   +0.08%     
============================================================
  Files                           834      836       +2     
  Lines                         30378    30415      +37     
  Branches                       5131     5136       +5     
============================================================
+ Hits                          21474    21523      +49     
+ Misses                         7444     7435       -9     
+ Partials                       1460     1457       -3     
Files with missing lines Coverage Δ
...flags/featureflags/internal/RumEvaluationLogger.kt 100.00% <100.00%> (ø)
...lin/com/datadog/android/rum/internal/RumFeature.kt 92.86% <75.00%> (+1.10%) ⬆️
...in/com/datadog/android/flags/FlagsConfiguration.kt 88.24% <71.43%> (-11.76%) ⬇️
...android/internal/flags/RumFlagEvaluationMessage.kt 0.00% <0.00%> (ø)
.../flags/featureflags/internal/DatadogFlagsClient.kt 78.95% <66.67%> (-7.89%) ⬇️

... and 39 files with indirect coverage changes

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

@jonathanmos jonathanmos force-pushed the jmoskovich/ffl-1113/rum-ff-tracking branch 3 times, most recently from 3ea51ba to 2697635 Compare October 13, 2025 10:19
@jonathanmos jonathanmos force-pushed the jmoskovich/ffl-1113/rum-ff-tracking branch from 2697635 to ba4a606 Compare October 15, 2025 08:05
@jonathanmos jonathanmos changed the title [Feature flags] RUM Exposure Tracking [Feature flags] FFL-1113: RUM Evaluation Tracking Oct 15, 2025
@jonathanmos jonathanmos force-pushed the jmoskovich/ffl-1113/rum-ff-tracking branch 2 times, most recently from 86f8838 to 2f7a86c Compare October 15, 2025 09:04
@jonathanmos jonathanmos force-pushed the jmoskovich/ffl-1113/rum-ff-tracking branch from 2f7a86c to 82fe14a Compare October 15, 2025 09:40
@jonathanmos jonathanmos marked this pull request as ready for review October 15, 2025 10:22
@jonathanmos jonathanmos requested review from a team as code owners October 15, 2025 10:22
@jonathanmos jonathanmos changed the title [Feature flags] FFL-1113: RUM Evaluation Tracking [flags] FFL-1113: RUM Evaluation Tracking Oct 15, 2025
* This is enabled by default.
* @param enabled whether flag evaluation events are logged with RUM.
*/
fun rumIntegrationEnabled(enabled: Boolean): Builder {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to check this with iOS if it should be rumIntegrationEnabled or enableRumIntegration.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are using the same property name

}

/**
* Sets whether evaluation logging via RUM integration is enabled.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to explain it better. It is not clear to me what it is about.

* @param flagKey name of the flag.
* @param value value of the flag.
*/
data class RumFlagEvaluationMessage(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: if we expect value to be only one of the given types (like String, Int, Double) we can use sealed class here.

Comment on lines +202 to +204
featureSdkCore
.getFeature(FLAGS_FEATURE_NAME)
?.unwrap<FlagsFeature>()?.processor?.processEvent(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot inject processor simply when we create DatadogFlagsClient? Not sure what is the point of featureSdkCore.getFeature(FLAGS_FEATURE_NAME)?.unwrap<FlagsFeature>() if it is the same module.

Comment on lines +48 to +55
private val rumEvaluationLogger = rumEvaluationLogger ?: run {
val rumFeatureScope = featureSdkCore.getFeature(RUM_FEATURE_NAME)
if (rumFeatureScope != null) {
DefaultRumEvaluationLogger(rumFeatureScope)
} else {
NoOpRumEvaluationLogger()
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we do this at the constructor call site? Otherwise having rumEvaluationLogger both as constructor argument and also a property is confusing.

testedClient.resolveBooleanValue(fakeFlagKey, fakeDefaultValue)

// Then
verify(mockRumEvaluationLogger, never()).logEvaluation(any(), any())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
verify(mockRumEvaluationLogger, never()).logEvaluation(any(), any())
verifyNoInteractions(mockRumEvaluationLogger)

Comment on lines +720 to +723
verify(mockRumEvaluationLogger).logEvaluation(
flagKey = eq(fakeFlagKey),
value = eq(fakeFlagValue)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
verify(mockRumEvaluationLogger).logEvaluation(
flagKey = eq(fakeFlagKey),
value = eq(fakeFlagValue)
)
verify(mockRumEvaluationLogger).logEvaluation(
fakeFlagKey,
fakeFlagValue
)

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