-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat: Update in-process resolver to support flag metadata #1102 #1122
base: main
Are you sure you want to change the base?
feat: Update in-process resolver to support flag metadata #1102 #1122
Conversation
return fallBackMetadata; | ||
} | ||
|
||
ImmutableMetadata.ImmutableMetadataBuilder metadataBuilder = ImmutableMetadata.builder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have a mergeMetdata
or addMetadata
method in the ImmutableMetadataBuilder
@@ -79,7 +81,7 @@ public void eventHandling() throws Throwable { | |||
final MutableStructure syncMetadata = new MutableStructure(); | |||
syncMetadata.add(key, val); | |||
|
|||
InProcessResolver inProcessResolver = getInProcessResolverWth(new MockStorage(new HashMap<>(), sender), | |||
InProcessResolver inProcessResolver = getInProcessResolverWith(new MockStorage(new HashMap<>(), sender), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this was a typo
1fa47fc
to
1285149
Compare
…e#1102 Signed-off-by: Todd Baert <[email protected]>
1285149
to
c08e7bc
Compare
@chrfwow this is definitely a step in the right direction - I think there's probably some null check missing related to the metadata causing the e2e failures: Working with @beeme1mr and a few others in in slack, we've decided another thing we'd want here is a very basic mechanism for reducing duplication: the ability to add metadata for the entire flag set at the "top level" which all flags inherit: {
"metadata": {
"foo": "bar"
},
"flags": {
"flag1": {
// ...
"metadata": {
// "foo": "bar" is automatically included, but can be overridden if defined in `flag1`
}
}
}
} The same thing is implemented here: open-feature/js-sdk-contrib#1120 cc @beeme1mr |
@JsonProperty("defaultVariant") String defaultVariant, | ||
@JsonProperty("variants") Map<String, Object> variants, | ||
@JsonProperty("targeting") @JsonDeserialize(using = StringSerializer.class) String targeting, | ||
@JsonProperty("metadata") Map<String, Object> metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] Currently, we do need to provide an empty map everywhere to be backward compatible. Could we also omit this parameter and make it optional? more a question out of curiosity ;)
This PR
Adds support for flag metadata in the in-process resolver
Related Issues
Fixes #1102