Skip to content

ci: dedupe dependabot lockfiles so its PRs can pass Monorepo integrity - #701

Merged
thinkclay merged 1 commit into
mainfrom
ci/dependabot-auto-dedupe
Sep 2, 2026
Merged

thinkclay merged 1 commit into
mainfrom
ci/dependabot-auto-dedupe

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Dependabot regenerates pnpm-lock.yaml but never runs pnpm dedupe, so its
lockfiles arrive with duplicate resolutions. #700 carries 184 of them — mostly
the postcss 8.5.25/8.5.26 split fanning out through @csstools/*. The Monorepo
integrity job runs pnpm dedupe --check and fails on exactly that.

This is new, and it is self-inflicted. That job is gated on deps == 'true', so
a dependency PR is the only thing that ever runs it, and it had been failing on
a pre-existing backlog of duplicates since #490 — every dependabot PR was red
for a reason that had nothing to do with the PR. #692 cleared the backlog. The
check now passes on main, which means it has started doing its job, and its job
is to fail every dependabot PR. Left alone, that makes hand-batching them the
only way to land a dependency update, which is what the last several PRs have
been.

So dedupe the branch for it. If the lockfile moves, commit and push. The push
raises synchronize, the second run finds nothing to dedupe, and it stops.

Verified against #700's actual branch: pnpm dedupe --ignore-scripts takes it
from 184 duplicates to pnpm dedupe --check exit 0, and the only file it
touches is pnpm-lock.yaml.

On the trigger and the token: a pull_request run raised by dependabot gets a
read-only token and cannot push, which is why the existing dependabot-automerge
workflow already uses pull_request_target. That event carries write access, so
the usual caution applies — this checks out the PR head. Three things bound it:
the github.actor == 'dependabot[bot]' gate, the fact that a dependabot branch
is in-repo rather than a fork and changes only manifests and the lockfile, and
--ignore-scripts, so no package's install scripts run under the write token.
It deliberately does not use ./.github/actions/install, which does a
--frozen-lockfile install and would fail on the very lockfiles this repairs.

Refs #490

🤖 Generated with Claude Code

Dependabot regenerates pnpm-lock.yaml but never runs `pnpm dedupe`, so its
lockfiles arrive with duplicate resolutions. #700 carries 184 of them — mostly
the postcss 8.5.25/8.5.26 split fanning out through @csstools/*. The Monorepo
integrity job runs `pnpm dedupe --check` and fails on exactly that.

This is new, and it is self-inflicted. That job is gated on `deps == 'true'`, so
a dependency PR is the only thing that ever runs it, and it had been failing on
a pre-existing backlog of duplicates since #490 — every dependabot PR was red
for a reason that had nothing to do with the PR. #692 cleared the backlog. The
check now passes on main, which means it has started doing its job, and its job
is to fail every dependabot PR. Left alone, that makes hand-batching them the
only way to land a dependency update, which is what the last several PRs have
been.

So dedupe the branch for it. If the lockfile moves, commit and push. The push
raises `synchronize`, the second run finds nothing to dedupe, and it stops.

Verified against #700's actual branch: `pnpm dedupe --ignore-scripts` takes it
from 184 duplicates to `pnpm dedupe --check` exit 0, and the only file it
touches is pnpm-lock.yaml.

On the trigger and the token: a `pull_request` run raised by dependabot gets a
read-only token and cannot push, which is why the existing dependabot-automerge
workflow already uses pull_request_target. That event carries write access, so
the usual caution applies — this checks out the PR head. Three things bound it:
the `github.actor == 'dependabot[bot]'` gate, the fact that a dependabot branch
is in-repo rather than a fork and changes only manifests and the lockfile, and
`--ignore-scripts`, so no package's install scripts run under the write token.
It deliberately does not use ./.github/actions/install, which does a
--frozen-lockfile install and would fail on the very lockfiles this repairs.

Refs #490

Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay added a commit that referenced this pull request Sep 2, 2026
Dependabot regenerates the lockfile without deduping, which fails the Monorepo
integrity check — this branch arrived with 184 duplicate resolutions, mostly the
postcss 8.5.25/8.5.26 split fanning out through @csstools/*.

Applied by hand here; #701 adds the workflow that will do this automatically on
future dependabot PRs.
@thinkclay
thinkclay merged commit ebf5a2b into main Sep 2, 2026
7 checks passed
@thinkclay
thinkclay deleted the ci/dependabot-auto-dedupe branch September 2, 2026 02:25
thinkclay pushed a commit that referenced this pull request Sep 2, 2026
#700)

Two transitive updates from the everything-else group: baseline-browser-mapping
2.11.7 -> 2.11.20 and @types/geojson 7946.0.8 -> 7946.0.16.

Carries an extra `pnpm dedupe` commit. Dependabot regenerates the lockfile
without deduping, so the branch arrived with 184 duplicate resolutions and
failed Monorepo integrity for reasons unrelated to either bump. #701 automates
this for future dependabot PRs.
thinkclay added a commit that referenced this pull request Sep 10, 2026
…nnot install (#724)

#701 added this workflow to dedupe dependabot's lockfiles automatically, since
dependabot regenerates pnpm-lock.yaml without deduping and Monorepo integrity
fails on exactly that. It has never once succeeded.

`packages/ui` and `packages/sdk` are git submodules, and pnpm-workspace.yaml
lists both as workspace packages. The checkout step did not init them, so
packages/ui was an empty directory and apps/ui-storybook-native's
`"@scaffald/ui": "workspace:*"` resolved to nothing:

    ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In apps/ui-storybook-native:
    "@scaffald/ui@workspace:*" is in the dependencies but no package named
    "@scaffald/ui" is present in the workspace

pnpm exits there, before `pnpm dedupe` runs at all. Every job in ci.yml that
runs pnpm already checks out submodules for this reason; this one was written
without it.

The result is worse than the problem it was added to solve: six dependabot PRs
are open and every one of them is blocked on both `Dedupe the lockfile` (which
errors) and `Monorepo integrity` (which the dedupe would have fixed).

Verified on the real branch of #721: with submodules present,
`pnpm dedupe --ignore-scripts` completes, touches only pnpm-lock.yaml
(740 insertions, 911 deletions), and takes `pnpm dedupe --check` from failing
to exit 0.

Co-authored-by: Claude Opus 5 <[email protected]>
thinkclay added a commit that referenced this pull request Sep 26, 2026
…eiting rebase (#907) (#917)

Two independent things stalled the whole Dependabot queue on 2026-09-25, and
neither was about any PR's contents.

## 1. The Expo gate asked the wrong question

`expo install --check` resolves expected versions from Expo's LIVE REGISTRY,
so it answers "are you on the newest patch set?" — currency — rather than "do
your Expo packages agree with each other?" — skew. Only the second ships bugs.

Because Monorepo integrity is gated on `deps == 'true'`, only dependency PRs
run it. So when Expo published an SDK patch set, all five open Dependabot PRs
went red at once: a PR bumping only `adm-zip` failed identically to a
twelve-package group. #908 realigned the catalog by hand; nothing stopped it
recurring on the next Expo patch.

`scripts/check-expo-alignment.mjs` reads `bundledNativeModules.json` from
INSIDE the installed expo package, which lists the versions belonging with
THAT expo. Offline, version-locked, and about skew only — a registry publish
cannot turn it red. Being a patch behind is no longer a build failure; being
internally inconsistent still is.

Verified both directions: setting expo-image to 56.0.9 — the exact #683
version — fails with `installed 56.0.9 expected ~56.0.13`, and restoring it
passes.

It also closes a hole. `expo install --check` only inspects the app's DIRECT
dependencies, so it never looked at `expo-modules-core` — the package #683 was
actually about, held by a root `pnpm.overrides` entry. The new check walks the
installed tree and immediately found it 4 patches below the bundled set, a gap
that predates #908. Override-pinned skew is an explicit human decision, so it
is reported rather than failed on; see #916. Unpinned skew — Dependabot
drifting one package — still fails hard.

Currency is still worth knowing, and the catalog really was eight packages
behind with nothing saying so. `expo-currency-audit.yml` asks the registry on
Sundays, ahead of Dependabot's Monday wave, and keeps one reusable issue open
while the lag lasts. Non-blocking, with its own signal instead of ambushing an
unrelated PR.

## 2. The dedupe job made Dependabot refuse to rebase

`dependabot-dedupe.yml` pushes a `chore(deps): pnpm dedupe` commit — its whole
purpose (#701, #724), and Monorepo integrity fails without it. Committed as
github-actions[bot], that commit made Dependabot answer every rebase with:

    Looks like this PR has been edited by someone other than Dependabot.
    That means Dependabot can't rebase it - sorry!

So deduping, which a Dependabot PR requires in order to pass, permanently
forfeited that PR's ability to rebase. Any PR that did not merge before main
moved under it was stuck, and the only escape was `@dependabot recreate`,
which discards the dedupe commit and restarts the cycle. Clearing five PRs
took six recreate rounds for exactly this reason.

The commit is now authored as dependabot[bot], keeping the branch
Dependabot-owned. The message still names the workflow that made it, so
provenance is not hidden. This one cannot be verified until a live Dependabot
PR exists — the next wave is Monday — so the fallback is written into the
workflow: `@dependabot recreate` still works, and the alternative is to stop
pushing a commit at all and run `pnpm dedupe` inside the integrity job.

Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant