Commit 917f66a
authored
fix(policy): undo Condition.operator deprecation (#3668)
## Summary
Removes the `deprecated = true` annotation from `Condition.operator` in
`service/policy/objects.proto` and restores its original doc comment,
then regenerates `protocol/go` and the policy docs.
## Why
`Condition.operator` was deprecated in #3580 in favor of the decomposed
`comparison` + `quantifier` (+ `case_insensitive`) fields. The
decomposed evaluator was never wired up on `main` — `EvaluateCondition`
(`service/internal/subjectmappingbuiltin/subject_mapping_builtin.go`)
still switches entirely on `operator`, nothing reads the new fields, and
there is no normalization shim. So the deprecation marker currently only
produces `staticcheck` SA1019 failures in every consumer of
`GetOperator()` (in-repo: `subject_mapping_builtin.go`,
`otdfctl/migrations/namespacedpolicy/canonical.go`; plus downstream
importers of `protocol/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
- Drops `deprecated = true` only. 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
breaking` passes). `required = true` is intentionally not restored.
- Regenerated `protocol/go/policy/objects.pb.go` via remote-pinned
plugins (reproducible across buf CLI versions).
- Surgically updated the `operator` field entry in
`docs/openapi/policy/objects.openapi.yaml` and `docs/grpc/index.html` to
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` — 0
- `buf breaking service --against origin/main` — 0
- `golangci-lint run --enable-only staticcheck` on
`subject_mapping_builtin` and `otdfctl/.../namespacedpolicy` — 0 issues
- `go build` + `go test ./internal/subjectmappingbuiltin/...` — pass
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Updated the description of the `operator` field in policy condition
docs to reflect its current role.
* Removed outdated deprecation language from API documentation and
schema references.
* Clarified that `operator` is the evaluation operator for a relation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: Krish Suchak <suchak.krish@gmail.com>1 parent 41cee41 commit 917f66a
4 files changed
Lines changed: 471 additions & 481 deletions
File tree
- docs
- grpc
- openapi/policy
- protocol/go/policy
- service/policy
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments