Skip to content
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

Merged
merged 1 commit into from
Aug 14, 2024
Merged

Conversation

thomtrp
Copy link
Contributor

@thomtrp thomtrp commented Aug 14, 2024

As title

@thomtrp thomtrp merged commit 6927f46 into main Aug 14, 2024
6 checks passed
@thomtrp thomtrp deleted the tt-use-workspace-services-in-workflow branch August 14, 2024 16:46
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 to WorkflowTriggerWorkspaceService) across multiple files
  • Removed workspaceId parameter from method signatures, suggesting workspace context is now handled at a higher level
  • Introduced ScopedWorkspaceContextFactory in packages/twenty-server/src/modules/workflow/workflow-action-runner/workflow-action-runner.module.ts
  • Replaced TwentyORMGlobalManager with TwentyORMManager for database interactions
  • Added WorkflowActionRunnerException in packages/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

Comment on lines 18 to 20
async enableWorkflowTrigger(
@AuthWorkspace() { id: workspaceId }: Workspace,
@Args('workflowVersionId') workflowVersionId: string,
) {
Copy link
Contributor

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

Comment on lines 31 to 33
async runWorkflowVersion(
@AuthWorkspace() { id: workspaceId }: Workspace,
@Args('input') { workflowVersionId, payload }: RunWorkflowVersionInput,
) {
Copy link
Contributor

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';
Copy link
Contributor

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;
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants