Skip to content

Add support for "every n days" long-form schedule syntax#7352

Merged
pelikhan merged 2 commits into
mainfrom
copilot/add-syntax-every-days
Dec 23, 2025
Merged

Add support for "every n days" long-form schedule syntax#7352
pelikhan merged 2 commits into
mainfrom
copilot/add-syntax-every-days

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 23, 2025

The schedule parser accepted short-form every 2d but rejected long-form every 2 days, inconsistent with every 2 hours and every 10 minutes.

Changes

  • Extended parseInterval() to accept "days" as valid unit alongside "minutes" and "hours"
  • Added cron generation logic: every 1 day0 0 * * *, every n days0 0 */n * *
  • Updated validation to include days in minimum duration check (5 minutes)
  • Converted test case from error expectation to success case with 6 additional test variations
  • Updated fuzz test corpus to treat days as valid input

Example

---
on: every 2 days
---

Compiles to:

on:
  schedule:
  - cron: "0 0 */2 * *"
    # Friendly format: every 2 days

Both every 2d and every 2 days now produce identical output.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login it/ref/tags/v5 --version /usr/bin/infocmp (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login it/ref/tags/v5 %(refname) /usr/bin/git --merged fbaa3ad27fdd4c63rev-parse modules/@npmcli/--show-toplevel git -C tags/v6 rev-parse /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet 3-23b8fd6302d7/hinfocmp (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login ithub/workflows --json /usr/bin/git --jq .owner.login + "-1 64/pkg/tool/linuxterm-color git conf�� 3014-16824/test-3205709398/.github/workflows (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Add syntax in short on: schedule to express "every n days" where n > 1

on: every 2 days


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Modified parseInterval() in schedule_parser.go to accept "days" as a valid unit
- Added support for "every 1 day" (singular) -> "0 0 * * *" (daily)
- Added support for "every n days" (plural, n>1) -> "0 0 */n * *" (every n days)
- Updated test cases to expect "days" to work instead of erroring
- Added test cases for "every 2 days", "every 3 days", "every 7 days", "every 10 days", "every 14 days", and "every 1 day"
- Updated fuzz test corpus to include valid "days" examples and remove from invalid list
- All tests pass successfully

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add syntax for scheduling every n days Add support for "every n days" long-form schedule syntax Dec 23, 2025
Copilot AI requested a review from pelikhan December 23, 2025 06:36
@pelikhan pelikhan marked this pull request as ready for review December 23, 2025 06:49
@pelikhan pelikhan merged commit d001fc9 into main Dec 23, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/add-syntax-every-days branch December 23, 2025 06:50
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