Repository navigation
ci: grep the wheel's METADATA from a file, not a pipe (defensive) - #65
Merged
Merged
Conversation
`unzip -p ... METADATA | grep -qx "Version: $VERSION"` under pipefail has the shape of the tar | grep -q check that failed at random in convertapi-library-js's build on 2026-11-09. Here it cannot fail on GitHub's runners today: unzip writes the 6 KB METADATA in one write(), and with SIGPIPE ignored, as on the runner, unzip -p ignores EPIPE and exits 0. With a METADATA over 64 KB and the default SIGPIPE disposition it could, so the check now reads a file and depends on neither. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 9, 2026
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the release workflow’s wheel-version check update.
No open issues 🎉
What changed in this PR
This PR defensively updates the release workflow’s wheel-version check to avoid potential SIGPIPE failures under pipefail.
Changes:
- Extracts wheel METADATA to
$RUNNER_TEMP/METADATAbefore checking its version. - Preserves the existing version check and adds a comment explaining why the pipeline is avoided.
| File | Description |
|---|---|
.github/workflows/publish.yml |
Replaces the unzip | grep pipeline with file-based METADATA validation. |
Review effort: Balanced
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
The "Check the packages" step in
publish.ymlrunsunzip -p … METADATA | grep -qx "Version: $VERSION"underset -euo pipefail. That has the shape of thetar | grep -qcheck that failed at random in convertapi-library-js'smainbuild on 2026-11-09:grep -qexits at its match, and if the writer is still writing,pipefailfails the step.Unlike the npm checks, this one cannot fail on GitHub's runners today:
write()(strace), so grep cannot exit while unzip is still writing. unzip writes 64 KB at a time.unzip -pignores EPIPE and exits 0 when its reader leaves early (a 4 MB member piped intohead -c 10: 82 writes got EPIPE, exit 0). With the default SIGPIPE disposition, as in a terminal, unzip is killed and the pipeline returns 141.So a false failure needs a METADATA over 64 KB (a much longer README) and the default SIGPIPE disposition. This change removes both conditions and uses the same pattern as the other SDK workflows. It is defensive: nothing fails today.
Change
METADATA goes to
$RUNNER_TEMP/METADATA, thengrep -qx "Version: $VERSION"reads the file. A wrong version still fails the step without a message, as before.Tested
In an Ubuntu 24.04 container (unzip 6.0, GNU grep 3.11, bash 5.2) with SIGPIPE ignored, as on the runner. The step's
run:script was read frompublish.ymland run withbash -euo pipefailagainst the wheel and sdist built frommainwithpython -m build(__version__set to 9.9.9):mainVersion: 9.9.8caution: filename not matched: convertapi-9.9.9.dist-info/METADATApublish.ymlruns only on a release, so it was tested only as above. This PR's Build does not run the changed step.The fix for the real race: ConvertAPI/convertapi-library-js#31 and ConvertAPI/convertapi-library-node#128. The same defensive change for Java: ConvertAPI/convertapi-library-java#61.
🤖 Generated with Claude Code