Skip to content

release: v4.16.11 - never auto-merge a Dependabot PR onto the release… - #169

Merged
Shinrai merged 15 commits into
masterfrom
next
Jul 28, 2026
Merged

Shinrai merged 15 commits into
masterfrom
next

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

👥 Contributors

Shinrai and others added 10 commits July 27, 2026 09:42
Dependabot security updates ignore dependabot.yml's `target-branch` and open
against the repository's default branch (master). If redirect-hotfix-pr misses
one, the auto-merge action would previously merge it straight onto master — it
gated only on the PR author (`dependabot[bot]`), never on the base branch.

Add a defense-in-depth guard: dependabot-auto-merge now declines to enable
auto-merge when the PR's live base is the repository default branch (or the
conventional release-branch names master/main), emitting a warning and leaving
the PR open for manual handling instead of auto-landing it. Only next/hotfixes
are valid auto-merge targets in the v4 staging-branch flow.

New pure `isProtectedBase()` helper in _impl.mjs, with unit tests.
The dependabot-security path cherry-picks onto the hotfix lane, which needs
the caller workflow to have run a checkout AND configured a git identity. An
out-of-date caller (a copied local-*/example template from before those steps
were required) reached the cherry-pick with neither — where the failure was
silent-ish: `git cherry-pick` runs via runCapturing, so a missing identity was
misread as a *conflict*, posted a misleading "couldn't cherry-pick cleanly"
comment, and exited 0 (green), leaving the security PR on the default branch to
be auto-merged.

Probe the prerequisites (git checkout present + user.name/user.email
configured) at the top of the dependabot-security path. When missing, post an
explanatory comment naming the stale caller and throw — a red X + actionable
message instead of a silent skip. Pure `missingCherryPickPrereq()` helper with
unit tests; the git probing lives in the side-effecting wrapper.
…bles

The six release-flow workflows shipped only as copied `local-*`/example
templates carrying full job logic. Repos onboarded before a template changed
kept a stale copy — e.g. the hotfix-redirector's Dependabot-security path needs
a checkout + git identity that older copies lack, latently reintroducing the
"security PR → master" bug. Copied job logic can't be fixed by bumping @v4.

Author reusables that own the token/checkout/identity/action-call:
  workflow-hotfix-redirector, workflow-next-release, workflow-next-reset,
  workflow-hotfixes-release, workflow-feature-pr, workflow-pr-title-normalizer.

Each repo file collapses to a trigger + one thin `uses:` job (the trigger and
concurrency must stay local — GitHub requires the trigger declared in the
triggering workflow). This repo dogfoods them via `./`; consumers pin `@v4`, so
bumping the pin carries new requirements automatically and per-repo drift can't
recur. Behavior is unchanged — the job steps are moved verbatim, with the bot
secrets exposed under generic names (BOT_APP_CLIENT_ID/…) mapped by the caller,
matching the existing workflow-publish convention. Per-repo package_name /
build_command are inputs on the two release reusables.

Callers shrink from ~180-260 lines of copied logic to ~33-54 lines each.
Validated: actionlint, validate-action-refs, YAML parse all clean.
…mpotent

publish.mjs gated its idempotent already-published → pseudo-success path on the
literal substring "Cannot publish over previously published version". npm's
actual error is "You cannot publish over the previously published versions:
3.12.2." — lowercase `cannot`, an inserted `the`, and plural `versions` — so the
substring never matched. The already-published case fell through to the 403/auth
branch and FAILED the job.

This is what red-X'd satellite/extra-package publishing on a re-run or a stray
master push: those packages are intentionally not version-gated (so a partial
satellite failure can be retried), so they reach the publish and must skip
cleanly when the exact version already exists — but the broken match turned that
skip into a hard failure (the reported slothlet-i18n / slothlet-types @3.12.2).

Match the stable core phrase case-insensitively via a new tested pure helper
`isVersionAlreadyPublishedError()`, with the real npm 403 body as a test fixture
so the wording can't silently drift again.
…ly one

