Repository navigation
feat(flagd): populate flag metadata - #391
Open
maisonsmart28-lang wants to merge 4 commits into
Open
maisonsmart28-lang wants to merge 4 commits into
maisonsmart28-lang wants to merge 4 commits into
Conversation
Convert the metadata Struct in flagd responses to a Hash and return it as flag_metadata; use an empty Hash when there is none and for errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ng8L4fkcy7Uzkq3wYPTmMs Signed-off-by: maisonsmart28-lang <maison.smart28@gmail.com>
Add the steps for metadata.feature and include it in the cucumber run. The @metadata-provider scenarios need selector support and stay excluded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ng8L4fkcy7Uzkq3wYPTmMs Signed-off-by: maisonsmart28-lang <maison.smart28@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ng8L4fkcy7Uzkq3wYPTmMs Signed-off-by: maisonsmart28-lang <maison.smart28@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ng8L4fkcy7Uzkq3wYPTmMs Signed-off-by: maisonsmart28-lang <maison.smart28@gmail.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of Changes
flagd returns flag metadata in every evaluation response, but the provider always set
flag_metadatatonil.process_requestnow converts the response'smetadataStruct to a Hash and returns it asflag_metadata. When flagd sends no metadata, it returns an empty Hash.error_responsereturns an empty Hash instead ofnil, so callers and hooks always get a Hash.metadata.feature, with steps for "the resolved metadata should contain" and "the resolved metadata is empty". The two@metadata-providerscenarios use a selector, so they stay excluded until selector support (feat(flagd): add selector support #365) lands.Numbers in a protobuf Struct are doubles, so an integer value such as
1comes back as1.0. This matches whatStruct#to_halready does for object flag values. The metadata step compares withinclude, where1 == 1.0.Fixes #361
Type of Change
Testing
Added three specs to
client_spec.rbthat callprocess_requestwith aResolveBooleanResponse: metadata present, metadata absent, and aGRPC::NotFounderror.What I checked: I could not install the gems or run Docker in my environment, so I have not run
rspec,rubocopor the e2e suite. I checked the changed Ruby files withruby -c. I also ranprocess_requestagainst small stand-ins for the gRPC and protobuf classes, which gave the expected Hash,{}and{}for the three cases. CI will be the first real run of the specs and ofmetadata.feature.Checklist
bundle exec rspec) (not run locally, see above)bundle exec rubocop) (not run locally)git commit -s)🤖 Generated with Claude Code
https://claude.ai/code/session_01Ng8L4fkcy7Uzkq3wYPTmMs