Repository navigation
Conversation
Move the ffe-system-test-data submodule from 8c4d241 to e8777633, which adds the shared flag-selection/selection-vectors.json. Environment: Datadog workspace
Provider.Options.flagSelection(FlagSelection) sends the selected tags and key patterns on the agentless configuration request, so the provider loads only the flags the backend returns. The selection is canonicalized and validated as in the other Datadog SDKs and checked against the shared flag-selection vectors. A selection that cannot be sent is dropped with an error log and the full configuration is loaded; a selection the server ignores is logged once per reason after the configuration is applied. The first provider initialized in a class loader claims the selection until the last provider shuts down. Solves FFL-3572. Environment: Datadog workspace
A provider joining a Remote Config runtime with a selection now logs the Remote Config warning too, once per class loader, instead of only the provider that started the runtime. Also write the White_Space set and the non-ASCII test values as escapes, and cover the legacy Remote Config setting and repeated polls over the URL limit. Environment: Datadog workspace
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Copy the arrays a selection list returns, so a list breaking the toArray contract is malformed input instead of a NullPointerException. Cover the Remote Config warning for an invalid selection, a joining provider with a different dropped selection, the once-per-reason counts across reasons and kinds, the deprecated alias return type and an encoded endpoint path. Document the URL-length drop, the once per class loader second-selection warning and the query parameters a custom endpoint must forward, and use a non-team tag in examples. Environment: Datadog workspace
Remote Configuration delivers the full configuration and uses no flag selection, so a later provider with a different selection only gets the Remote Config warning: "Using the first selection" would be inaccurate. Environment: Datadog workspace
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
PR Blocked - Invalid Label The pull request introduced unexpected labels:
This PR is blocked until:
Note: Simply removing labels from the pull request is not enough - a maintainer must delete this comment then remove the label to remove the block. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f4d62b6bf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| final URI selected = URI.create(url.toString()); | ||
| // Every character is ASCII once percent-encoded, so the length is the byte count. | ||
| return selected.toASCIIString().length() > MAX_URL_BYTES ? null : selected; |
There was a problem hiding this comment.
Exclude URI fragments from the request-length limit
When a custom endpoint contains a fragment, this check counts the fragment's percent-encoded bytes toward the 8192-byte request limit, although URI fragments are never transmitted in an HTTP request. A sufficiently long fragment—or a near-limit endpoint followed by any fragment—therefore makes appendTo return null, causing the provider to discard a valid selection, load every flag, and report too_many_values even though the actual request URL is within the limit; measure only the URI through its query while retaining the fragment in the returned URI.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
More details
Validation is limited to source review: backend interoperability remains unverified, and the shared canonicalization vectors could not be inspected because the test-data submodule was unavailable.
🤖 Bits Code Review · Commit 0f4d62b
What Does This Do
Lets an application load only part of its flag configuration:
With a selection, the agentless configuration request carries repeated
selected_flag_tagsandselected_flag_key_patternsquery parameters, and the provider serves only the flags the backend returns. A flag outside the selection evaluates to the default value withFLAG_NOT_FOUND. Without a selection, the request, the ETag handling and the loaded configuration are unchanged.Motivation
A service that uses a few flags of a large Datadog project still downloads, parses and holds the whole flag configuration. A flag selection lets it fetch and keep only the flags it needs, which shrinks the payload and the memory it holds. The browser, iOS and Android SDKs already support it; this gives the Java server SDK the same option, with the same canonical form and diagnostics.
Additional Notes
White_Space, deduplicated and sorted by UTF-8 bytes, then percent-encoded per RFC 3986. The JDK helpers don't fit:String.trim()andString.strip()each disagree withWhite_Space,String.compareTosorts by UTF-16 code units, andURLEncoderis form encoding (+for a space,*kept).FlagSelectionVectorsTestruns the 38 SDK cases of the sharedflag-selection/selection-vectors.jsonand skips the 6rawQuerycases, which test the server's percent-decoding. Theffe-system-test-datasubmodule moves from8c4d241toe8777633, a single commit that adds these vectors and their validator.Stringelement (possible through a raw list) or an unpaired surrogate ismalformed_selection. More than 31 values in a list, a value over 200 UTF-8 bytes, or a request URL over 8192 bytes also drops the selection. A dropped selection is not sent: the provider logs one error per provider initialization, naming the reason and the limit but never the values, and loads all the flags. Formalformed_selectionthe limit text is the browser SDK's, with "lists" for the Java type:flagSelection must be an object with optional tags and keyPatterns string lists.DD-Flag-Selection-Ignoredresponse header is read only on a 200 to a request that carried a selection. Its value is kept only when it is exactly one of the five known reasons, and isunknownotherwise. It is logged once per reason, after the configuration is applied.selected_flag_*query parameters and theDD-Flag-Selection-Ignoredheader.flag_selection.droppedandflag_selection.ignored, tagged withreason, go through the existing health metrics once per reason, so they needdd-java-agent. Without the agent, the error logs are the only signal. The telemetry intake drops these two counts until they are registered there, which is separate work.FlagSelectionandOptions.flagSelectionare new public API, also on the deprecateddatadog.trace.api.openfeature.Provider.Optionsalias. The option is set in code only: there is no environment variable or system property.8c4d241tod8911fd#13183 both move theffe-system-test-datasubmodule. Whichever merges second should taked8911fd, Bump dd-smoke-tests/openfeature/src/test/resources/ffe-system-test-data from8c4d241tod8911fd#13183's commit, whoseflag-selection/is identical toe8777633.ProviderTest.testNullConfigurationAfterReadyTransitionsToErrorAndRecoversfailed once in a full local run of the module (a Mockito invocation count on a configuration-change handler) and passed in isolated runs on this branch and on master. The test and its no-selection path are unchanged here, so it looks like an existing timing flake.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: FFL-3572