The coverage-badge and coverage-pr-comment legs ran the caller's `build_command`
before the coverage run. For src/dist-split repos that command is
`npm run build:ci`, which ends with `ci:cleanup-src` and DELETES `src/` — so the
subsequent coverage run (coverage.include `src/**`) measured a now-absent tree,
produced empty coverage, and crashed the @cldmv/vitest-runner summary
(`pct.toFixed is not a function`). Red on every master push; the badge went
stale. The matrix-test legs legitimately want the dist-only cleanup.

Add a separate `coverage_build_command` input (default `npm run build`, which
preserves `src/`) to both coverage reusables and thread it through
workflow-ci.yml. The coverage Build step uses it, falling back to `build_command`
only when it's explicitly emptied — so the fix applies by default on a `@v4`
bump, is decoupled from the matrix build, and stays overridable.

(The upstream guard so a coverage misconfig degrades instead of crashing —
colourPct/printCoverageSummary tolerating a non-numeric pct — belongs in
@cldmv/vitest-runner and is flagged separately.)
…list

master-commit-audit flags any default-branch commit whose subject isn't a
release/chore/merge. Dependabot's build(deps…) subjects deliberately don't
match: in the v4 staging flow nothing lands on master except the release/hotfix
lanes, so a raw Dependabot commit there means both redirect-hotfix-pr AND the
dependabot-auto-merge base guard were bypassed — exactly the anomaly this audit
exists to flag. Allow-listing Dependabot would silence that signal.

No behavior change — a comment on DEFAULT_ALLOWED_PATTERNS so the deliberate
strictness isn't "helpfully" removed later.
The milestone changelog cadence stopped at v4.2.0 while the repo shipped through
v4.16.10. Reconstruct one file per minor cut (v4.3.0–v4.16.0) from the release
tag bodies, matching the existing v4.x format — headline paragraph plus
Added/Changed/Fixed/Removed sections and a trailing patch-release summary. Per
the folder convention, patch releases don't get their own files; their details
stay in the corresponding GitHub Release. Update the README index.
…iffs

These three had only a release subject line in their tag body, so the initial
backfill was thin. Reconstruct the real detail from the release diffs:

- v4.10.0: the Trivy gate builds to an OCI tarball, scans, and pushes via crane
  only on pass; document the scan_* tunables and report-only mode.
- v4.15.0: the 📦 Dependencies section is driven by a new isDependencyUpdate()
  detector; filterBotCommits now keeps dependency bumps while dropping release
  automation noise.
- v4.16.0: close-resolved-issues REPLACES sync-closing-issues — it closes issues
  at release time (walking the release PR's range for gh-broker markers +
  Fixes/Closes keywords) because the staging flow breaks GitHub's native
  keyword auto-close. Note the removal.
@cldmv-bot cldmv-bot Bot added ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: patch This release contains only backwards-compatible bug fixes type: config Changes to repository or project configuration files type: documentation Relates to docs, README updates, guides, or inline code comments labels Jul 28, 2026
@cldmv-bot cldmv-bot Bot added the type: ci Changes to CI workflows, actions, or build pipelines label Jul 28, 2026
@cldmv-bot cldmv-bot Bot changed the title release: v4.16.11 - backfill v4.3.0 through v4.16.0 release: v4.16.11 - measure coverage against a src-preserving build, not… Jul 28, 2026
@cldmv-bot cldmv-bot Bot added type: bug Something is broken or not behaving as expected area: core Touches core library / runtime source code labels Jul 28, 2026
@cldmv-bot cldmv-bot Bot changed the title release: v4.16.11 - measure coverage against a src-preserving build, not… release: v4.16.11 - recognize npm's real 'already published' error so… Jul 28, 2026
@cldmv-bot cldmv-bot Bot changed the title release: v4.16.11 - recognize npm's real 'already published' error so… release: v4.16.11 - never auto-merge a Dependabot PR onto the release… Jul 28, 2026
@Shinrai
Shinrai enabled auto-merge (squash) July 28, 2026 05:58
@Shinrai
Shinrai merged commit 7634f32 into master Jul 28, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: patch This release contains only backwards-compatible bug fixes type: bug Something is broken or not behaving as expected type: ci Changes to CI workflows, actions, or build pipelines type: config Changes to repository or project configuration files type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant