Repository navigation
feat: bumpy ci deps — auto bump files for dependency update PRs - #161
Conversation
|
The changes in this PR will be included in the next version bump.
|
There was a problem hiding this comment.
Important
The generated-file ownership and dependency classification gaps can silently lose bump coverage or delete a legitimate bump file. These should be addressed before merging.
Reviewed changes in d74bb5b cover the new dependency-update bump-file workflow end to end:
- Dependency detection: Compares release-relevant dependency fields and catalogs against the merge base.
- Generated bump files: Writes deterministic per-package patch files and removes stale output.
- CI automation: Adds
bumpy ci depswith commit, push, fork, token, and GitHub output handling. - Local generation: Adds
bumpy generate --deps, including dry-run and naming options. - Documentation and tests: Documents Dependabot/Renovate setup and tests dependency, catalog, and stale-file behavior.
gpt-5.6-sol | 𝕏
…fe ids, only delete marked files
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review at d74bb5b:
- Aligned dependency detection: Preserved release-relevant
workspace:range transitions so generated coverage matchesbumpy check. - Covered non-direct bumps: Routed
directBump: falsedependency changes to a bumpable fixed-group member and added an actionable failure when no driver exists. - Hardened generated files: Added collision-safe stable IDs and a frontmatter ownership marker required before stale-file deletion.
- Expanded regression coverage: Added focused tests for workspace ranges, fixed-group routing, ID collisions, and preservation of hand-written bump files.
gpt-5.6-sol | 𝕏
| } | ||
|
|
||
| const { packages } = await discoverWorkspace(rootDir, config); | ||
| const baseRef = getBaseCompareRef(rootDir, config.baseBranch); |
There was a problem hiding this comment.
Wrong base for PRs that target a channel branch.
baseRef comes from config.baseBranch, not from the branch the PR targets. ciCheckCommand above already handles this case: it uses process.env.GITHUB_BASE_REF || config.baseBranch so that "the whole cycle's changes" don't show up. ci deps doesn't, so on a PR into a channel branch it writes bump files for every runtime dependency change made on that channel since it split from baseBranch, not just this PR's.
Example: baseBranch: "main", with a dev channel on branch dev.
- Dependabot PR A updates
reactin@acme/web'sdependenciesand merges intodev.devnow differs frommainthere. - Dependabot PR B, also into
dev, only updatesvitestindevDependencies, so it changes nothing release-relevant. ci depson PR B diffs against merge-base(HEAD,origin/main).@acme/web'sreactrange differs from that base, so it writes and pushesdeps-prB-acme-web.md("Updated dependencyreact@…(from<main's range>, independencies)").
Result: an extra patch for a PR that changes no runtime dependency, and a repeat of PR A's changelog line. Every later dependency PR in the cycle collects the same drift.
findChangedPackages in check.ts has the same problem in its package.json field diff (baseRef ??= getBaseCompareRef(rootDir, config.baseBranch)). So ci check asks for these same files, and the two agree on the wrong answer, which hides it. (There, too, the changedFiles passed in come from the PR base, but the field comparison uses baseBranch.)
Suggested fix: resolve the compare branch once, as ciCheckCommand does (process.env.GITHUB_BASE_REF || config.baseBranch), and use it both here and in findChangedPackages (it could take the compare branch as a parameter, along with getChangedCatalogEntries). A test with a channel config would cover it: merge a runtime dependency change into the channel branch, then run ci deps on a dev-only PR into that channel and expect no files.
There was a problem hiding this comment.
Good catch, fixed in 9c73041. ci deps now diffs against GITHUB_BASE_REF || baseBranch. findChangedPackages takes a compareBranch param, used for both the package.json field diff and the catalog diff. ci check (both call sites) and bumpy check --base pass it through, so the drift no longer shows up there either. I added your scenario as a test: a runtime update merged into dev, then a dev-only PR into dev. With the fix it expects no files; without it, it fails.
|
|
||
| jobs: | ||
| deps: | ||
| if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]' |
There was a problem hiding this comment.
github.actor skips pushes made by anyone other than the bot.
github.actor is whoever triggered the run, not who opened the PR. When a maintainer pushes a commit to a Dependabot or Renovate PR, this job doesn't run. The generated files then aren't rewritten and stale ones aren't removed, though the section above says that happens on every run.
Example: Dependabot bumps foo to ^2.1.0 in dependencies, and ci deps writes "Updated dependency foo@^2.1.0". The build breaks, so a maintainer pushes a commit pinning foo to ^2.0.5, or reverting the update. The job is skipped for that push, so the bump file still claims the ^2.1.0 update (or should now be deleted), and it merges with a wrong changelog line.
Suggested fix: gate on the PR author, so every push to a bot's PR is covered:
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'The run triggered by the BUMPY_GH_TOKEN push also matches. It finds the files up to date and commits nothing, so this doesn't loop. The "skip bumpy's regular PR check for those actors" advice below should probably key on the PR author too.
There was a problem hiding this comment.
Agreed, fixed in 9c73041. The example now gates on github.event.pull_request.user.login, and the docs note that the re-run after the token push finds nothing to commit, so it doesn't loop. The "skip the regular check" advice now says to use the same condition, negated.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review at 3400fcd covered the channel-target comparison fix and workflow gating update:
- Corrected dependency comparison: Diffed
ci depsagainstGITHUB_BASE_REFso channel history is not attributed to later dependency PRs. - Aligned package classification: Passed the same comparison branch through
ci check, localcheck --base, package metadata checks, and catalog checks. - Updated workflow gating: Gated the documented action on the PR author so maintainer pushes to bot-authored PRs still regenerate bump files.
- Added regression coverage: Exercised a dev-only PR after runtime dependency drift had already landed on its target channel branch.
gpt-5.6-sol | 𝕏



