Keeping dependencies up to date without the pain
Renovate and Dependabot can update everything. The setup that keeps it calm.
Renovate and Dependabot can update everything. The setup that keeps it calm.

Every project starts with fresh dependencies. A year later, half of them are outdated. Two years later, upgrading one library requires upgrading five others, the framework, and the language version, and suddenly a "small update" is a three-week project.
The fix isn't heroic upgrade sprints. It's small, constant, automated updates. Renovate and Dependabot make that possible, if you set them up so they help instead of flooding you with pull requests.
Dependabot is built into GitHub. Easy to switch on, handles security alerts and version updates for the most common ecosystems. Good enough for many projects.
Renovate (by Mend, open source) is more powerful and flexible:
For infrastructure-heavy repositories, I prefer Renovate, because it can update image tags, chart versions and pinned action SHAs too.
A calm starting configuration:
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended", ":dependencyDashboard"],
"schedule": ["before 7am on monday"],
"timezone": "Europe/Berlin",
"prConcurrentLimit": 5,
"minimumReleaseAge": "3 days",
"packageRules": [
{
"matchUpdateTypes": ["patch", "minor"],
"matchCurrentVersion": "!/^0/",
"groupName": "non-major dependencies",
"automerge": true
},
{
"matchManagers": ["github-actions"],
"groupName": "github actions",
"pinDigests": true
},
{
"matchDatasources": ["docker"],
"pinDigests": true
}
],
"vulnerabilityAlerts": {
"schedule": ["at any time"],
"labels": ["security"]
}
}
What this does:
minimumReleaseAge waits a few days after a release before proposing it. Many malicious package versions are discovered and removed within days, and so are many broken releases.Small updates every week are boring. A giant upgrade every two years is a project. Choose boring.
Automerging dependency updates might sound risky, but it's what keeps the process manageable. The rules are:
Major updates need attention:
Application dependencies are only part of the story. Infrastructure has dependencies as well:
Renovate handles all of these. Keeping base images current is one of the easiest ways to reduce vulnerabilities in your containers.
Turn on Renovate (or Dependabot) in one repository with a weekly schedule and a PR limit. Enable automerge for patch updates once you trust your tests. Expand to minor updates, then to infrastructure files. Within a month, staying up to date becomes background noise instead of a project.
My take: dependencies go off like milk, not wine. Let a bot keep them fresh, a little every week.
— Desly