8000 Add `Metadata` field to `ListFlags` API response by erfantarighi · Pull Request #4848 · flipt-io/flipt · GitHub
[go: up one dir, main page]

Skip to content

Add Metadata field to ListFlags API response#4848

Merged
markphelps merged 1 commit intoflipt-io:v2from
erfantarighi:v2
Oct 5, 2025
Merged

Add Metadata field to ListFlags API response#4848
markphelps merged 1 commit intoflipt-io:v2from
erfantarighi:v2

Conversation

@erfantarighi
Copy link
Contributor
@erfantarighi erfantarighi commented Oct 4, 2025

This PR updates the ListFlags API to include the Metadata field in the returned Flag objects.

Previously, the ListFlags API 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:

  • Updated the ListFlags server implementation (server/flag.go) to populate the Metadata field in each flipt.Flag returned.
  • The metadata is pulled directly from the flag.Metadata field 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

@erfantarighi erfantarighi requested a review from a team as a code owner October 4, 2025 19:16
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 4, 2025
@github-actions
Copy link
Contributor
github-actions bot commented Oct 4, 2025

👋 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-lease

The -s flag adds this line to your commit message:
Signed-off-by: Your Name <your.email@example.com>

📋 View the failing DCO check for more details

For more information about the DCO, visit: https://developercertificate.org/

@dosubot
Copy link
dosubot bot commented Oct 4, 2025

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

How did I do? Any feedback?  Join Discord

Signed-off-by: Erfan Tarighi <60587104+erfantarighi@users.noreply.github.com>
@sysradium
Copy link

Looks like a very important feature.

Copy link
Collaborator
@markphelps markphelps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea! thanks for your contribution

will make a note to also add this to the server and client sdks next

@codecov
Copy link
codecov bot commented Oct 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.57%. Comparing base (b098687) to head (ea0ac54).
⚠️ Report is 2 commits behind head on v2.

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     
Flag Coverage Δ
integrationtests 33.92% <0.00%> (+1.70%) ⬆️
unittests 49.15% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@markphelps markphelps merged commit 7d61b1f into flipt-io:v2 Oct 5, 2025
25 checks passed
@dosubot
Copy link
dosubot bot commented Oct 5, 2025

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

How did I do? Any feedback?  Join Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0