improvement(platform): standardize perms, audit logging, lifecycle across admin, copilot, ui actions#3858
Conversation
…mt across admin, copilot, ui actions
PR SummaryMedium Risk Overview Standardizes permissions checks in copilot tool execution by extending Expands audit logging: adds new audit actions/resource types for custom tools, skills, and credential rename/delete, and records audit entries for skills/tools CRUD, MCP server add/update/remove, job schedule create/update/delete/complete, workflow import/create, workflow variable updates, etc. Also removes the copilot client SSE handler implementation files ( Written by Cursor Bugbot for commit 2c5a65c. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR introduces a new Key changes:
Notable concerns:
Confidence Score: 5/5Safe to merge — all remaining findings are P2 (behavioral nuances and audit attribution), with no runtime breakage or data loss risk. The core orchestration consolidation is correct and well-tested; all three surfaces now share identical lifecycle logic. The four issues found are: (1) a subtle templateAction behavior change for edge-case DELETE callers, (2) misleading audit attribution for admin routes (pre-existing gap made slightly worse), (3) double audit events for chat deploys (harmless but noisy), and (4) dead code. None of these cause incorrect data, security problems, or functional regressions for normal user flows. apps/sim/app/api/workflows/[id]/route.ts (templateAction default), apps/sim/app/api/v1/admin/workflows/[id]/route.ts (audit actor), apps/sim/lib/workflows/orchestration/chat-deploy.ts (double audit events) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
UI[UI Deploy Route
/api/workflows/id/deploy] -->|POST| OD[performFullDeploy]
UI -->|DELETE| OUD[performFullUndeploy]
UI2[UI Deployments Route
/api/workflows/id/deployments/version] -->|PATCH| OAV[performActivateVersion]
ADMIN[Admin Deploy Route
/api/v1/admin/.../deploy] -->|POST| OD
ADMIN -->|DELETE| OUD
ADMIN2[Admin Activate Route
/api/v1/admin/.../activate] -->|POST| OAV
ADMIN3[Admin Workflow Route
/api/v1/admin/workflows/id] -->|DELETE| ODW[performDeleteWorkflow]
CHAT_UI[Chat Route
/api/chat] -->|POST| OCD[performChatDeploy]
CHAT_MGR[Chat Manage Route
/api/chat/manage/id] -->|DELETE| OCU[performChatUndeploy]
COP_DEPLOY[Copilot deploy_api tool] -->|deploy| OD
COP_DEPLOY -->|undeploy| OUD
COP_CHAT[Copilot deploy_chat tool] -->|deploy| OCD
COP_CHAT -->|undeploy| OCU
COP_WF[Copilot delete_workflow tool] -->|delete| ODW
COP_FOLDER[Copilot delete_folder tool] -->|delete| ODF[performDeleteFolder]
FOLDER_UI[Folder Route
/api/folders/id] -->|DELETE| ODF
WF_UI[Workflow Route
/api/workflows/id] -->|DELETE| ODW
OCD -->|calls| OD
OD -->|audit| AUDIT[(Audit Log)]
OUD -->|audit| AUDIT
OAV -->|audit| AUDIT
ODW -->|audit| AUDIT
ODF -->|audit| AUDIT
OCD -->|audit| AUDIT
OCU -->|audit| AUDIT
|
|
bugbot run |
|
bugbot run |
|
bugbot run |
Summary
Admin, Copilot, UI actions had different perms, audit logging and db query behaviour leading to a range of bugs. UI actions are treated as source of truth and extracted in helpers used across in the bodies of all 3 of these surfaces.
Examples of Bugs:
Type of Change
Testing
Tested manually
Checklist