Skip to content

Feature flagging [WIP]#2879

Merged
jonathanmos merged 3 commits into
feature/feature-flaggingfrom
jmoskovich/ff-feature
Sep 16, 2025
Merged

Feature flagging [WIP]#2879
jonathanmos merged 3 commits into
feature/feature-flaggingfrom
jmoskovich/ff-feature

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Sep 15, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Please ignore this PR for now - this is a WIP for feature flags.

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)

@typotter typotter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is off to a great start and sets us up really well for iterating into all the finer, detailed parts.

Comment thread features/dd-sdk-android-flags/README.md Outdated
@@ -0,0 +1,5 @@
# Datadog Feature Flags SDK for Android

See the dedicated [Datadog Feature Flags documentation][1] to learn how to monitor and send feature flags in your Android or Android TV application to Datadog.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We also have this:
https://docs.datadoghq.com/getting_started/feature_flags/
The RUM link is more for tracking via the already-existing RUM feature flag tracking ability. Our getting started docs focus on configuring and sending the flags.

) : StoreManager {
private val featureFlagState = AtomicReference<Map<String, PrecomputedFlag>>(emptyMap())

override fun getBooleanValue(key: String, defaultValue: Boolean): Boolean {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the most useful comment I can give this early would be to refactor the StoreManager to return a PrecomputedFlag or null and move selecting the variationValue up to the FlagProvider level, where we'd also have the details methods like resolveBooleanDetails(key, default). Hoisting up the whole PrecomputedFlag` gives us the all the data we need to create an evaluation reason for integration with open feature.

.post(body)
.build()
return try {
callFactory.newCall(request).execute().use { response ->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like okhttp3 has a pretty slick Interceptor pattern to control retries so we can get retryable status codes, timing, and exponential backoff pretty easily

internal class PrecomputeMapper(
private val internalLogger: InternalLogger
) {
internal fun map(rawJson: String): Map<String, PrecomputedFlag> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

At EPPO, we ran into all kinds of headaches with managing JSON decoding. Granted, we had a core library powering both server and android libraries and the datastructure was much more complex than the Precomputed Flags we're working with here. I like the mapper. It's explicit and doesn't rely on anything beyond json.org

@jonathanmos
jonathanmos marked this pull request as ready for review September 16, 2025 15:00
@jonathanmos
jonathanmos requested review from a team as code owners September 16, 2025 15:00

@typotter typotter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

approving for feature branch dev

@jonathanmos
jonathanmos merged commit 8b9b5f7 into feature/feature-flagging Sep 16, 2025
4 of 11 checks passed
@jonathanmos
jonathanmos deleted the jmoskovich/ff-feature branch September 16, 2025 15:01
This was referenced Nov 4, 2025
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