Repository navigation
Failure reporters survive a log with no marker - #1366
Merged
Merged
Conversation
Actions runs a `run:` step under `bash -e {0}`, and these steps add
pipefail, so when the tee'd log holds no `✖` the grep exits 1, pipefail
promotes it to the pipeline's status, and `-e` kills the step at the
assignment -- before the named fallback. Nothing was posted at all, and the
stage roll-up this epic replaced is what landed, for exactly the failures
the fallback exists for: an OOM, an evicted runner, a cancellation, or a
failure early enough that the log was never written. `prepare` also ran
under `set -u` without initialising `msg`, so even without `-e` it died at
its own fallback test with `msg: unbound variable`.
The reporters now run in the test rather than being asserted as text, which
is why this shipped: the fallback assertion was
`expect(workflow()).toContain(fallback)`, and it passed over dead code. The
script is extracted from the file and executed under `bash -e` up to the
point where `msg` is final, so nothing needs jq and nothing can reach
api.nemar.org.
Needs the same file copied into nemarDatasets/.github; the parity test is
red until it is.
Tests: 22 in import-capture-workflow.test.ts. Removing `|| true` fails 6,
removing prepare's initialiser fails 2.
Contributor
Author
|
Paired org-side change is merged: nemarDatasets/.github#116, commit |
This was referenced Sep 10, 2026
Merged
This branch was previously deployed
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.
Fixes #1364, found by the release review of
main...dev. Live in production sincenemarDatasets/.github@91bebcc0this morning, so this needs the paired copy (below).What was broken
Actions runs a
run:step underbash -e {0}, and these steps addset -o pipefail. So when the tee'd log holds no✖:line="$(grep -nF '✖' "$log" 2>/dev/null | tail -n 1 | cut -d: -f1)"grepexits 1, pipefail promotes it to the pipeline's status, and-ekills the step at that assignment — before the named fallback three lines later. Nothing is posted, and thereportjob'sterminal: prepare=failure copy=failure finalize=failureroll-up is what lands: exactly the pre-change behavior, for exactly the failure modes the fallback was written for (an OOM, an evicted runner, a cancellation, or a failure early enough that the log was never written).preparewas also the only reporter that never initializedmsg, so underset -uit died at its own[ -z "$msg" ]test withmsg: unbound variable.So #1351's stated decision — "An empty extraction becomes a named fallback, never an empty
error_message" — did not hold in the deployed shell.Why the test suite was green
backend/test/import-capture-workflow.test.tsasserted the fallback like this:The string was in the file. The code path was dead. That is the third instance today of a test that exercises text or a callee while the caller is wrong, so the reporters now run: the script is extracted from the YAML and executed under
bash -e, cut at the point wheremsgis final, so nothing needsjqand nothing can reachapi.nemar.org. Nine new cases across the three stages: no marker, missing log, a real CLI failure line still winning, and prepare's upstream-inaccessible branch.The paired deploy
.github/dataset-workflows/onboard-openneuro.ymlis deployed by copying it intonemarDatasets/.github, and #1358's parity test enforces byte-identity. Sounit-pureis red on this PR until the org copy is updated, which is the correct order: confining the failure here rather than to every other open PR. The org-side copy goes live for every dataset import the moment it merges there.Test plan
bun test backend/test/import-capture-workflow.test.ts: 22 pass (13 before)|| truefrom the three greps fails 6; removing prepare'smsg=""fails 2bun run typecheckclean, Biome clean