Adds
bumpy ci deps, which writes bump files for Dependabot / Renovate PRs. It works like changesets-dependencies-action.Why: a user hit this. Dev-only updates already pass
bumpy check(ignoredPackageJsonFields, added in 1.15). Updates to runtimedependencies/peerDependenciescorrectly need a release, but no one is there to write the bump file on a bot PR.What it does
bumpy ci deps, run on a PR:bumpy check:dependencies/peerDependencies/optionalDependencies, plusdevDependencieslisted inreleaseTriggeringDevDeps, minusignoredPackageJsonFields.catalog:refs are resolved on both sides, so a catalog-only update counts for every package that uses the entry..bumpy/deps-pr<N>-<pkg>.md. Each line reads like the changesets action's, e.g.Updated dependency [`lodash@^4.17.21` ↗︎](npm link) (from `^4.0.0`, in `dependencies`).actions/checkoutleaves, and pushes withBUMPY_GH_TOKENwhen it's set so CI runs again. It also sets achangedstep output.bumpy generate --depsdoes the same locally, names the files after the branch, and doesn't commit.--dry-runworks with it.Edge cases
directBump: false: the bump goes on the first bumpable member of the package's fixed group. If there isn't one, the other files are still pushed and the command exits 1 with a message saying what to fix.@org/aandorg-a), a short hash of the full name is added to the ID.GITHUB_BASE_REF), so dependency changes already merged into the channel aren't credited to this PR.Also fixes
ci checkon channel PRsfindChangedPackagescomparedpackage.jsonfields and catalogs againstbaseBrancheven when the changed files came from the PR's base. It now takes acompareBranch, andci check/bumpy check --basepass it in.Docs
docs/github-actions.md: new "Dependency update PRs" section with an example workflow, which only runs on PRs opened by the bots (it checks the PR author, notgithub.actor). It covers the Dependabot-secrets requirement forBUMPY_GH_TOKEN, the fact that Dependabot stops auto-rebasing once someone else pushes to its branch (@dependabot recreate), and runningci depsbeforeci checkin the same job.docs/cli.md:bumpy ci depsandgenerate --deps.docs/configuration.md: a pointer from the change-detection section.Tests
test/core/dep-bump-files.test.tscovers formatting, ID collisions, and git-backed detection: runtime, peer andworkspace:changes; dev-only changes ignored;releaseTriggeringDevDeps; catalogs; deleting stale files while keeping marked-but-merged and hand-written ones;directBump: falsewith and without a fixed-group member; and a channel-PR case where only changes against the PR's own base count. I also ranci depsend to end against a local bare remote, starting from a detached checkout: it pushed the commit, a second run made no changes, andbumpy checkpassed.