Skip to content

onboard-openneuro: reporters survive a log with no marker - #116

Merged
neuromechanist merged 1 commit into
mainfrom
fix/reporter-fallback
Sep 10, 2026
Merged

neuromechanist merged 1 commit into
mainfrom
fix/reporter-fallback

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Paired with nemarOrg/nemar-cli#1366, which fixes the same file in the repository it is authored in. This is the deployed copy; both must match, and nemar-cli's parity test enforces that.

What is broken today

Actions runs a run: step under bash -e {0}, and the three failure reporters add set -o pipefail. So when the tee'd CLI log holds no ✖:

line="$(grep -nF '✖' "$log" 2>/dev/null | tail -n 1 | cut -d: -f1)"

grep exits 1, pipefail promotes it to the pipeline's status, and -e kills the step at that assignment, before the named fallback three lines below. Nothing is posted to /webhooks/import-state, so the report job's terminal: prepare=failure copy=failure finalize=failure roll-up is what lands: the pre-change behavior, 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 was also the only reporter that never initialized msg, so under set -u it died at its own [ -z "$msg" ] test with msg: unbound variable.

The change

|| true on the three grep pipelines, and msg="" in prepare. Most of the changed lines are the comments explaining why, since a future reader would otherwise read || true as defensive noise and remove it.

Nothing else differs: this file was byte-identical to nemar-cli's copy before the change, and is byte-identical after it.

Verification

It cannot be verified from this repository, which is the reason the authoring copy lives next to its tests. In nemar-cli#1366 the reporters are extracted from this YAML and executed under bash -e (previously the fallback was only asserted as a string in the file, which is why this shipped): nine cases across the three stages covering no marker, a missing log, a real CLI failure line still winning, and prepare's upstream-inaccessible branch. Removing || true fails six of them.

The next failing import is the live smoke test: its tracking issue should name a real cause, or the named fallback, rather than the stage roll-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant