test(vendor): yarn 1 dev-flow e2e — lockfile re-save survival + strapi-incident guards#129
Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Open
test(vendor): yarn 1 dev-flow e2e — lockfile re-save survival + strapi-incident guards#129Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
…coexistence, no patch: leakage Companion to the fresh-checkout capstone (e2e_vendor_yarn_classic_build): proves yarn 1.22.22 stays a first-class installer for vendored wiring across the everyday flows that capstone does not exercise: - plain `yarn install` (no --frozen-lockfile/--offline) delivers patched bytes and keeps the vendored file: block intact - `yarn add` re-serializes the ENTIRE lockfile from yarn's in-memory model (asserted via `Saved lockfile.`) and must round-trip the vendored block byte-intact — the flow that would silently drop patches if yarn normalized our entry away - an unvendored neighbor (`resolve` — the package at the center of the strapi/yarn2 incident) keeps a byte-identical lock block and installs pristine - the wired lockfile never contains a `patch:` resolution (guards berry migrations of classic lockfiles) - `--frozen-lockfile` passes on the re-saved lockfile (CI re-entry) Local capstone: skips when corepack/registry are unavailable; all assertions after the gate are hard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Debugging a vendored-mode install of an old strapi monorepo (yarn v1 lockfile) surfaced a class of yarn-1 flows our existing capstone doesn't cover. The install failures themselves turned out to be a yarn 2.4.3 bug on Node ≥23 (
util.isDateremoved; berry's builtinpatch:compat fetcher forfsevents/resolvecrashes — unrelated to our wiring), but the incident showed yarn 1 is the right installer for classic-lockfile projects — and we only e2e-proved the--frozen-lockfile --offlinefresh-checkout path (e2e_vendor_yarn_classic_build.rs).Manually verified during the incident, now pinned as e2e: yarn 1.22.22 consumes vendored
file:wiring correctly in the everyday developer flows, where a regression would silently drop patches.What the new capstone proves (
e2e_vendor_yarn_classic_dev_flow.rs)yarn install(no--frozen-lockfile, no--offline) on a fresh checkout delivers the patched bytes and keeps the vendored block intact.yarn addre-serialization round-trip:yarn addrewrites the entire lockfile from yarn's in-memory model (asserted viaSaved lockfile.so the check can't go vacuous). The vendoredresolved "file:./.socket/vendor/…#sha1"+ recomputedintegrityblock must survive byte-intact.resolve@1.20.0(the package at the center of the strapi incident — berry builtin-patches it) rides along unvendored; its lock block stays byte-identical through vendor + installs and it installs pristine registry bytes.patch:protocol leakage: the wired/re-saved lockfile never contains apatch:resolution, so a berry migration of a classic lockfile can never inherit one from us.--frozen-lockfilepasses on the re-saved lockfile — dev installs don't wedge CI installs downstream.yarn.lockbyte-identical.Conventions
Same harness shape as the existing capstone: self-contained helpers,
corepack yarn@1.22.22pinned,SOCKET_*env scrubbed, privateYARN_CACHE_FOLDERper phase, local-only skip gates (corepack/registry unavailable → println + return), hard assertions after the gate.Test run
🤖 Generated with Claude Code