-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(schedule): fix for custom cron #699
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 Git ↗︎
1 Skipped Deployment
|
|
✅ No security or compliance issues detected. Reviewed everything up to 15e4e04. Security Overview
Detected Code Changes
Reply to this PR with |
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.
Greptile Summary
This PR fixes a bug in the scheduling system's handling of custom cron expressions. The key changes are:
- Added a
cronExpressionfield to thescheduleValuesobject returned bygetScheduleTimeValues - Improved the custom cron expression handling in
generateCronExpressionby directly accessing the new field instead of using type casting - Enhanced cron pattern parsing for better display formatting
The changes make the custom scheduling feature more robust by properly integrating cron expressions into the type system instead of relying on type assertions.
Confidence score: 4/5
- This PR is safe to merge as it improves type safety and includes comprehensive tests
- The score reflects strong test coverage and clear implementation, but complex cron patterns warrant some post-merge monitoring
- Files that need attention:
apps/sim/lib/schedules/utils.ts: Verify that all edge cases for custom cron expressions are handledapps/sim/lib/schedules/utils.test.ts: Consider adding more complex cron pattern test cases
2 files reviewed, no comments
Edit PR Review Bot Settings | Greptile
* fix: added cronExpression field and fixed formatting * fix: modified the test.ts file simstudioai#699 * added additional validation --------- Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> Co-authored-by: Waleed Latif <walif6@gmail.com>
Description
Custom cron expression wasn't working. Added cronExpression field in utils.ts and fixed formatting displayed to the user.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Verified custom cron expressions were setting properly by testing with: 0 0 1 */3 *, */15 * * * *, 0 0 1 1,7 *, and 0 0 1 2-12/2 *.
Checklist:
bun run test)Security Considerations: