-
Notifications
You must be signed in to change notification settings - Fork 72
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: support flag metadata #1476
Conversation
✅ Deploy Preview for polite-licorice-3db33c canceled.
|
3b6e501
to
c55537f
Compare
Signed-off-by: Aasif Khan <[email protected]>
c55537f
to
931c120
Compare
Signed-off-by: Aasif Khan <[email protected]>
Hey @aasifkhan7, I tested this locally and wasn't able to see flag metadata returned as a response. Here's the flag configuration I was using: {
"flags": {
"myBoolFlag": {
"state": "ENABLED",
"variants": {
"on": true,
"off": false
},
"defaultVariant": "on"
}
},
"metadata": {
"id": "test",
"version": "1"
}
} Here are the test evaluations I tried: curl -X POST "localhost:8013/flagd.evaluation.v1.Service/ResolveBoolean" -d '{"flagKey":"myBoolFlag","context":{}}' -H "Content-Type: application/json" and curl -X POST 'http://localhost:8016/ofrep/v1/evaluate/flags' Please map the |
Signed-off-by: Aasif Khan <[email protected]>
f75d5b5
to
dd48ee3
Compare
Hi @beeme1mr, I've updated the commit to include the setting of |
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.
@aasifkhan7 nice job so far!
OFREP works as expected:
curl -X POST 'http://localhost:8016/ofrep/v1/evaluate/flags' | jq
{
"flags": [
{
"value": 1,
"key": "myIntFlag",
"reason": "STATIC",
"variant": "one",
"metadata": {
"flagSetId": "test",
"flagSetVersion": "1"
},
...
}
]
}
curl -X POST "localhost:8013/flagd.evaluation.v1.Service/ResolveBoolean" -d '{"flagKey":"myBoolFlag","context":{}}' -H "Content-Type: application/json" | jq
{
"value": true,
"reason": "STATIC",
"variant": "on",
"metadata": {
"flagSetId": "test",
"flagSetVersion": "1"
}
}
I left some comments - I also think we need some basic test coverage for this, but nice job!
Signed-off-by: Aasif Khan <[email protected]>
Signed-off-by: Aasif Khan <[email protected]>
👋 Hello folks, |
Signed-off-by: Aasif Khan <[email protected]>
@apodgorbunschih I've updated the PR to handle any fields that come in metadata. Please re-review @beeme1mr @toddbaert |
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.
Thanks, I'll manually test this. Could you please also ensure there are tests in the PR. Thanks!
I've also addressed the unrelated license compliance issue. |
Signed-off-by: Aasif Khan <[email protected]>
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 manually tested it it nearly works. Please adjust the merge priority logic and add some tests. We should be good to go after that. Thanks!
Hey @aasifkhan7 ! This seems very close to done, with the exception of some tests. Are you able to finish any time soon? If not, I can add the tests onto your existing work (you will still appear as a committer). Let me know! |
@toddbaert , sorry for the delay, I got busy the last few weeks. I'll add the tests. Thanks. |
Signed-off-by: Aasif Khan <[email protected]>
Signed-off-by: Aasif Khan <[email protected]>
I've added a few test cases @beeme1mr @toddbaert . Please take a look. |
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.
Manually tested both the gRPC and HTTP endpoints, looks good. Tests also look good.
Thanks so much for helping with this @aasifkhan7 and working through it with us! This will be extremely helpful for adding more powerful telemetry for flagd users.
🤖 I have created a release *beep* *boop* --- <details><summary>flagd: 0.11.6</summary> ## [0.11.6](flagd/v0.11.5...flagd/v0.11.6) (2025-01-15) ### 🐛 Bug Fixes * **deps:** update module buf.build/gen/go/open-feature/flagd/connectrpc/go to v1.17.0-20241220192239-696330adaff0.1 ([#1488](#1488)) ([8e09457](8e09457)) * **deps:** update module buf.build/gen/go/open-feature/flagd/connectrpc/go to v1.18.1-20241220192239-696330adaff0.1 ([#1506](#1506)) ([b868194](b868194)) * **deps:** update module buf.build/gen/go/open-feature/flagd/grpc/go to v1.5.1-20241220192239-696330adaff0.1 ([#1489](#1489)) ([53add83](53add83)) * **deps:** update module buf.build/gen/go/open-feature/flagd/grpc/go to v1.5.1-20241220192239-696330adaff0.2 ([#1492](#1492)) ([9f1d94a](9f1d94a)) * **deps:** update module buf.build/gen/go/open-feature/flagd/protocolbuffers/go to v1.36.0-20241220192239-696330adaff0.1 ([#1490](#1490)) ([6edce72](6edce72)) * **deps:** update module github.com/mattn/go-colorable to v0.1.14 ([#1508](#1508)) ([87727f7](87727f7)) * **deps:** update module github.com/open-feature/flagd/core to v0.10.5 ([#1482](#1482)) ([ce48cb7](ce48cb7)) * **deps:** update module golang.org/x/net to v0.33.0 [security] ([#1486](#1486)) ([4764077](4764077)) * **deps:** update module golang.org/x/net to v0.34.0 ([#1498](#1498)) ([7584f95](7584f95)) * **deps:** update module google.golang.org/grpc to v1.69.2 ([#1484](#1484)) ([6b40ad3](6b40ad3)) * **deps:** update module google.golang.org/grpc to v1.69.4 ([#1510](#1510)) ([76d6353](76d6353)) * **deps:** update module google.golang.org/protobuf to v1.36.1 ([#1491](#1491)) ([2c729a7](2c729a7)) * **deps:** update opentelemetry-go monorepo ([#1470](#1470)) ([26b0b1a](26b0b1a)) ### ✨ New Features * add ssl support to sync service ([#1479](#1479)) ([#1501](#1501)) ([d50fcc8](d50fcc8)) </details> <details><summary>flagd-proxy: 0.6.9</summary> ## [0.6.9](flagd-proxy/v0.6.8...flagd-proxy/v0.6.9) (2025-01-15) ### 🐛 Bug Fixes * **deps:** update module buf.build/gen/go/open-feature/flagd/grpc/go to v1.5.1-20241220192239-696330adaff0.1 ([#1489](#1489)) ([53add83](53add83)) * **deps:** update module buf.build/gen/go/open-feature/flagd/grpc/go to v1.5.1-20241220192239-696330adaff0.2 ([#1492](#1492)) ([9f1d94a](9f1d94a)) * **deps:** update module buf.build/gen/go/open-feature/flagd/protocolbuffers/go to v1.36.0-20241220192239-696330adaff0.1 ([#1490](#1490)) ([6edce72](6edce72)) * **deps:** update module buf.build/gen/go/open-feature/flagd/protocolbuffers/go to v1.36.2-20241220192239-696330adaff0.1 ([#1502](#1502)) ([426c36e](426c36e)) * **deps:** update module github.com/mattn/go-colorable to v0.1.14 ([#1508](#1508)) ([87727f7](87727f7)) * **deps:** update module github.com/open-feature/flagd/core to v0.10.5 ([#1482](#1482)) ([ce48cb7](ce48cb7)) * **deps:** update module golang.org/x/net to v0.33.0 [security] ([#1486](#1486)) ([4764077](4764077)) * **deps:** update module golang.org/x/net to v0.34.0 ([#1498](#1498)) ([7584f95](7584f95)) * **deps:** update module google.golang.org/grpc to v1.69.2 ([#1484](#1484)) ([6b40ad3](6b40ad3)) * **deps:** update module google.golang.org/grpc to v1.69.4 ([#1510](#1510)) ([76d6353](76d6353)) * **deps:** update opentelemetry-go monorepo ([#1470](#1470)) ([26b0b1a](26b0b1a)) </details> <details><summary>core: 0.10.6</summary> ## [0.10.6](core/v0.10.5...core/v0.10.6) (2025-01-15) ### 🐛 Bug Fixes * **deps:** update github.com/open-feature/flagd-schemas digest to 37baa2c ([#1499](#1499)) ([1a853f7](1a853f7)) * **deps:** update github.com/open-feature/flagd-schemas digest to b81a56e ([#1391](#1391)) ([6a3d8ac](6a3d8ac)) * **deps:** update golang.org/x/exp digest to 7588d65 ([#1495](#1495)) ([242e594](242e594)) * **deps:** update golang.org/x/exp digest to b2144cd ([#1320](#1320)) ([a692b00](a692b00)) * **deps:** update module buf.build/gen/go/open-feature/flagd/grpc/go to v1.5.1-20241220192239-696330adaff0.1 ([#1489](#1489)) ([53add83](53add83)) * **deps:** update module buf.build/gen/go/open-feature/flagd/grpc/go to v1.5.1-20241220192239-696330adaff0.2 ([#1492](#1492)) ([9f1d94a](9f1d94a)) * **deps:** update module buf.build/gen/go/open-feature/flagd/protocolbuffers/go to v1.36.0-20241220192239-696330adaff0.1 ([#1490](#1490)) ([6edce72](6edce72)) * **deps:** update module buf.build/gen/go/open-feature/flagd/protocolbuffers/go to v1.36.2-20241220192239-696330adaff0.1 ([#1502](#1502)) ([426c36e](426c36e)) * **deps:** update module connectrpc.com/connect to v1.18.1 ([#1507](#1507)) ([89d3259](89d3259)) * **deps:** update module github.com/diegoholiveira/jsonlogic/v3 to v3.7.0 ([#1496](#1496)) ([e1fe149](e1fe149)) * **deps:** update module github.com/diegoholiveira/jsonlogic/v3 to v3.7.1 ([#1509](#1509)) ([9d06812](9d06812)) * **deps:** update module golang.org/x/crypto to v0.32.0 ([#1497](#1497)) ([63a34d2](63a34d2)) * **deps:** update module google.golang.org/grpc to v1.69.2 ([#1484](#1484)) ([6b40ad3](6b40ad3)) * **deps:** update module google.golang.org/grpc to v1.69.4 ([#1510](#1510)) ([76d6353](76d6353)) * **deps:** update opentelemetry-go monorepo ([#1470](#1470)) ([26b0b1a](26b0b1a)) ### ✨ New Features * add ssl support to sync service ([#1479](#1479)) ([#1501](#1501)) ([d50fcc8](d50fcc8)) * support flag metadata ([#1476](#1476)) ([13fbbad](13fbbad)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR
Related Issues
Fixes #1464
Notes
This PR ensures that flag metadata is included and handled correctly in responses.