Repository navigation
fix(#450): push before CI deploy, bounded validation poll (#431) - #451
Conversation
Reorder importOpenNeuro so the initial git push to nemarDatasets runs BEFORE addCi(): the GitHub Contents API requires the target branch to exist, and on a freshly created empty repo commitFilesAsTree(repo, "main", ...) 404s on the branch lookup. CI deployment was therefore failing on every fresh import, and the subsequent defensive git pull --rebase origin main then aborted the import with "couldn't find remote ref main" — leaving S3 data uploaded but the git history never landing on the dataset repo. Also drop the pre-push pull entirely (the initial push to a fresh repo has nothing to rebase against) and replace the unconditional skip_ci_check=true at approval time (#431) with a bounded 120s poll on getUserCiStatus; --trust-upstream opts in to the legacy fast-path for OpenNeuro imports (pre-validated upstream). Onboarding workflow template updated to pass --trust-upstream. Closes #450 Refs #431
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR451Version: 🤖 Updated on each push. |
Three review findings addressed:
1. waitForBidsValidationRun no longer swallows poll errors. Returns a
discriminated union {found, timeout, error} so the caller can tell
'never saw a run' from 'every poll attempt threw' and not silently
approve a never-validated publication under --trust-upstream.
2. addCi failure is now fatal. --trust-upstream bypasses the validation
lookup, not the deployment of validation/enrichment/archive workflows
themselves — missing workflows mean no future safety net.
3. pushToGitHub warning (main pushed but git-annex branch failed) is now
a hard fail for OpenNeuro imports. A published dataset whose
git-annex branch is missing cannot be cloned.
Refactor: extract decideSkipCiCheck as a pure function. 7 real tests
cover the reachable matrix of (ciDeployed, poll outcome, trustUpstream).
Workflow YAML comment updated to match the new --trust-upstream scope.
Refs #450 #431
Review findings addressed (e412eb7)Thanks for the catches. Fixed all three high-confidence issues and added the test-coverage agent's suggested pure-helper refactor.
Bonus refactor (per test-coverage analysis): extracted Workflow YAML comment updated to reflect the tighter Reviews summary:
|
Summary
importOpenNeuroso the initial git push tonemarDatasetshappens beforeaddCi(). The GitHub Contents API requires the target branch to exist;commitFilesAsTree(repo, "main", ...)404s on a brand-new empty repo. CI deploy was failing on every fresh import, and the defensivegit pull --rebase origin mainthat followed then exit-1'd withcouldn't find remote ref main— leaving S3 data uploaded but git history never landing on the dataset repo.skip_ci_check=trueat approval (OpenNeuro import: replace skipCiCheck=true with bounded poll on workflow_runs #431) with a bounded 120s poll ongetUserCiStatus;--trust-upstreamopts in to the legacy fast-path for OpenNeuro imports (pre-validated upstream)..github/dataset-workflows/onboard-openneuro.yml) updated to pass--trust-upstream.Context
Run https://github.com/nemarDatasets/.github/actions/runs/25769577607 failed all 30 jobs with this exact failure mode. See #450 for full root-cause analysis. 28/30 hit the empty-remote pull bug; 2/30 (ds003800, ds007315) hit a separate annex-uuid idempotency issue that needs its own follow-up.
Test plan
bun run buildcleanbunx tsc --noEmitcleanbunx biome checkcleandev(4 pre-existing failures; new P1 issue filed)--trust-upstreamflag surfaces innemar admin import-openneuro --helponboard-openneuro.ymlfor the 28 broken datasets once the fix is on npm; importer is idempotent on already-uploaded S3 data so re-runs should be cheap.After merge
nemarDatasets/.github/workflows/onboard-openneuro.ymlto add--local --trust-upstream(currently only--local).Closes #450
Refs #431