docs(openapi): add missing management endpoints and split governance specs - #5840
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe OpenAPI catalog adds enterprise governance, webhook, legacy compatibility, and management metadata. It updates pagination contracts, path parameter names, shared component registrations, governance schemas, and adds invariant validation. ChangesEnterprise OpenAPI catalog
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
dd7877c to
5e508f4
Compare
0c5a564 to
5ae6913
Compare
5e508f4 to
f59b1d2
Compare
5ae6913 to
f90a4c7
Compare
f59b1d2 to
ac1fc2c
Compare
f90a4c7 to
3c918a3
Compare
ac1fc2c to
8422527
Compare
3c918a3 to
cdbb11b
Compare
f971559 to
c9d55ea
Compare
b10c878 to
a915552
Compare
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/openapi/schemas/management/governance.yaml (1)
918-939: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winRegenerate the published OpenAPI bundle and align the Enterprise handlers.
docs/docs.jsonpublishesdocs/openapi/openapi.json, which still documentstotal/pagefor both list responses. Regenerate it and confirmbifrost-enterprise/handlers/businessunits.goemitscount,total_count,limit, andoffset.🤖 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/openapi/schemas/management/governance.yaml` around lines 918 - 939, Regenerate the published OpenAPI bundle so docs/docs.json and docs/openapi/openapi.json reflect ListBusinessUnitsResponse fields count, total_count, limit, and offset instead of total/page. Update the Enterprise business-unit list handler around its response construction to emit those same four fields, preserving the documented pagination values.Source: Path instructions
🧹 Nitpick comments (3)
docs/openapi/schemas/management/users.yaml (1)
90-110: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winClarify the relationship between
budgetandbudgets.
UserGovernanceRequestexposes both a singlebudgetand abudgetsarray. The description does not state which field wins when a client sends both, or when each field applies. Add that rule to the description so API consumers can build a correct request.♻️ Proposed clarification
budget: $ref: './governance.yaml#/CreateBudgetRequest' + # document precedence, for example: + # description: Single budget. Ignored when `budgets` is present. budgets: type: array + description: Multiple budgets. Takes precedence over `budget` when both are sent. items: $ref: './governance.yaml#/CreateBudgetRequest'🤖 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/openapi/schemas/management/users.yaml` around lines 90 - 110, Update the UserGovernanceRequest description to document how budget and budgets are used, including which field takes precedence when both are provided and the conditions under which each field applies.docs/openapi/paths/management/users.yaml (2)
136-169: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a
400response togetUserByEmail.The
getUserVirtualKeysByEmailat lines 87-134 documents400for a malformed value. Document the same response here so both email-based lookups describe identical error behavior.♻️ Proposed change
responses: '200': description: Successful response content: application/json: schema: $ref: '../../schemas/management/users.yaml#/UserObject' + '400': + $ref: '../../openapi.yaml#/components/responses/BadRequest' '404': $ref: '../../openapi.yaml#/components/responses/NotFound'🤖 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/openapi/paths/management/users.yaml` around lines 136 - 169, Add a 400 response to the getUserByEmail operation, matching the existing 400 response reference and description used by the sibling getUserVirtualKeysByEmail operation for malformed URL-encoded email path values.
4-10: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueExtract the repeated Enterprise
x-mintnote into a shared definition. The identicalx-mintblock with the Enterprise tag and the same<Note>body is copied into every new operation across both files. No shared definition exists, so any wording or link change requires editing every copy.
docs/openapi/paths/management/users.yaml#L4-L10: define the note once with a YAML anchor, for examplex-mint: &enterprise-mint, then reference it withx-mint: *enterprise-mintin the other 15 operations in this file.docs/openapi/paths/management/businessunits.yaml#L14-L20: apply the same anchor-and-alias pattern to the 11 operations in this file, or move the note to a shared fragment that the bundler resolves.Confirm first that the bundler preserves YAML anchors and aliases.
🤖 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/openapi/paths/management/users.yaml` around lines 4 - 10, Confirm the OpenAPI bundler preserves YAML anchors and aliases, then extract the repeated Enterprise x-mint note in docs/openapi/paths/management/users.yaml lines 4-10 into an anchor and replace the other 15 operations there with its alias; apply the same shared anchor-and-alias pattern to the 11 operations in docs/openapi/paths/management/businessunits.yaml lines 14-20, or use a bundler-resolved shared fragment, so the tag and note body have one source of truth.
🤖 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/openapi/openapi.yaml`:
- Around line 950-958: Remove the stray
/api/users/{target_user_id}/access-profiles/{profile_id}/budgets/{budget_id}/override
and /api/users/{target_user_id}/access-profiles/{profile_id}/virtual-keys
entries from the current path block in the OpenAPI definition. Keep the
/api/governance/... entries and the legacy definitions in the deprecated block
unchanged.
In `@docs/openapi/paths/management/accessprofiles.yaml`:
- Line 103: Update the AccessProfileDetailResponse path parameter from id to
profile_id, then regenerate docs/openapi/openapi.json from openapi.yaml so it
reflects the new governance access-profile paths and corrected route.
In `@docs/openapi/paths/management/businessunits.yaml`:
- Around line 14-32: Regenerate docs/openapi/openapi.json from the updated
business-unit OpenAPI definitions so the published catalog no longer includes
stale page and id parameters for business-unit operations. Verify the generated
catalog reflects the current offset-based definitions.
In `@docs/openapi/paths/management/governanceextensions.yaml`:
- Around line 161-176: Update the budget-override endpoint schema in the OpenAPI
path: replace the permissive request object under application/json with the
defined BudgetOverrideRequest schema, and replace the 200 response
MessageResponse reference with BudgetOverrideResponse. Preserve the existing
security and endpoint behavior while ensuring the documented request requires
amount and mode and the response exposes the effective limit.
In `@docs/openapi/paths/management/governancelegacy.yaml`:
- Line 1: Update the audit-log path mappings in governancelegacy.yaml so the
five legacy /api/audit-logs URLs point to their governancelegacy aliases, while
current operations are exposed under /api/governance/audit-logs... without
duplicate path keys. Then regenerate docs/openapi/openapi.json, leaving
docs/docs.json unchanged.
- Around line 3-6: Mark every legacy operation in the governance legacy OpenAPI
paths, including listVirtualKeyUsersLegacy, with deprecated: true while
preserving its existing successor and removal metadata, then regenerate the
published docs/openapi/openapi.json so it includes the materialized legacy
aliases and deprecation metadata.
In `@docs/openapi/paths/management/rbac.yaml`:
- Around line 341-355: Consolidate the role-assignment OpenAPI definition by
removing the unreferenced users-assign-role path or updating the existing
users.yaml#/users-role mapping to use it. Ensure the path parameter is named
user_id and role_id remains in the request body.
---
Outside diff comments:
In `@docs/openapi/schemas/management/governance.yaml`:
- Around line 918-939: Regenerate the published OpenAPI bundle so docs/docs.json
and docs/openapi/openapi.json reflect ListBusinessUnitsResponse fields count,
total_count, limit, and offset instead of total/page. Update the Enterprise
business-unit list handler around its response construction to emit those same
four fields, preserving the documented pagination values.
---
Nitpick comments:
In `@docs/openapi/paths/management/users.yaml`:
- Around line 136-169: Add a 400 response to the getUserByEmail operation,
matching the existing 400 response reference and description used by the sibling
getUserVirtualKeysByEmail operation for malformed URL-encoded email path values.
- Around line 4-10: Confirm the OpenAPI bundler preserves YAML anchors and
aliases, then extract the repeated Enterprise x-mint note in
docs/openapi/paths/management/users.yaml lines 4-10 into an anchor and replace
the other 15 operations there with its alias; apply the same shared
anchor-and-alias pattern to the 11 operations in
docs/openapi/paths/management/businessunits.yaml lines 14-20, or use a
bundler-resolved shared fragment, so the tag and note body have one source of
truth.
In `@docs/openapi/schemas/management/users.yaml`:
- Around line 90-110: Update the UserGovernanceRequest description to document
how budget and budgets are used, including which field takes precedence when
both are provided and the conditions under which each field applies.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ab3982a4-ae9f-41a3-80f3-b2e270e866a2
📒 Files selected for processing (13)
docs/openapi/openapi.yamldocs/openapi/paths/management/accessprofiles.yamldocs/openapi/paths/management/auditlogs.yamldocs/openapi/paths/management/businessunits.yamldocs/openapi/paths/management/circuitbreaker.yamldocs/openapi/paths/management/governanceextensions.yamldocs/openapi/paths/management/governancelegacy.yamldocs/openapi/paths/management/mcptoolgroups.yamldocs/openapi/paths/management/rbac.yamldocs/openapi/paths/management/users.yamldocs/openapi/paths/management/vault.yamldocs/openapi/schemas/management/governance.yamldocs/openapi/schemas/management/users.yaml
c9d55ea to
f803676
Compare
955fa2c to
df4748a
Compare
f803676 to
b10735f
Compare
df4748a to
070639f
Compare
b10735f to
3896f44
Compare
070639f to
991ae18
Compare
3896f44 to
7233e27
Compare
7233e27 to
af72e02
Compare
991ae18 to
4c950d1
Compare
7233e27 to
af72e02
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/openapi/spec_invariants_test.py (1)
120-131: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winParse and resolve nested
$refvalues.Lines 124-130 infer composition from raw YAML text. A comment or example can satisfy the string match. A nested reference can also target a missing operation while this test still treats its top-level fragment as used.
Load each fragment, collect actual
$reffields, and resolve their file and JSON Pointer targets. Derivecomposedonly from resolved references.Based on the stack context,
docs/openapi/paths/management/governancelegacy.yamlcontains nested references togovernanceextensions.yamlthat this loop currently scans as text.🤖 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/openapi/spec_invariants_test.py` around lines 120 - 131, Replace the raw-text matching loop that builds composed in the fragment invariant test with parsed YAML traversal of actual $ref fields, including nested mappings and sequences. Resolve each reference’s target file and JSON Pointer, and add a fragment to composed only when the resolved target exists and points to that fragment. Preserve same-file and cross-file resolution while ignoring comments, examples, and references to missing operations.
🤖 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 `@docs/openapi/spec_invariants_test.py`:
- Around line 120-131: Replace the raw-text matching loop that builds composed
in the fragment invariant test with parsed YAML traversal of actual $ref fields,
including nested mappings and sequences. Resolve each reference’s target file
and JSON Pointer, and add a fragment to composed only when the resolved target
exists and points to that fragment. Preserve same-file and cross-file resolution
while ignoring comments, examples, and references to missing operations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 65516b2d-b661-4653-aada-581f92bcc7f3
📒 Files selected for processing (6)
docs/openapi/openapi.yamldocs/openapi/paths/management/accessprofiles.yamldocs/openapi/paths/management/governanceextensions.yamldocs/openapi/paths/management/governancelegacy.yamldocs/openapi/paths/management/rbac.yamldocs/openapi/spec_invariants_test.py
🚧 Files skipped from review as they are similar to previous changes (3)
- docs/openapi/paths/management/rbac.yaml
- docs/openapi/paths/management/accessprofiles.yaml
- docs/openapi/paths/management/governancelegacy.yaml
af72e02 to
f914b44
Compare
4c950d1 to
34a8ee4
Compare
f914b44 to
87dbb74
Compare
34a8ee4 to
5cd8ab8
Compare
Merge activity
|
The base branch was changed.
…specs (#5840) ## Summary Briefly explain the purpose of this PR and the problem it solves. ## Changes - What was changed and why - Any notable design decisions or trade-offs ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test Describe the steps to validate this change. Include commands and expected outcomes. ```sh # Core/Transports go version go test ./... # UI cd ui pnpm i || npm i pnpm test || npm test pnpm build || npm run build ``` If adding new configs or environment variables, document them here. ## Screenshots/Recordings If UI changes, add before/after screenshots or short clips. ## Breaking changes - [ ] Yes - [ ] No If yes, describe impact and migration instructions. ## Related issues Link related issues and discussions. Example: Closes #123 ## Security considerations Note any security implications (auth, secrets, PII, sandboxing, etc.). ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
…specs (#5840) ## Summary Briefly explain the purpose of this PR and the problem it solves. ## Changes - What was changed and why - Any notable design decisions or trade-offs ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test Describe the steps to validate this change. Include commands and expected outcomes. ```sh # Core/Transports go version go test ./... # UI cd ui pnpm i || npm i pnpm test || npm test pnpm build || npm run build ``` If adding new configs or environment variables, document them here. ## Screenshots/Recordings If UI changes, add before/after screenshots or short clips. ## Breaking changes - [ ] Yes - [ ] No If yes, describe impact and migration instructions. ## Related issues Link related issues and discussions. Example: Closes #123 ## Security considerations Note any security implications (auth, secrets, PII, sandboxing, etc.). ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
…specs (#5840) ## Summary Briefly explain the purpose of this PR and the problem it solves. ## Changes - What was changed and why - Any notable design decisions or trade-offs ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test Describe the steps to validate this change. Include commands and expected outcomes. ```sh # Core/Transports go version go test ./... # UI cd ui pnpm i || npm i pnpm test || npm test pnpm build || npm run build ``` If adding new configs or environment variables, document them here. ## Screenshots/Recordings If UI changes, add before/after screenshots or short clips. ## Breaking changes - [ ] Yes - [ ] No If yes, describe impact and migration instructions. ## Related issues Link related issues and discussions. Example: Closes #123 ## Security considerations Note any security implications (auth, secrets, PII, sandboxing, etc.). ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
…specs (#5840) ## Summary Briefly explain the purpose of this PR and the problem it solves. ## Changes - What was changed and why - Any notable design decisions or trade-offs ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test Describe the steps to validate this change. Include commands and expected outcomes. ```sh # Core/Transports go version go test ./... # UI cd ui pnpm i || npm i pnpm test || npm test pnpm build || npm run build ``` If adding new configs or environment variables, document them here. ## Screenshots/Recordings If UI changes, add before/after screenshots or short clips. ## Breaking changes - [ ] Yes - [ ] No If yes, describe impact and migration instructions. ## Related issues Link related issues and discussions. Example: Closes #123 ## Security considerations Note any security implications (auth, secrets, PII, sandboxing, etc.). ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
Briefly explain the purpose of this PR and the problem it solves.
Changes
Type of change
Affected areas
How to test
Describe the steps to validate this change. Include commands and expected outcomes.
If adding new configs or environment variables, document them here.
Screenshots/Recordings
If UI changes, add before/after screenshots or short clips.
Breaking changes
If yes, describe impact and migration instructions.
Related issues
Link related issues and discussions. Example: Closes #123
Security considerations
Note any security implications (auth, secrets, PII, sandboxing, etc.).
Checklist
docs/contributing/README.mdand followed the guidelines