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

feat(cssc): 31005729 support cron expressions for '--schedule' parameter #8

Draft
wants to merge 3 commits into
base: feature/cssc_ext
Choose a base branch
from

Conversation

cegraybl
Copy link

Add cron expression support for the --schedule parameter and update the help and error texts.
Validation of the cron expression is done via croniter and submitted to the Task API when creating/updating a workflow task.

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/acrcssc/azext_acrcssc/tests/latest/test_validators.py:38

  • Additional test cases for invalid cron expressions should be added to cover different invalid cron patterns.
test_cases = [('df'),('12'),('dd'),('41d'), ('21dd')]
@cegraybl cegraybl changed the title feat(cssc): 31005729 support a cron expression for '--schedule' parameter feat(cssc): 31005729 support cron expressions for '--schedule' parameter Jan 25, 2025
return

# Validate cron expression using croniter
if not croniter(schedule).is_valid:
Copy link

Choose a reason for hiding this comment

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

We restrict the minimum interval to 1 day when using n day format. Shall we enforce a minimum interval for the cron format? This would ensure consistency with the "n day" format and help prevent triggering excessive runs in a short period, which could increase the load and cause throttling.

Copy link
Author

@cegraybl cegraybl Jan 27, 2025

Choose a reason for hiding this comment

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

what should be the minimum interval, if we make it 'at least' once a day (match something like [0-9]{1-2} [0-9]{1-2} * * *) then end up in the same place as using the schedule option, no?
What additional flexibility do we want to add by adding the usage of cron expressions but not allowing the user to specify it?
User can would still be able to modify the trigger task by hand and do whatever setup they want and we cannot block that.

…edule, centralize regex to match daily schedule
@cegraybl cegraybl requested review from huanwu and Copilot January 28, 2025 00:42
@cegraybl cegraybl marked this pull request as draft February 5, 2025 17:17
@cegraybl
Copy link
Author

cegraybl commented Feb 5, 2025

Moving to 'draft' as this is not targeted for the current semester.
Will split out another PR for the code style recommendations

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