Skip to content

Import workflow failure reporters abort instead of posting the named fallback (live) #1364

Closed

Description

@neuromechanist

Found by the release review of main...dev. This is live in production now: the local copy of .github/dataset-workflows/onboard-openneuro.yml is byte-identical to nemarDatasets/.github@main (91bebcc0, merged today), so the deployed workflow has this defect.

The mechanism

GitHub's default shell for a run: step is bash -e {0}, and the reporters add set -o pipefail. All three then do:

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

When the tee'd log contains no ✖, grep exits 1, pipefail promotes that to the pipeline's status, and -e kills the step at that assignment. Verified with the real snippet against a real log shape:

bash -e         stdout: "A: entered reporter / C: else branch, about to grep"   exit 1
bash (no -e)    stdout: "... F: would POST: prepare failed with no CLI failure line captured"   exit 0

So #1351's stated decision — "An empty extraction becomes a named fallback, never an empty error_message" — does not hold in the deployed shell. Nothing is posted, and the report job's terminal: … roll-up lands instead: exactly the pre-change behavior, for precisely the failure modes the fallback was written for (OOM, runner eviction, a failure in an earlier step so the log does not exist, cancellation).

Independently, prepare is the only reporter missing msg="", so even without -e it dies with msg: unbound variable at its [ -z "$msg" ] test. Also reproduced.

Affected lines

.github/dataset-workflows/onboard-openneuro.yml: :153,179 (prepare), :280,284 (copy), :366,370 (finalize).

Fix

  1. … | cut -d: -f1 || true) on all three greps (or bracket them with set +o pipefail / set -o pipefail).
  2. Add msg="" to the prepare reporter, matching the other two.
  3. Make the invariant test execute the reporter rather than assert its text. backend/test/import-capture-workflow.test.ts currently does expect(workflow()).toContain(fallback), which passes over dead code — that is why this shipped. Running the extracted snippet under bash -e with a log containing no ✖ and asserting the fallback string reaches stdout is what would have caught it.

Landing constraint: these must go together

.github/dataset-workflows/onboard-openneuro.yml is deployed by hand-copying it into nemarDatasets/.github, and #1358's new parity test (plus its CI sparse checkout) enforces byte-identity. So:

  • Changing it here alone turns unit-pure red on every PR until the org copy is updated.
  • nemarDatasets/.github runs main directly, so the org-side copy goes live the moment it merges, for every dataset import.

Land the pair in one sitting, and expect the first import after that to be the smoke test.

Not a release blocker

The failure mode degrades to the pre-existing stage roll-up rather than corrupting anything, so this does not need to hold v0.10.3. It does need to be fixed before anyone relies on the fallback being there.

Activity

  1. neuromechanist commented on Sep 16, 2026

    @neuromechanist
    ContributorAuthor

    Fixed by PR #1366, and verified live rather than assumed: .github/dataset-workflows/onboard-openneuro.yml on dev hashes to 1c549b80, and nemarDatasets/.github's deployed workflows/onboard-openneuro.yml is the same blob. The fixed reporters are what the ~785 dataset repositories actually run.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions