-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(settings): add debug mode for superusers #2893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds a toggleable debug mode for superusers that allows importing workflows by ID for debugging purposes. The implementation introduces a two-factor authentication pattern where superuser features require both the database Key Changes:
Note: Previous thread identified missing user feedback in the Debug component (silent success/failure). This wasn't addressed in the current changes. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant DebugUI as Debug Component
participant API as /api/superuser/import-workflow
participant PermCheck as verifyEffectiveSuperUser
participant DB as Database
participant WorkflowOps as Workflow Operations
User->>DebugUI: Enter workflow ID & click Import
DebugUI->>API: POST {workflowId, targetWorkspaceId}
API->>PermCheck: Check superuser access
PermCheck->>DB: Query user.isSuperUser
PermCheck->>DB: Query settings.superUserModeEnabled
PermCheck-->>API: {effectiveSuperUser: true/false}
alt Not Effective Superuser
API-->>DebugUI: 403 Forbidden
DebugUI->>DebugUI: Log error (no user feedback)
else Effective Superuser
API->>DB: Verify target workspace exists
API->>DB: Fetch source workflow
API->>WorkflowOps: loadWorkflowFromNormalizedTables
API->>WorkflowOps: sanitizeForExport
API->>WorkflowOps: parseWorkflowJson (regenerate IDs)
API->>DB: Create new workflow record
API->>WorkflowOps: saveWorkflowToNormalizedTables
alt Save Failed
API->>DB: Delete workflow record (cleanup)
API-->>DebugUI: 500 Error
else Save Success
API->>DB: Copy copilot chats
API-->>DebugUI: 200 {newWorkflowId, copilotChatsImported}
DebugUI->>DebugUI: Invalidate workflow list query
DebugUI->>DebugUI: Clear input & log (no user feedback)
end
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 files reviewed, 2 comments
Summary
Adds superuser capability to debug workflows
Type of Change
Testing
Manual
Checklist