Skip to content

Document flag selection for the Android, React Native, and Unity SDKs - #42353

Draft
mark-caii wants to merge 1 commit into
masterfrom
mark.cai/FFL-3757-android-rn-unity
Draft

mark-caii wants to merge 1 commit into
masterfrom
mark.cai/FFL-3757-android-rn-unity

Conversation

@mark-caii

Copy link
Copy Markdown
Contributor

What does this PR do? What is the motivation?

Documents the flagSelection option of the Android, React Native, and Unity client SDKs. The option loads only the flags that match a set of tags or key patterns.

  • feature_flags/client/android.md: adds flagSelection(tags, keyPatterns) to Advanced configuration > Global configuration and a Load a subset of flags section, with Kotlin and Java samples.
  • feature_flags/client/reactnative.md: adds flagSelection to Configure Feature Flags options, a Load a subset of flags section, and a troubleshooting step.
  • feature_flags/client/unity.md: adds flagSelection to Advanced configuration and a Load a subset of flags section.

Each section covers the matching rules, when the selection is fixed, the limits, what happens when the SDK does not send a selection or Datadog ignores it (DD-Flag-Selection-Ignored reasons), the log messages and how to make them visible, the proxy requirement for the response header, and the FLAG_NOT_FOUND result for flags outside the selection.

The sections mirror the browser SDK's Load a subset of flags section and the iOS section in #42043.

Merge readiness

  • Ready for merge

Do not merge until released. Each page has an X.Y.Z minimum version marked with <!-- TODO: minimum version once released -->. Replace it when the release ships:

AI assistance

Drafted with an AI coding assistant from the SDK source: dd-sdk-android at the DataDog/dd-sdk-android#4031 merge, the DataDog/dd-sdk-reactnative#1560 branch, and dd-sdk-unity at the DataDog/dd-sdk-unity#337 merge. The code samples, limits, and log messages were checked against that source.

For Datadog employees:

  • ⚠️ Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). If you've already created your PR with an incorrect branch name, please rename your branch and open a fresh PR.
  • 🤖 New: Comment with /review to run an automated check that catches common issues before a Documentation team member reviews your PR.

Additional notes

Differences between the SDKs

  • Android: the option takes two nullable lists. A null value in a list makes the selection malformed. Errors go to Logcat with the Datadog tag and print only after Datadog.setVerbosity(). The OpenFeature get<Type>Details() methods and FlagsClient.resolve() return FLAG_NOT_FOUND for flags outside the selection.
  • React Native: the option is passed to DdFlags.enable(). The JavaScript layer checks the shape of the selection, and the iOS and Android SDKs apply the limits, read the response header, and cache flags. On iOS, the native errors name the option Flags.Configuration.flagSelection. Errors print only when verbosity is set. The selection does not filter a configuration that the app supplies itself, such as with DatadogOfflineOpenFeatureProvider.
  • Unity: the flags feature is implemented in C# and does not use the native flags SDKs. The selection is set through the FlagsConfiguration constructor (the fields are read-only, so object initializers do not compile). Flags are not cached across launches, so the page has no paragraph about cached flags after a selection change. Errors always go to Unity's Debug logger, and the SDK verbosity setting does not filter them. On WebGL, a proxy must also expose the response header through CORS.

Open questions

  1. Team tags: the browser and iOS pages warn that team tags can change when flag ownership changes. These pages make no claim about team tags and recommend tags added for selection instead. Should these pages mention team tags, and with which wording? The wording should match on every client page.
  2. Proxy guide: feature_flags/guide/proxy_sdk_traffic.md is edited in Document flag selection for the iOS SDK #42043, so this PR puts the proxy note on each SDK page and leaves the guide unchanged. The guide's Android and React Native tabs can get the same note after Document flag selection for the iOS SDK #42043 merges. The guide has no Unity tab.
  3. Android: a later develop change reports the ignored reason as redacted in some configurations. If 3.17.0 includes it, the Android reason table may need a row for it.
  4. Unity: confirm the product name and version format to use for the minimum version. The package version on develop is 2.0.0.

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.

1 participant