Repository navigation
fix: prevent concurrent package archive overwrites - #27
Merged
Merged
Conversation
gachakra
commented
Dec 4, 2026
gachakra
left a comment
Owner
Author
There was a problem hiding this comment.
Independent review
No actionable findings on 4ef8782bf88a1126056d29d2a0682ab0bf5f5144, reviewed against c70c2615cf75c9ad0a7aba335a44487f6b8157dc.
- Concurrent publication. Using Composer 2.11.3 and PHP 8.6.0 in an isolated checkout, I paused an invocation after Composer built its TAR and let a different commit publish first. The winner exited 0. The resumed invocation exited 1 and left the winning TAR byte-for-byte intact. Running the same test with the old helper from
c70c2615cf75c9ad0a7aba335a44487f6b8157dcyielded two exit codes of 0 and overwrote the winner. The new regression forces this ordering and checks both the loser's exit code and the winning bytes. - Failure and cleanup. An existing file, directory, live symlink and dangling symlink were refused and preserved, both when present at startup and when created during packaging. A real PHP destination denial via
open_basedirreturned 1 with the destination still absent. A forced Composer failure also left no archive. Verified that staging and publication were on the same filesystem, the published file kept the staged file's inode, and the staging directories were removed. Publication requires an output filesystem that supports hard links. - Distribution and CI. Git TAR, GitHub source ZIP, Composer TAR and the helper's output from a dirty checkout matched all 22 allowed files byte-for-byte. Untracked, ignored and staged source files and staged and unstaged README edits stayed out of the helper's artifact. The lockfile remains tracked and unignored and stays out of the package. Strict Composer validation, Bash syntax and
git diff --checkpassed. Dependency constraints, lockfile, library source, documentation and Docker configuration are unchanged. - Checks on the reviewed head. PHP 8.4 and PHP 8.5 passed archive verification and the new concurrency regression. Composer Audit ran on PHP 8.4 and was skipped on PHP 8.5 as intended. Docker development environment also passed. Existing check names, permissions and Action pins are unchanged. Workflow run
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.
Summary
link()to publish the fully verified TAR at the exact final path. A failed link returns nonzero; there is no overwrite or copy fallback. The destination filesystem must support hard links.Scope
Only the archive helper, its regression script and the CI step are changed. Existing checks, dependency audit, package contents, library APIs, dependencies, lockfile and Docker configuration are unchanged.
Validation
Actual Composer and the concurrency regression must pass in CI and independent review. No merge or release is requested.