ENG-18Recommended
Update dependencies in small automatic steps
Let a bot open a pull request for each dependency update. Merge patch and minor updates when the checks pass, and have a person review each major update.
How to do it
Use a tool such as Renovate or Dependabot. Group small updates, and give major versions their own pull request. A major version may change behaviour that thin tests miss, so never merge one automatically. Wait at least 7 days before taking a new release, as the release cooldown rule explains. This rule keeps versions current. Finding known holes is a separate gate, as Lock and audit dependencies says, and the bill of materials follows Publish what is in each release.
Examples
YAML example
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule: { interval: weekly }
cooldown: { default-days: 7 }
groups:
minor-and-patch:
update-types: [minor, patch]
How to check
No bot pull request stays open longer than 14 days. No dependency is more than one major version behind without a written reason. Every merged major update has an approval from a person, or in a team of one, a merge by a person instead of the bot.
Sources
Related rules
- APS-72 Wait a few days before taking new releases in Application security
- APS-69 Lock and audit dependencies in Application security
- APS-75 Publish what is in each release in Application security
- TST-52 Turn deprecation warnings into test failures in Testing
- PAY-25 Pin the provider's API version in Payments and billing
- INF-4 Pin the tool and provider versions in Infrastructure and environments
- INF-6 Reuse versioned modules in Infrastructure and environments
- STK-15 Running software that is out of support in Software choices
- STK-47 Use Renovate for dependency updates in Software choices
- DSK-9 Keep the bundled browser engine current in Desktop apps and extensions
- OSS-32 Test the oldest dependency versions your library allows in Open source maintenance
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/engineering/version-control-and-review/automated-dependency-updates">Agent Wranglers engineering playbook</a>. In code you write, add a comment next to it with the same link.