Topic 3 of 4 · 4 min read
Dependency upgrades with agents
Goal: Review an agent's dependency upgrade and find the breaking change from the changelog that it missed.
An agent's dependency upgrade is only as good as its reading of the changelog: check what changed between the old and new version, then check that the code and the lockfile match. Tools such as Renovate and Dependabot already open upgrade pull requests. They bump the version and run your tests. They do not understand what the new version changed.
Check yourself · 1 of 3
What does a Renovate or Dependabot pull request usually tell you about breaking changes?
Why it matters
A major version number is a promise of breaking changes, under the rules of Semantic Versioning. A minor or patch bump should not break you, but sometimes does. An agent that reads release notes can find the changes that matter to your code, such as a removed option or a new default. But an agent can also skim, miss a note halfway down the page, or say "no breaking changes" because the tests passed. Your tests only cover what they cover.
How to review an upgrade
- Read the bump. Which packages moved, and by how much? A major bump needs the full migration guide. A group PR of 30 packages needs splitting.
- Ask for the breaking changes, with sources. The agent should list each breaking change from the changelog or migration guide, quote the line, and say whether your code uses it, with a search to prove it.
- Check the changelog yourself for the top two. Spot-check the risky ones: changed defaults, removed APIs, new minimum runtime versions, changed peer dependencies.
- Read the lockfile diff. Look for unexpected extra packages, a changed registry URL, or a transitive package that jumped a major version.
- Run more than unit tests. Build, type check, and any integration or smoke test that touches the library.
Before and after
Weak review: "Tests are green, merge."
Better review of an agent's PR:
- "axios": "^0.27.2",
+ "axios": "^1.6.0",
The tests pass, but the changelog for the 1.0 release lists changes to error handling and to how some request configuration is merged. The reviewer asks the agent: "Search for every catch around axios calls and for custom transformRequest use. Which ones relied on the old behaviour?" The answer finds two handlers that read error.response.data without a null check.
What goes wrong
- Green tests, silent change. A new default is not tested because nobody wrote a test for the old default.
- Invented notes. The agent summarises a changelog from memory instead of reading the real page. Ask for the link and the quoted line.
- Lockfile surprises. The manifest looks small, but the lockfile pulls in new transitive majors.
- Too many packages at once. When 12 upgrades land together and something breaks, nobody knows which one did it.
Examples
The changed default
A PR upgrades an ORM by one major version. Tests pass. The release notes say the default for cascading deletes is now off. No test covered deleting a parent row, so the bug would only show in production as orphaned child rows. The reviewer asked the agent to search for every delete call on a parent model and add a test for it.
The lockfile line
- "node": ">=16"
+ "node": ">=20"
The new library version quietly raised its minimum runtime. The service still runs Node 18 in production. The PR is green in CI because CI uses Node 20.
Key points
- Renovate and Dependabot open the upgrade PR; they do not tell you what the new version changed for your code.
- A major version bump signals breaking changes under Semantic Versioning, so it needs the migration guide.
- Make the agent list each breaking change with a link and a quoted line, then prove with a search whether your code uses it.
- Always read the lockfile diff for unexpected transitive upgrades.
- Upgrade in small groups so a failure points to one package.
Common mistakes
- Merging because the tests pass, without reading what the new version changed.
- Trusting an agent's summary of a changelog that has no link or quoted line.
- Ignoring the lockfile and the runtime requirements.
- Batching many unrelated upgrades into one PR.
Check yourself · 2 of 3
An agent says an upgrade has no breaking changes. What is the best way to check?
Check yourself · 3 of 3
Why read the lockfile diff in an upgrade PR?
Practice items, not counted towards your mastery.
Start here
- Accelerating code migrations with AI (Google Research) (opens in a new tab)ArticleFree
A large engineering organisation describes combining AI edits with automated validation for code migrations.
- OpenRewrite documentation (opens in a new tab)DocsFree
How recipes make deterministic, repeatable code changes for Java and other languages.
- jscodeshift: a JavaScript codemod toolkit (opens in a new tab)ToolFree
A codemod toolkit that rewrites JavaScript and TypeScript through the syntax tree.
More for this topic
- Renovate docs (opens in a new tab)DocsFree
Configure automated dependency update PRs, grouping and schedules.
- Dependabot and supply chain security (GitHub Docs) (opens in a new tab)DocsFree
How Dependabot raises version and security update PRs for your repositories.
- Semantic Versioning 2.0.0 (opens in a new tab)StandardFree
What major, minor and patch numbers promise, and why a major bump signals breaking changes.