Skip to content

Use main dataSource to query CRON jobs #12830

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

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

martmull
Copy link
Contributor

As title

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

Refactors CRON job querying mechanism in workflow triggers by shifting from TypeORM repository pattern to raw SQL queries via main data source connection.

  • Transitions from TwentyORMGlobalManager to WorkspaceDataSourceService in cron-trigger.cron.job.ts for centralized database access
  • Integrates WorkspaceDataSourceModule into automated-trigger.module.ts to support main data source querying
  • Consider implementing query parameterization for raw SQL to prevent SQL injection vulnerabilities
  • Ensure proper error handling and connection management when using raw database queries
  • Add transaction support for database operations to maintain data consistency

2 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM!

@martmull martmull enabled auto-merge (squash) June 24, 2025 13:28
@martmull martmull merged commit ce55b20 into main Jun 24, 2025
39 checks passed
@martmull martmull deleted the update-CronTriggerCronJob-for-raw-queries branch June 24, 2025 13:29
Copy link
Contributor

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:45405

This environment will automatically shut down when the PR is closed or after 5 hours.

Copy link

sentry-io bot commented Jun 25, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

abdulrahmancodes pushed a commit to abdulrahmancodes/twenty that referenced this pull request Jun 26, 2025
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