feat(dashboard): refine virtual model and API key actions - #575
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughChangesVirtual model policy lifecycle
API key dashboard actions
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Dashboard
participant AdminAPI
participant VirtualModelService
participant Store
Dashboard->>AdminAPI: submit virtual-model policy
AdminAPI->>VirtualModelService: upsert policy
VirtualModelService->>Store: delete redundant row or persist changed row
Store-->>VirtualModelService: storage result
VirtualModelService-->>AdminAPI: 200 or 204 response
AdminAPI-->>Dashboard: display saved or reset notice
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/features/virtual-models.mdx`:
- Around line 30-35: Revise the virtual-models documentation to describe
empty-policy pruning as GoModel/backend behavior enforced by the virtual-model
API, rather than as dashboard-only behavior. Replace “The dashboard does not
persist” with wording that applies to all callers of `/admin/virtual-models`,
while preserving the existing conditions for removing or retaining stored
policies.
In `@internal/admin/handler_virtualmodels_test.go`:
- Around line 402-433: Extend TestUpsertRedirectVirtualModelReplacesAccessPolicy
to assert that the resulting redirect view has no UserPaths after the PUT body
omits user_paths, confirming full-replacement semantics. Keep the existing
redirect and target assertions unchanged.
In `@internal/virtualmodels/service.go`:
- Around line 378-392: Align the rename flow’s operation ordering with Upsert:
perform the redundancy check before validateRedirectTarget, while preserving the
existing redirect short-circuit behavior and redundant-policy deletion/refresh
handling in the rename path.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 70389c28-7327-4d6d-9dc4-09196d80b72a
📒 Files selected for processing (16)
cmd/gomodel/docs/docs.godocs/features/virtual-models.mdxdocs/openapi.jsoninternal/admin/dashboard/static/css/dashboard.cssinternal/admin/dashboard/static/js/modules/dashboard-layout.test.cjsinternal/admin/dashboard/static/js/modules/virtual-models.jsinternal/admin/dashboard/static/js/modules/virtual-models.test.cjsinternal/admin/dashboard/templates/model-table-body.htmlinternal/admin/dashboard/templates/page-auth-keys.htmlinternal/admin/dashboard/templates/power-icon.htmlinternal/admin/handler_virtualmodels.gointernal/admin/handler_virtualmodels_test.gointernal/virtualmodels/rename_test.gointernal/virtualmodels/service.gointernal/virtualmodels/service_test.gointernal/virtualmodels/validation.go
💤 Files with no reviewable changes (1)
- internal/virtualmodels/validation.go
Confidence Score: 5/5This looks safe to merge. No blocking issues found in the changed code.
What T-Rex did
Reviews (1): Last reviewed commit: "feat(dashboard): refine virtual model an..." | Re-trigger Greptile |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Summary
Testing
Summary by CodeRabbit
PUT /admin/virtual-models204response for no-op access policy removal.