-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Migrate to workspace services #6628
Conversation
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.
PR Summary
This pull request migrates various services in the workflow module to workspace-specific services, improving modularity and multi-tenancy support.
- Renamed services to include "Workspace" (e.g.,
WorkflowTriggerService
toWorkflowTriggerWorkspaceService
) across multiple files - Removed
workspaceId
parameter from method signatures, suggesting workspace context is now handled at a higher level - Introduced
ScopedWorkspaceContextFactory
inpackages/twenty-server/src/modules/workflow/workflow-action-runner/workflow-action-runner.module.ts
- Replaced
TwentyORMGlobalManager
withTwentyORMManager
for database interactions - Added
WorkflowActionRunnerException
inpackages/twenty-server/src/modules/workflow/workflow-action-runner/workflow-action-runner.exception.ts
for better error handling
12 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings
async enableWorkflowTrigger( | ||
@AuthWorkspace() { id: workspaceId }: Workspace, | ||
@Args('workflowVersionId') workflowVersionId: string, | ||
) { |
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.
logic: workspaceId parameter removed. Ensure workspace context is correctly handled by WorkflowTriggerWorkspaceService
async runWorkflowVersion( | ||
@AuthWorkspace() { id: workspaceId }: Workspace, | ||
@Args('input') { workflowVersionId, payload }: RunWorkflowVersionInput, | ||
) { |
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.
logic: workspaceId parameter removed here as well. Verify that WorkflowTriggerWorkspaceService correctly identifies the workspace context
@@ -0,0 +1,12 @@ | |||
import { CustomException } from 'src/utils/custom-exception'; |
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.
style: Consider using a relative import path for better maintainability
import { CustomException } from 'src/utils/custom-exception'; | ||
|
||
export class WorkflowActionRunnerException extends CustomException { | ||
code: WorkflowActionRunnerExceptionCode; |
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.
style: The code
property is redundant as it's already defined in the constructor parameter
As title