Skip to content

Conversation

@raphael-goetz
Copy link
Member

Resolves: #59

Copy link
Contributor

Copilot AI left a 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]))?)*$"
Copy link

Copilot AI Jan 8, 2026

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).

Suggested change
"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]))?)*$"

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Copy link
Contributor

@nicosammito nicosammito left a 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.

Copy link
Contributor

Copilot AI left a 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]))?)*$"
Copy link

Copilot AI Jan 8, 2026

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.

Copilot uses AI. Check for mistakes.
raphael-goetz and others added 5 commits January 8, 2026 12:30
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>
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.

Cron-Job Definitions

3 participants