Why this matters
Update bots are good at bringing in new releases quickly. Sometimes that is too quick. When a package is hijacked and a malicious version is published, the projects that get hurt are the ones that installed it in the first hours or days, before anyone noticed. The same is true of releases that are simply broken.
A cooldown tells your update bot to wait until a release is a few days old before proposing it. Most bad releases are caught and pulled within that window. You still get every update, just slightly later, after the wider community has had a chance to try it first.
What good looks like
The update bot is configured to wait at least 3 days before proposing any new release. Fixes for known vulnerabilities are exempt from the wait, since those address a problem that already exists.
How to do it
Dependabot
Add a cooldown block to each update entry in .github/dependabot.yml:
version: 2
updates:
- package-ecosystem: composer
directory: /
schedule:
interval: weekly
cooldown:
default-days: 7
semver-major-days: 14
semver-minor-days: 7
semver-patch-days: 3
Dependabot's security updates are handled separately from version updates and are not delayed by this setting.
Renovate
Set minimumReleaseAge in renovate.json:
{
"extends": ["config:recommended"],
"minimumReleaseAge": "7 days"
}
You can vary it with packageRules, for example a shorter wait for patch releases:
{
"extends": ["config:recommended"],
"minimumReleaseAge": "7 days",
"packageRules": [
{
"matchUpdateTypes": ["patch"],
"minimumReleaseAge": "3 days"
}
]
}
Renovate's vulnerability alerts bypass the minimum release age, so security fixes are not delayed.
Things to watch for
- Setting a cooldown on one ecosystem only. In Dependabot the
cooldownblock belongs to each update entry. Add it to Composer, GitHub Actions, and npm alike. - A
packageRulesentry that sets a shorter wait than you meant. The shortest configured value is the one that applies to the packages it matches. - Renovate durations are written in words. Use
"3 days", not3. - Mistaking schedule for cooldown. A weekly schedule controls when the bot looks. It does not stop the bot proposing a release published an hour ago.