fix(wbfy): stage and rename the global package-manager configs - #1185
Merged
Conversation
self-host-utils rewrites these files on machines that run jobs concurrently, so a `>` redirect let a package manager read a truncated config and resolve packages ungated or straight from the default registry. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
… floor A fixed `.staging` name let two concurrent runs publish each other's half-written file and abort on the missing rename target (reproduced with six concurrent runs, which now all succeed). Yarn Berry 4.10.3 enforces npmMinimalAgeGate and npmPreapprovedPackages while 4.9.4 ignores both, so the documented floor is 4.10, not 4.11. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
It holds the credentials kept from the existing config, so a failed rename must not leave a copy behind. The documented Yarn floor also moves to 4.10.2, the first release whose gate quarantines a version missing from the packument's publish times instead of admitting it. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
…on a signal `mv` moves the staging file INTO a destination directory and reports success, which would leave the config unwritten while the run claims the policy was applied. A single EXIT/INT/TERM trap now also removes the staging file when the run is interrupted, replacing the failure-only cleanup. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
A cleanup-only INT/TERM trap swallowed the signal, so a cancelled run went on to write every config and report success; it now exits 130/143 while the EXIT trap still removes the staging file. The documented Yarn floor also moves to 4.10.3, whose resolver no longer picks a prerelease in place of a quarantined `latest`. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Co-authored-by: WillBooster (Claude Code) <agent@willbooster.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.
Follow-up to #1182.
applyReleaseAgeGate.shwrote each global config with a>redirect, which truncates the file before the new content lands. self-host-utils runs the script on machines that execute jobs concurrently, so a package manager resolving packages at that moment could read a truncated~/.npmrcand install ungated or straight from the default registry, bypassing the Takumi Guard proxy — the reason the previous self-host-utils script staged its writes and renamed them into place.Each write now stages under a
mktempname and renames it into place:EXITtrap removes the staging file — which carries the credentials kept from the existing config — when a run fails, and explicitINT/TERMtraps make a cancelled run exit 130/143 instead of finishing and reporting success.mvwould move the staging file inside it and report success.The documented Yarn floor also moves to 4.10.3: 4.9.4 has no
npmMinimalAgeGate, 4.10.1 admits a version missing from the packument's publish times, 4.10.2 fixed that, and 4.10.3 no longer resolves a prerelease in place of a quarantinedlatest.docs/expected-repository-rules.mdrecords these floors alongside the machine-managed global configs.