fix(changelog): make scheduled draft run idempotent instead of time-gated - #52
Merged
Merged
Conversation
…ated The 9 AM Toronto wall-clock gate required the run to execute in a 1-hour window, but GitHub's scheduler routinely delays cron triggers by 30-60+ minutes. Delayed runs landed outside the window and silently skipped, so some Fridays produced no changelog at all. Replace the time gate with an idempotency check: a scheduled run skips only when a draft changelog PR is already open. Both Friday crons now act as redundancy (whichever fires first does the work) and the job no longer depends on wall-clock execution time.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Changelog Draft workflow gated scheduled runs to
hour == "09"Toronto. That window is only 1 hour wide, but GitHub's scheduler routinely delays cron triggers 30–60+ min. When delayed past the window the run lands in hour10and silently skips.This week (run 27022421686 and its sibling at 14:01 UTC) both skipped — the
0 13cron was delayed to 14:01 UTC = 10:01 Toronto — so no changelog was generated. 05-29 hit the same issue (PR #44 was a manual dispatch, not the schedule).Fix
Replace the wall-clock gate with an idempotency check: a scheduled run skips only if a draft changelog PR (
automation/changelog-*) is already open.gh pr listhits the API, so no checkout is needed and the skip path stays cheap.workflow_dispatchstill always runs.