Add Metadata field to ListFlags API response#4848
Conversation
|
👋 Hi @erfantarighi! Thanks for your contribution to this project. It looks like one or more of your commits are missing a DCO (Developer Certificate of Origin) sign-off. The DCO is a simple way for you to certify that you have the right to submit this code under the project's license. How to fix this: # For future commits, use the -s flag
git commit -s -m "Your commit message"
# To sign off on existing commits in this PR
git rebase HEAD~$(git rev-list --count origin/v2..HEAD) --signoff
git push --force-with-leaseThe 📋 View the failing DCO check for more details For more information about the DCO, visit: https://developercertificate.org/ |
|
Related Documentation Checked 4 published document(s). No updates required. You have 1 draft document(s). Publish docs to keep them always up-to-date |
Signed-off-by: Erfan Tarighi <60587104+erfantarighi@users.noreply.github.com>
|
Looks like a very important feature. |
There was a problem hiding this comment.
great idea! thanks for your contribution
will make a note to also add this to the server and client sdks next
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #4848 +/- ##
==========================================
+ Coverage 58.11% 58.57% +0.46%
==========================================
Files 135 135
Lines 16843 16844 +1
==========================================
+ Hits 9788 9867 +79
+ Misses 6375 6292 -83
- Partials 680 685 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Documentation Updates Checked 4 published document(s). No updates required. You have 1 draft document(s). Publish docs to keep them always up-to-date |
This PR updates the
ListFlagsAPI to include theMetadatafield in the returnedFlagobjects.Previously, the
ListFlagsAPI did not include metadata for flags, which made it inconsistent with other endpoints and limited clients’ ability to fully understand flag context in bulk retrievals.This change allows clients to access metadata for each flag without needing to fetch flags individually.
Details:
ListFlagsserver implementation (server/flag.go) to populate theMetadatafield in eachflipt.Flagreturned.flag.Metadatafield retrieved from storage.Example response:
{ "flags": [ { "key": "example-flag", "name": "Example Flag", "description": "A test flag", "enabled": true, "metadata": { "team": "growth", "owner": "alice" } } ], "totalCount": 1 }Alternative (gRPC):
grpcurl -d '{"environment_key": "default", "namespace_key": "default", "type_url": "flipt.core.Flag"}' \ localhost:9000 environments.EnvironmentsService/ListResources