-
Notifications
You must be signed in to change notification settings - Fork 0
Cron Job Definitions #209
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
base: main
Are you sure you want to change the base?
Cron Job Definitions #209
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.
Pull request overview
This pull request adds comprehensive cron job definitions to enable scheduled task automation. The implementation includes a flow type definition and supporting data types that validate cron expression syntax through regex patterns.
- Introduces a CRON flow type with a CRON_CODE setting for specifying cron expressions
- Adds five data type validators (minute, hour, day_of_month, month, day_of_week) with regex patterns for cron syntax validation
- Defines a CRON_CODE object type that composes the five individual cron field types
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| definitions/cron/flow_type/cron.proto.json | Defines the CRON flow type with metadata and CRON_CODE setting for scheduled task execution |
| definitions/cron/data_type/object/cron_code.proto.json | Defines the CRON_CODE object structure containing all five cron expression fields |
| definitions/cron/data_type/type/cron_minute.proto.json | Validates minute field (0-59) with support for ranges, steps, and lists |
| definitions/cron/data_type/type/cron_hour.proto.json | Validates hour field (0-23) with support for ranges, steps, and lists |
| definitions/cron/data_type/type/cron_day_of_month.proto.json | Validates day of month field (1-31) with support for ranges, steps, and lists |
| definitions/cron/data_type/type/cron_month.proto.json | Validates month field (1-12) with support for ranges, steps, and lists |
| definitions/cron/data_type/type/cron_day_of_week.proto.json | Validates day of week field (0-7) with support for ranges, steps, and lists |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "rules": [ | ||
| { | ||
| "regex": { | ||
| "pattern": "^(\\*|([1-9]|[12]\\d|3[01])(-([1-9]|[12]\\d|3[01]))?)(\\/([1-9]|[12]\\d|3[01]))?(,(\\*|([1-9]|[12]\\d|3[01])(-([1-9]|[12]\\d|3[01]))?)(\\/([1-9]|[12]\\d|3[01]))?)*$" |
Copilot
AI
Jan 8, 2026
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.
The regex pattern for CRON_DAY_OF_MONTH doesn't accept leading zeros (e.g., "01", "02"), which creates an inconsistency with the other cron field types (minute, hour, month) that do accept leading zeros. Standard cron expressions typically accept both "1" and "01" formats. Consider updating the pattern to: ^(\\*|(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01]))?)(\\/([1-9]|[12]\\d|3[01]))?(,(\\*|(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01]))?)(\\/([1-9]|[12]\\d|3[01]))?)*$ to allow optional leading zeros for day values (but not for step values, as they represent counts rather than specific days).
| "pattern": "^(\\*|([1-9]|[12]\\d|3[01])(-([1-9]|[12]\\d|3[01]))?)(\\/([1-9]|[12]\\d|3[01]))?(,(\\*|([1-9]|[12]\\d|3[01])(-([1-9]|[12]\\d|3[01]))?)(\\/([1-9]|[12]\\d|3[01]))?)*$" | |
| "pattern": "^(\\*|(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01]))?)(\\/([1-9]|[12]\\d|3[01]))?(,(\\*|(0?[1-9]|[12]\\d|3[01])(-(0?[1-9]|[12]\\d|3[01]))?)(\\/([1-9]|[12]\\d|3[01]))?)*$" |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
nicosammito
left a comment
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.
Approved, but just looked for the data type syntax not for the correct regex inside the rules.
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.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "rules": [ | ||
| { | ||
| "regex": { | ||
| "pattern": "^(\\*|(0?[1-9]|1[0-2])(-(0?[1-9]|1[0-2]))?)(\\/(0?[1-9]|1[0-2]))?(,(\\*|(0?[1-9]|1[0-2])(-(0?[1-9]|1[0-2]))?)(\\/(0?[1-9]|1[0-2]))?)*$" |
Copilot
AI
Jan 8, 2026
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.
The regex pattern doesn't accept leading zeros for month values, which are valid in cron expressions. For example, "01" (January with leading zero) should be valid but will be rejected by this pattern. Consider updating the pattern to allow optional leading zeros, similar to how the minute and hour patterns handle them.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Resolves: #59