docs: add adr for targeting metadata - #2013
Conversation
✅ Deploy Preview for polite-licorice-3db33c canceled.
|
f6c88cc to
986a12c
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an architecture decision for targeting results that support existing variant strings or objects with a variant and optional metadata. It documents validation, decoding, merge precedence, parse errors, telemetry, compatibility, implementation impacts, and open questions. ChangesTargeting variant metadata
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
986a12c to
df15c70
Compare
Signed-off-by: Parth Suthar <parth.suthar@dynatrace.com>
df15c70 to
79f3a25
Compare
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/architecture-decisions/targeting-variant-metadata.md`:
- Around line 23-24: Revise the metadata plumbing statement to distinguish the
currently supported paths: confirm metadata for OFREP single/bulk and single
gRPC responses, note that this proto layer’s ResolveAll path does not yet expose
it, and remove the claim that RecordEvaluation telemetry already carries
metadata attributes. Limit the ADR’s end-to-end contract to these verified paths
and identify metrics/telemetry support as a separate change.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e45a8980-8e18-4872-8ea0-f2e078b09b03
📒 Files selected for processing (1)
docs/architecture-decisions/targeting-variant-metadata.md
| The plumbing to carry metadata already exists end to end: `AnyValue.Metadata` (`core/pkg/evaluator/ievaluator.go`) is `map[string]interface{}`, threaded through every resolver path and out through gRPC and OFREP as evaluation metadata that OpenFeature SDKs surface as `flagMetadata`. | ||
| The only thing missing is a way for a *rule branch* to contribute to it. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
rg -n -C 8 \
'value\.Metadata|Metadata:|RecordEvaluation|AnyFlag|flagMetadata|OFREP' \
--glob '*.go' --glob '*.proto' --glob '*.json' . || trueRepository: open-feature/flagd
Length of output: 50375
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== candidate files =="
git ls-files | rg 'flag_evaluator.*\.go$|ofrep|ievaluator|metrics|resol' | sed -n '1,200p'
echo
echo "== relevant source slices =="
sed -n '60,145p' flagd/pkg/service/flag-evaluation/flag_evaluator.go
sed -n '130,145p' flagd/pkg/service/flag-evaluation/flag_evaluator_v1.go
sed -n '360,405p' flagd/pkg/service/flag-evaluation/flag_evaluator.go
sed -n '245,270p' flagd/pkg/service/flag-evaluation/flag_evaluator_v2.go
echo
echo "== OFREP response metadata occurrences =="
rg -n -C 5 'metadata|Metadata|Resolve.*Response|flagMetadata|flag_metadata|recordEvaluation|Evaluation\(' flagd/pkg/service/ofrep **/ofrep*.go --glob '!*vendor*' --glob '!*testdata*' --glob '!*test' || trueRepository: open-feature/flagd
Length of output: 7340
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== OFREP handler/source slices =="
sed -n '1,260p' flagd/pkg/service/flag-evaluation/ofrep/handler.go
sed -n '1,220p' flagd/pkg/service/flag-evaluation/ofrep/ofrep_service.go
echo
echo "== schema V1 Proto AnyFlag messages =="
rg -n -C 4 'message AnyFlag|field Metadata|Metadata' proto schema flagd --glob '*.proto' --glob '*.pb.go' --glob '*.go' || true
echo
echo "== response result interface implementations =="
rg -n -C 4 'SetResult|RecordEvaluation|func .*SetResult|RecordEvaluation\(' flagd core flagd-proxy --glob '*.go' --glob '!*vendor*' || trueRepository: open-feature/flagd
Length of output: 50375
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== OFREP response model slices =="
sed -n '1,260p' core/pkg/service/ofrep/models.go
echo
echo "== OFREP test cases around metadata =="
sed -n '1,320p' flagd/pkg/service/flag-evaluation/ofrep/handler_test.go
sed -n '1,160p' core/pkg/service/ofrep/models_test.go
echo
echo "== OFREP service serializer occurrences =="
rg -n -C 4 'SuccessResponseFrom|BulkEvaluationResponseFrom|AnyValue|Metadata|flagMetadata|flag_metadata' core/pkg/service/ofrep --glob '*.go' || trueRepository: open-feature/flagd
Length of output: 33279
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== RecordEvaluation definitions =="
sed -n '1,220p' core/pkg/telemetry/metrics.go
rg -n -C 6 'func .*RecordEvaluation|RecordEvaluation.*Metadata|metadata|Metadata' core pkg flagd --glob '*.go' --glob '!*test.go' | sed -n '1,240p'
echo
echo "== AnyFlag schema declarations in vendored/generated/proto deps =="
rg -n -C 4 'message AnyFlag|AnyFlag|Metadata.*Struct|struct FieldMetadata' .vendor $GOPATH vendor flagd --glob '*.go' --glob '*.proto' --glob '*.pb.go' 2>/dev/null | sed -n '1,240p' || trueRepository: open-feature/flagd
Length of output: 26109
Clarify the metadata contract before calling the path end to end.
OFREP single and bulk responses carry AnyValue.Metadata, and single gRPC responses carry Metadata; ResolveAll now carries it through the v1 schema but not ResolveAll in this proto layer. RecordEvaluation(...) also does not expose metadata attributes yet, so the metrics/telemetry part of the ADR needs a separate change.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/architecture-decisions/targeting-variant-metadata.md` around lines 23 -
24, Revise the metadata plumbing statement to distinguish the currently
supported paths: confirm metadata for OFREP single/bulk and single gRPC
responses, note that this proto layer’s ResolveAll path does not yet expose it,
and remove the claim that RecordEvaluation telemetry already carries metadata
attributes. Limit the ADR’s end-to-end contract to these verified paths and
identify metrics/telemetry support as a separate change.
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
I generally like the idea, but I am missing the migration path. How do we plan to move from old version to new version, without breaking migration patterns? I feel like we need to point out how we plan to migrate without breaking installations for others. In-process providers might be used in deprecated services and we need to give people time to migrate from one to the other. Is it maybe time to have a version contract in the request for the flag configuration? |



This PR
Related Issues
Notes
Follow-up Tasks
How to test