Repository navigation
Add a flag selection option to the OpenFeature provider #13291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+2,155
−22
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
820af79
Pin the flag selection test vectors
mark-caii 7fbf03c
Add a flag selection option to the OpenFeature provider
mark-caii ceb2a4a
Warn every Remote Config provider that sets a flag selection
mark-caii 31c9205
Merge origin/master into mark.cai/FFL-3572
mark-caii 23458ba
Tighten flag selection tests and docs
mark-caii 0f4d62b
Skip the second-selection warning in Remote Config mode
mark-caii f1ef23a
Address review nits in flag selection request
mark-caii 5cc9c5a
Report repeated flag selection ignored headers as unknown
mark-caii e3d668b
Report a joining provider's own dropped selection and warn only when …
mark-caii 7b0cd97
Merge master into mark.cai/FFL-3572
mark-caii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
dd-openfeature/src/main/java/com/datadog/openfeature/FlagSelection.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package com.datadog.openfeature; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * The flags a provider loads: the flags that have any of the tags, or whose key matches any of the | ||
| * key patterns. A selection with neither loads all the flags. | ||
| * | ||
| * <p>Set it with {@link Provider.Options#flagSelection(FlagSelection)}. | ||
| */ | ||
| public final class FlagSelection { | ||
| List<String> tags; | ||
| List<String> keyPatterns; | ||
|
|
||
| /** Creates a selection with no tags and no key patterns. */ | ||
| public FlagSelection() {} | ||
|
|
||
| /** | ||
| * Sets the tags. Tags match exactly and case-sensitively, and a flag matches when it has any of | ||
| * them. | ||
| * | ||
| * @param tags the tags, or {@code null} for none. | ||
| * @return this selection. | ||
| */ | ||
| public FlagSelection tags(final List<String> tags) { | ||
| this.tags = tags; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the key patterns. A pattern matches the whole flag key, case-sensitively: {@code *} | ||
| * matches any run of characters, and every other character is literal. | ||
| * | ||
| * @param keyPatterns the key patterns, or {@code null} for none. | ||
| * @return this selection. | ||
| */ | ||
| public FlagSelection keyPatterns(final List<String> keyPatterns) { | ||
| this.keyPatterns = keyPatterns; | ||
| return this; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.