Repository navigation
fix: three publication regressions (#429) - #430
Conversation
1. backend/src/services/github.ts: pin archiver to ^7.0.1 in the
Generate Archive workflow template. archiver 8.x is ESM-only and
require("archiver") no longer returns the factory function, causing
"archiver is not a function" on every newly published dataset.
2. backend/src/routes/admin.ts: skip the createOrUpdateFile call in
update_readme when the DOI badge is already present and the README
does not need renaming. Previously the orchestrator shipped an
empty "Add DOI badge: ..." commit on every --resume, which retriggered
BIDS Validation each time.
3. src/lib/import-openneuro.ts: restore skipCiCheck=true (4th arg of
approvePublication) in the import retry loop. PR #271 had flipped it
to false on the assumption that the BIDS check could complete in time,
but in practice the push + approve race always loses and imports
wind up in 'bids_validation_pending'. OpenNeuro datasets are
validated upstream and the CI runs separately after push regardless.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR430Version: 🤖 Updated on each push. |
- backend/src/services/doi.ts: extract planReadmeBadgeCommit() pure helper. Tightens the skip path to require that the existing badge encode the *current* concept DOI; without that check a stale badge (from re-registered or provider-migrated DOIs) would be silently kept. Detects mismatch and emits a "Replace stale DOI badge" commit. URL-encoded DOI form is recognized as a match (matches the actual badge URL encoding). - backend/src/routes/admin.ts: use planReadmeBadgeCommit() in update_readme. - test/readme-badge-plan.test.ts: unit tests covering skip, stale-badge rewrite, no-README, rename-needed, and encoded-DOI cases (6 cases). - test/workflow-yaml.test.ts: assert generate-archive.yml pins archiver@^7 to catch a future unpinned regression. - Trim verbose comments in github.ts and import-openneuro.ts per review. Follow-up #431 tracks the design improvement of replacing skipCiCheck=true with a bounded poll on workflow_runs.
Review findings addressed (commit 37e3428)
All 102 tests across the touched test files pass. |
#430 CI api-test failure root cause: validateGitHubUsername() ran before the dup check, so a signup attempt with an already-registered github_username that happens not to resolve on GitHub (renamed/deleted account, or test seed with a fake username) returned 400 instead of 409. Now we direct-check the raw input first (case-insensitive). The GitHub API call is retained for canonical-login dedup but only re-checks when GitHub normalized the case (the original motivation in #176 for doing validation first). Saves one REST call on the common already-registered case and unblocks api-test. Test "signup with existing github_username returns 409" in test/api.test.ts:124 is the assertion.
Red CI on `api-test` — root cause and fix (commit 133a53e)The failing assertion in `test/api.test.ts:136` ("signup with existing github_username returns 409") was an independent pre-existing bug in the signup flow, exposed by the test seed using `test-user-gh` (a fake GitHub username). Original order in `backend/src/routes/auth.ts`:
So step 3 returned 400 for the fake seed username before step 4 could fire the expected 409. Fix: direct dup check on the raw input before the GitHub API call (case-insensitive). Saves one REST call on the common already-registered case and works regardless of whether the registered username still resolves on GitHub (covers renamed/deleted accounts too). The original motivation in #176 (canonical-login dedup) is preserved by re-checking with the canonical form after validation, but only when GitHub normalized the case. Note on the chicken-and-egg`api-test` runs against the deployed dev backend (`nemar-api-dev.sccn-org.workers.dev`). It will keep failing on this PR's CI until the fix is deployed to dev — i.e., until this PR merges to dev and `deploy-backend.yml` ships. Per project convention this is acceptable: the api-test exposes a real bug in deployed dev that this PR fixes. Companion to
|
Summary
archiver@^7.0.1in the Generate Archive workflow template (v8 is ESM-only, regressedrequire("archiver")).skipCiCheck=truein the OpenNeuro import approve retry loop; flipped to false in Fix BIDS CI failures from annex pointers and branch naming #271 but the push/approve race always loses in practice.Closes #429.
Test plan
bun tsc --noEmitin repo root andbackend/— cleanbun test test/publish-workflow.test.ts test/ezid.test.ts test/admin-restructure.test.ts— 51/51 passbun test— 985 pass, 4 pre-existing fails unrelated to this PR (datalad-commands clone tests + upload-progress JSON parse warnings, none touch the changed code paths)npx cfman wrangler --account sccn deploy -c backend/wrangler-sccn.tomlafter current in-flight approvals finish (see Fix three publication regressions: archiver export, idempotent DOI badge commit, OpenNeuro skip-ci #429 deploy notes)nemar admin ci add <id>to refresh existing dataset workflows so the archiver pin propagates (one-shot follow-up; new approvals already publish to repos with the unpinned line)Discovered via
Triaging bruaristimunha's 20 stuck publication requests (May 2026). Companion issues #427 (duplicates) and #428 (stale block_reason).