Bug: Cron schedule boundary false negative - Renovate skips branch creation even in valid minute near hour/day rollover #42196
Unanswered
adelaon
asked this question in
Request Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How are you running Renovate?
Self-hosted Renovate CLI
Which platform you running Renovate on?
GitHub.com
Which version of Renovate are you using?
42.99.0
Please tell us more about your question or problem
We are using version 42.99.0, but the same code is in the current repository:
isScheduledNow()(here) can incorrectly returnfalsefor valid cron windows near boundaries (e.g. xx:59) becausecronMatches()(here) checksnextRun()and compares only hour/day/month with now.For example, with schedule * 3-7 * * * at 05:59:54Z (Etc/UTC), this minute is inside the configured window (03:00-07:59), but Renovate logs
Skipping branch creation as not within scheduleand does not perform any update (the recently observed log sequence is attached).Suspected cause:
In lib/workers/repository/update/branch/schedule.ts,
cronMatches()currently does:This is a lossy comparison for “does now satisfy cron?”.
At 05:59:54, nextRun() is 06:00:00, so hour differs and match fails, even though now is valid.
Suggested fix
Since the smallest unit is a minute, it makes sense to check 'the next run after just before the current minute' to determine a minute-membership. This handles boundary cases unlike the same-hour/day/month proxy.
Pseudo-code:
Logs (if relevant)
Logs
Beta Was this translation helpful? Give feedback.
All reactions