Fix Test workflow failing with an empty Python matrix - #43
Merged
Conversation
Run 30890495192 failed with no failing step: only fetch-python-versions
appeared, it reported success, and build-and-test was never created.
The cause is a masked network error. The version fetch is a pipeline:
versions=$(curl -fsSL ... | jq '[...]')
Without pipefail a pipeline's exit status is the *last* command's, so
curl's failure is invisible - jq reads empty input, emits [], and the
matrix expands to zero jobs. The run then fails with nothing to point at.
The log confirms it:
curl: (28) Failed to connect to endoflife.date port 443 after 270172 ms
Add `set -euo pipefail` so the step fails at the real cause, retry the
request, and reject an empty version list explicitly rather than emitting
a matrix that cannot produce jobs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.



The
Testworkflow has been failing with no failing step — onlyfetch-python-versionsran, it reported success, andbuild-and-testwas never created.
Cause
The version fetch is a pipeline:
versions=$(curl -fsSL https://endoflife.date/... | jq "[...]")Without
pipefail, a pipeline reports the last command's exit status,so
curlfailing is invisible:jqreads empty input, emits[], and thematrix expands to zero jobs. GitHub then fails the run with nothing to
attribute it to. The log of run 30890495192 confirms it:
So this was a transient network blip silently converted into a broken matrix
— not a code or toolchain problem.
Fix
set -euo pipefailso the step fails at the real cause--retry 3 --retry-all-errors --connect-timeout 15to ride out blipsVerified under
bash -e <file>(exactly how Actions invokesrun:): the oldform exits 0 with an empty value, the new form exits 1.
Note: every repo in the org shares this block and is vulnerable to the same
silent failure. Happy to follow up across the rest.
🤖 Generated with Claude Code