feat(policy): add GetObligationTrigger RPC#3318
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 43 minutes and 28 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new Changes
Sequence DiagramsequenceDiagram
participant Client
participant ServiceHandler as Service Handler
participant DBClient as DB Client
participant SQLQuery as SQL Query
participant DB as Database
Client->>ServiceHandler: GetObligationTrigger(id)
ServiceHandler->>DBClient: GetObligationTrigger(ctx, req)
DBClient->>DBClient: Validate UUID
DBClient->>SQLQuery: Execute getObligationTrigger
SQLQuery->>DB: SELECT ... JOIN ... WHERE id = ?
DB-->>SQLQuery: Return trigger JSON, metadata JSON
SQLQuery-->>DBClient: getObligationTriggerRow
DBClient->>DBClient: hydrateObligationTrigger()
DBClient->>DBClient: Unmarshal trigger & metadata
DBClient->>DBClient: Reconstruct ObligationValue.Fqn
DBClient-->>ServiceHandler: *policy.ObligationTrigger, error
ServiceHandler-->>Client: GetObligationTriggerResponse{Trigger}, error
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 introduces a new RPC endpoint to the policy service, enabling clients to retrieve specific obligation triggers by their unique identifier. The changes span the entire stack, including protocol buffer definitions, service implementation, database query logic, and corresponding test coverage to ensure robust functionality. Highlights
🧠 New Feature in Public Preview: You can now enable Memory 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 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 counter productive. 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. A trigger sought by ID so clear, To fetch the data drawing near. With SQL joined and tests in place, It finds its home within the space. Footnotes
|
fcf2711 to
1cbb9b3
Compare
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/grpc/index.html`:
- Line 12960: The docs currently render an empty paragraph for
AddObligationTriggerRequest; restore a short proto comment for the
AddObligationTriggerRequest message in the proto definition (the comment
directly above the AddObligationTriggerRequest message) describing its purpose,
then regenerate the documentation so the brief description appears in
docs/grpc/index.html. Ensure the comment uses the proto comment style (// or /**
*/) and references AddObligationTriggerRequest so the docs generator picks it
up.
In `@docs/openapi/policy/obligations/obligations.openapi.yaml`:
- Around line 1672-1682: The generated OpenAPI has a stray "description:
Triggers" attached to the message GetObligationTriggerRequest; move the proto
comment in service/policy/obligations/obligations.proto so it isn't a leading
comment on a message (e.g., attach the "Triggers" comment to the RPC/service
block or a non-message token or remove it), then regenerate the OpenAPI;
specifically update the proto around the
GetObligationTriggerRequest/AddObligationTriggerRequest area so the "Triggers"
section header is not a leading comment on the GetObligationTriggerRequest
message before regenerating the YAML.
🪄 Autofix (Beta)
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: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: a0aebf4c-4266-4c08-9bce-604a49cb3c5a
⛔ Files ignored due to path filters (2)
protocol/go/policy/obligations/obligations.pb.gois excluded by!**/*.pb.goprotocol/go/policy/obligations/obligations_grpc.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (13)
docs/grpc/index.htmldocs/openapi/policy/kasregistry/key_access_server_registry.openapi.yamldocs/openapi/policy/obligations/obligations.openapi.yamlprotocol/go/policy/obligations/obligationsconnect/obligations.connect.gosdk/sdkconnect/obligations.goservice/integration/obligation_triggers_test.goservice/policy/db/obligations.goservice/policy/db/obligations.sql.goservice/policy/db/queries/obligations.sqlservice/policy/db/schema_erd.mdservice/policy/obligations/obligations.goservice/policy/obligations/obligations.protoservice/policy/obligations/obligations_test.go
💤 Files with no reviewable changes (1)
- service/policy/db/schema_erd.md
There was a problem hiding this comment.
Code Review
This pull request introduces the GetObligationTrigger RPC, encompassing protobuf definitions, database integration, and SDK updates. The implementation includes a refactor of the database layer to use a centralized hydrateObligationTrigger function for consistent object hydration. A significant issue was found in the documentation where the database schema ERD was entirely removed; this should be updated to include the new trigger relationships instead of being deleted.
I am having trouble creating individual review comments. Click here to see my feedback.
service/policy/db/schema_erd.md (1-4)
The Mermaid ERD diagram was completely removed. If this file is intended to document the database schema, it should be updated with the new obligation_triggers table relationship rather than being emptied.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
🤖 I have created a release *beep* *boop* --- ## [0.24.0](protocol/go/v0.23.0...protocol/go/v0.24.0) (2026-04-17) ### Features * **policy:** add GetObligationTrigger RPC ([#3318](#3318)) ([d68e39d](d68e39d)) * **policy:** add sort ListSubjectMappings API ([#3255](#3255)) ([9d5d757](9d5d757)) * **policy:** add sort support to ListKeyAccessServer ([#3287](#3287)) ([7fae2d7](7fae2d7)) * **policy:** add sort support to listobligations api ([#3300](#3300)) ([9221cac](9221cac)) * **policy:** add sort support to ListSubjectConditionSets API ([#3272](#3272)) ([9010f12](9010f12)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: opentdf-automation[bot] <149537512+opentdf-automation[bot]@users.noreply.github.com>
## Summary Documents user-facing changes from the [SDK v0.16.0 release](https://github.com/opentdf/platform/releases/tag/sdk/v0.16.0): - **KAS error classification (breaking change)**: New `ErrKASRequestError` sentinel distinguishes misconfiguration from tamper. Adds migration guide with error classification table and code snippet for Go SDK consumers who check `ErrTampered`. ([opentdf/platform#3166](opentdf/platform#3166)) - **OIDC trailing-slash issuer fix**: Troubleshooting entry for `unexpected end of JSON input` during OIDC discovery with IDPs like Authentik that use trailing-slash issuer URLs. ([opentdf/platform#3261](opentdf/platform#3261)) - **GetObligationTrigger RPC**: New collapsible section with Go/JS signatures, parameters, and examples — follows the existing Add/List/Remove trigger pattern. ([opentdf/platform#3318](opentdf/platform#3318)) - **SDK version annotations**: New methods now include an *Available since [SDK vX.Y.Z](link)* note after the signature block, linking to the release ## Test plan - [x] `npx docusaurus build` succeeds - [x] `vale` passes with 0 errors/warnings/suggestions - [ ] Verify Surge preview renders all three sections correctly 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Proposed Changes
GetObligationTriggerRPCChecklist
Testing Instructions
Summary by CodeRabbit
New Features
Documentation