feat(api): add governance query operation#4329
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a Governance bulk-access query API, a shared generic ChangesGovernance API Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
🚥 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)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@api/spec/packages/aip/src/common/pagination.tsp`:
- Around line 13-29: Update the documentation comment on the
CursorPaginationQueryPage model to remove the resource-specific term "customer
rows" and make it generic; change the description for the size property in
CursorPaginationQueryPage to something like "Maximum number of items to include
in the response" so it accurately reflects that this pagination model applies to
any resource type.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 61f0b954-a05c-47cb-93a7-b60a3e811888
⛔ Files ignored due to path filters (1)
api/v3/openapi.yamlis excluded by!**/openapi.yaml
📒 Files selected for processing (12)
api/spec/packages/aip/src/common/pagination.tspapi/spec/packages/aip/src/governance/governance.tspapi/spec/packages/aip/src/governance/index.tspapi/spec/packages/aip/src/governance/operations.tspapi/spec/packages/aip/src/konnect.tspapi/spec/packages/aip/src/openmeter.tspapi/spec/packages/aip/src/productcatalog/plan.tspapi/spec/packages/aip/src/shared/consts.tspapi/spec/packages/aip/src/shared/errors.tspapi/spec/packages/aip/src/shared/index.tspapi/v3/api.gen.goapi/v3/server/routes.go
a0bab75 to
05bb244
Compare
05bb244 to
b2c8e96
Compare
b2c8e96 to
4019f74
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
api/spec/packages/aip/src/governance/governance.tsp (1)
17-17: ⚡ Quick winConsider clarifying the summary to match the field's dual purpose.
The field accepts both customer keys and subject keys (as noted in lines 13-14), but the summary only mentions "Customer usage attribution keys". Something like "Customer or subject keys" might be clearer for API consumers.
📝 Suggested improvement
- `@summary`("Customer usage attribution keys") + `@summary`("Customer or subject keys")🤖 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 `@api/spec/packages/aip/src/governance/governance.tsp` at line 17, Update the `@summary` for the field that currently reads `@summary`("Customer usage attribution keys") so it explicitly reflects the field's dual purpose (accepts both customer keys and subject keys); replace the summary text with a concise phrase like "Customer or subject usage attribution keys" or similar to clarify intent for API consumers in the governance.tsp definition.
🤖 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.
Nitpick comments:
In `@api/spec/packages/aip/src/governance/governance.tsp`:
- Line 17: Update the `@summary` for the field that currently reads
`@summary`("Customer usage attribution keys") so it explicitly reflects the
field's dual purpose (accepts both customer keys and subject keys); replace the
summary text with a concise phrase like "Customer or subject usage attribution
keys" or similar to clarify intent for API consumers in the governance.tsp
definition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 080d349b-ad87-44a5-94de-48beba0663a5
⛔ Files ignored due to path filters (1)
api/v3/openapi.yamlis excluded by!**/openapi.yaml
📒 Files selected for processing (12)
api/spec/packages/aip/src/common/pagination.tspapi/spec/packages/aip/src/governance/governance.tspapi/spec/packages/aip/src/governance/index.tspapi/spec/packages/aip/src/governance/operations.tspapi/spec/packages/aip/src/konnect.tspapi/spec/packages/aip/src/openmeter.tspapi/spec/packages/aip/src/productcatalog/plan.tspapi/spec/packages/aip/src/shared/consts.tspapi/spec/packages/aip/src/shared/errors.tspapi/spec/packages/aip/src/shared/index.tspapi/v3/api.gen.goapi/v3/server/routes.go
✅ Files skipped from review due to trivial changes (3)
- api/spec/packages/aip/src/governance/index.tsp
- api/spec/packages/aip/src/shared/index.tsp
- api/spec/packages/aip/src/shared/consts.tsp
🚧 Files skipped from review as they are similar to previous changes (7)
- api/v3/server/routes.go
- api/spec/packages/aip/src/common/pagination.tsp
- api/spec/packages/aip/src/governance/operations.tsp
- api/spec/packages/aip/src/openmeter.tsp
- api/spec/packages/aip/src/konnect.tsp
- api/spec/packages/aip/src/shared/errors.tsp
- api/spec/packages/aip/src/productcatalog/plan.tsp
4019f74 to
93a2182
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
api/spec/packages/aip/src/governance/governance.tsp (1)
18-20:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPlease align filter limits with the agreed public API cap (50).
These are currently
@maxItems(1000)for both customer and feature keys, but the previous review thread agreed to cap both at 50. Keeping 1000 here risks contract drift and heavier backend load.Suggested tweak
- `@maxItems`(1000) + `@maxItems`(50) keys: string[]; ... - `@maxItems`(1000) + `@maxItems`(50) keys: string[];Also applies to: 34-36
🤖 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 `@api/spec/packages/aip/src/governance/governance.tsp` around lines 18 - 20, The maxItems constraint for the keys arrays is too high; update both occurrences of the annotated property (the lines that declare "keys: string[]" with `@minItems`(1) and `@maxItems`(1000)) to use `@maxItems`(50) instead so the customer and feature keys comply with the agreed public API cap; locate the two "keys: string[]" declarations in governance.tsp (the one around the customer keys and the one around the feature keys) and change their `@maxItems` value from 1000 to 50.
🤖 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 `@api/spec/packages/aip/src/governance/governance.tsp`:
- Line 17: Update the `@summary` for the schema property named "keys" in
governance.tsp to accurately reflect that it accepts both customer keys and
usage-attribution subject keys; locate the "keys" declaration and change the
summary string from "Customer usage attribution keys" to a clearer phrase like
"Customer and usage-attribution subject keys" or similar that explicitly
mentions both types.
---
Duplicate comments:
In `@api/spec/packages/aip/src/governance/governance.tsp`:
- Around line 18-20: The maxItems constraint for the keys arrays is too high;
update both occurrences of the annotated property (the lines that declare "keys:
string[]" with `@minItems`(1) and `@maxItems`(1000)) to use `@maxItems`(50) instead so
the customer and feature keys comply with the agreed public API cap; locate the
two "keys: string[]" declarations in governance.tsp (the one around the customer
keys and the one around the feature keys) and change their `@maxItems` value from
1000 to 50.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fddd39cf-89e0-4bfb-bb91-088659fbe4a7
⛔ Files ignored due to path filters (1)
api/v3/openapi.yamlis excluded by!**/openapi.yaml
📒 Files selected for processing (12)
api/spec/packages/aip/src/common/pagination.tspapi/spec/packages/aip/src/governance/governance.tspapi/spec/packages/aip/src/governance/index.tspapi/spec/packages/aip/src/governance/operations.tspapi/spec/packages/aip/src/konnect.tspapi/spec/packages/aip/src/openmeter.tspapi/spec/packages/aip/src/productcatalog/plan.tspapi/spec/packages/aip/src/shared/consts.tspapi/spec/packages/aip/src/shared/errors.tspapi/spec/packages/aip/src/shared/index.tspapi/v3/api.gen.goapi/v3/server/routes.go
✅ Files skipped from review due to trivial changes (2)
- api/spec/packages/aip/src/shared/index.tsp
- api/spec/packages/aip/src/governance/index.tsp
🚧 Files skipped from review as they are similar to previous changes (6)
- api/spec/packages/aip/src/common/pagination.tsp
- api/spec/packages/aip/src/shared/consts.tsp
- api/v3/server/routes.go
- api/spec/packages/aip/src/governance/operations.tsp
- api/spec/packages/aip/src/openmeter.tsp
- api/spec/packages/aip/src/shared/errors.tsp
904db7d to
a99a984
Compare
Summary by CodeRabbit
New Features
Documentation
Refactor