fix(policy): undo Condition.operator deprecation#3668
Conversation
The operator field on Condition was deprecated in #3580 in favor of the decomposed comparison + quantifier (+ case_insensitive) fields. The decomposed evaluator was never wired up on main (EvaluateCondition still switches on operator), so the deprecation marker only produces staticcheck SA1019 failures in every consumer of GetOperator() without a migration target. Remove deprecated = true and restore the original doc comment so downstream modules can build cleanly. The field stays optional (IGNORE_IF_ZERO_VALUE), so this is not a breaking validation change; buf breaking passes. Regenerated protocol/go and the policy docs. Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe ChangesPolicy condition operator documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request reverts the deprecation of the Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. The field was marked as old and gray, / But logic wasn't ready for the day. / We bring it back to clear the noise, / And let the build return to poise. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request removes the deprecation status of the operator field in the Condition message within service/policy/objects.proto and updates its documentation in docs/grpc/index.html. The reviewer noted that the operator field remains listed in the 'Fields with deprecated option' table in docs/grpc/index.html and should be removed to ensure consistency.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
Summary
Removes the
deprecated = trueannotation fromCondition.operatorinservice/policy/objects.protoand restores its original doc comment, then regeneratesprotocol/goand the policy docs.Why
Condition.operatorwas deprecated in #3580 in favor of the decomposedcomparison+quantifier(+case_insensitive) fields. The decomposed evaluator was never wired up onmain—EvaluateCondition(service/internal/subjectmappingbuiltin/subject_mapping_builtin.go) still switches entirely onoperator, nothing reads the new fields, and there is no normalization shim. So the deprecation marker currently only producesstaticcheckSA1019 failures in every consumer ofGetOperator()(in-repo:subject_mapping_builtin.go,otdfctl/migrations/namespacedpolicy/canonical.go; plus downstream importers ofprotocol/go) with no migration target to move to.Undoing the deprecation unblocks those consumers. Once the decomposed evaluation path actually lands, the field can be re-deprecated alongside a working replacement.
Scope
deprecated = trueonly. The field stays optional via(buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE, so request validation is unchanged and this is not a breaking change (buf breakingpasses).required = trueis intentionally not restored.protocol/go/policy/objects.pb.govia remote-pinned plugins (reproducible across buf CLI versions).operatorfield entry indocs/openapi/policy/objects.openapi.yamlanddocs/grpc/index.htmlto drop the deprecated marker. Full doc regeneration was avoided because the local doc plugins produce unrelated churn; CI stages docs before its drift check, so the enforced generated files (*.pb.go, connect wrappers,enums.gen.go) are what matter and those match.Verification
buf lint service— 0buf breaking service --against origin/main— 0golangci-lint run --enable-only staticcheckonsubject_mapping_builtinandotdfctl/.../namespacedpolicy— 0 issuesgo build+go test ./internal/subjectmappingbuiltin/...— passSummary by CodeRabbit
operatorfield in policy condition docs to reflect its current role.operatoris the evaluation operator for a relation.