ci: split the npm pipeline into reusable build + thin CI/release callers - #1600
ci: split the npm pipeline into reusable build + thin CI/release callers#1600nebasuke wants to merge 4 commits into
Conversation
On PRs that touch mirror-docker-images.yml, the mirror run and the edr-npm-release.yml docker jobs start in parallel, so the docker jobs could race ahead and fail their pulls with 'manifest unknown', needing a manual re-run once the mirror was green. The select-node-image action now polls the mirror workflow run for the same head SHA (when one exists) until it completes, same technique the HH3 regression benchmark uses to wait for edr-ci.yml. Closes #1593
check_commit's stringly tag output gated five different steps and jobs with three different expression shapes; a mistake in any of them would silently put a release build on the unsafe path (warm poisonable cache, mirror image in the supply chain). Derive an explicit is_release output from tag in one place, gate every consumer with the same expression, and prove the cold-build invariant at runtime: release builds now fail loudly if a cargo cache was restored. tag itself remains only as the npm dist-tag for publish. Raised by @anaPerezGhiglia in the #1587 review (#1593).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## ci/mirror-wait #1600 +/- ##
==================================================
- Coverage 79.88% 79.82% -0.07%
==================================================
Files 452 453 +1
Lines 78956 79019 +63
Branches 78956 79019 +63
==================================================
Hits 63076 63076
- Misses 13698 13761 +63
Partials 2182 2182 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The wait step could hard-fail all five docker job families on any
non-success mirror conclusion — including fork PRs, whose mirror run
skips itself by design and concludes 'skipped', and a failed weekly
re-sync sharing main's head SHA. The pull itself is the authoritative
loud failure for a genuinely missing tag ('manifest unknown'), so
warn and proceed on non-success or timeout instead of failing.
Also from review: reword the cold-build assert comment (it's a
tripwire against future edits to the cache gate, not a proof of the
is_release derivation), log the non-release decision in check_commit
instead of falling through silently, mention the wait in the action
description, and trim reviewer-facing comments.
edr-npm-release.yml did double duty as PR validation and release pipeline, with the mode threaded through job- and step-level is_release conditions that were easy to miss or drop. Move build/test/prepare/ review into edr-npm-build.yml (workflow_call, one typed 'release' input), called by a thin edr-npm-ci.yml with release: false and a thin edr-npm-release.yml with release: true. Each caller has exactly one condition, at its entry: CI skips release pushes, and the release workflow's jobs all hang off a single release_gate job, so release-only jobs no longer carry guards at all. The commit-message detection moves into a check-release-commit composite shared by both entries. workflow_dispatch on the release workflow is now a rehearsal: it forces the full release path (cold build, Docker Hub images, cooldown, environment approval) but publishes with --dry-run; real publishes happen only on push events. Raised by @anaPerezGhiglia in the #1587 review (#1593).
7afdff5 to
47338ac
Compare
1e8df4b to
b63ac37
Compare
Claude summary
Stacked on #1599. Second half of #1593: the structural follow-up to @anaPerezGhiglia's #1587 review comment:
edr-npm-release.ymldid double duty as PR validation and release pipeline, with the release/non-release mode threaded through job- and step-level conditions — easy to miss on a new step, and a dropped guard failed silently toward the unsafe side (warm poisonable cache, mirror image in the release supply chain).New shape
edr-npm-build.yml(workflow_call) — the build matrix, binding tests,prepare,review, moved verbatim. One typedrelease: booleaninput is the only mode switch: cargo cache vs cold build (still runtime-asserted from ci: wait for in-flight mirror runs; consolidate release gating on is_release #1599), GHCR mirror vs official Docker Hub image. Publishing can never happen here.edr-npm-ci.yml— thin entry for PRs/branch pushes: calls the build workflow withrelease: false. Skips itself on release pushes so those don't double-build.edr-npm-release.yml— thin release pipeline: release-commit detection, then everything hangs off a singlerelease_gatejob — the only release condition in the file.cooldown-check,notify-deploy,publishcarry no guards; adding a job can't miss one.check-release-commitcomposite — the commit-message detection, shared by both entries instead of duplicated.The callee was produced by copy + trim from the monolith; the diff of the moved jobs is limited to the header, five
is-release: ${{ inputs.release }}call sites, two cache-gateifs, and droppedcheck_commitneedsentries — everything else is byte-identical.Release rehearsal (
workflow_dispatch)Manually dispatching
edr-npm-release.ymlnow forces the full release path on any commit — cold build, Docker Hub images, cooldown check, Slack notify,edr-releaseenvironment approval — but publishes with--dry-run. Real publishes happen only onpushevents (checked in the publish script, not a skippable job condition). This replaces the old dispatch behavior (a warm CI run, whichedr-npm-ci.yml's dispatch now provides) and gives us a supported way to validate release-path changes end-to-end without cutting a release.Behavior notes:
<server>/<repo>/commit/<sha>whenhead_commitis absent (dispatch events).PR checks move from workflow "EDR NPM release" to "EDR NPM CI", and the reusable jobs get a
Build and test /prefix, e.g.:Check commitCheck commit(unchanged, now from EDR NPM CI)stable - x86_64-unknown-linux-gnu - node@24Build and test / stable - x86_64-unknown-linux-gnu - node@24Test bindings on Linux-x64-gnu - node@22Build and test / Test bindings on Linux-x64-gnu - node@22Prepare release bundleBuild and test / Prepare release bundleReview releaseBuild and test / Review releaseAnyone with admin on the repo needs to update branch-protection required checks accordingly when merging.
Validation
workflow_callinput wiring): only the 5 pre-existing shellcheck infos, now redistributed across the split files. shellcheck clean on both composite actions. zizmor 1.26.1 clean.edr-npm-ci.yml→release: false).main: post-merge follow-up is aworkflow_dispatchrehearsal to prove the cold build, Docker Hub pulls, and--dry-runpublish end-to-end.