Repository navigation
Description
Regressions found while triaging bruaristimunha's 20 stuck publication requests (May 2026)
Three independent bugs surfaced during the May 2026 backlog approval. Tracked in one issue because they were discovered together and have ~equal trivial fix sizes; will land in one PR.
1. Generate Archive: "archiver is not a function" (backend/src/services/github.ts:1125)
Workflow nm000122 run 25673931337:
```
Fatal: TypeError: archiver is not a function
at main (/tmp/stream-archive.js:77:17)
```
The workflow installs `archiver` with no version pin (`npm install --no-save archiver ...`). archiver 8.x (released after this code shipped) is ESM-only; `require("archiver")` no longer returns the factory function, so the inline streaming script throws on every newly-published dataset.
Fix: pin to `archiver@^7.0.1` in the workflow template.
2. "Add DOI badge" no-op commit on every approval resume (backend/src/routes/admin.ts:3370-3384)
The orchestrator's `update_readme` step correctly checks `hasBadge` before mutating the README in memory — but then unconditionally calls `createOrUpdateFile`. When the badge is already in place and no rename is needed, this ships an empty-diff commit titled `Add DOI badge: 10.82901/nemar.nmXXXXXX`. That commit re-triggers BIDS Validation pointlessly, and on `--resume` runs it stacks another such commit on top of the previous one.
Example: nm000122 has two `Add DOI badge` commits (2026-05-04 from the original stuck approval, 2026-05-11 from the resumed approval), even though the badge has been in README.md since May 4.
Fix: skip `createOrUpdateFile` entirely when `hasBadge && !isRename`.
3. OpenNeuro import always hits "bids_validation_pending" (src/lib/import-openneuro.ts:487)
The import pipeline pushes the dataset (which deploys CI workflows in the same commit batch) and then immediately calls `approvePublication`. The BIDS validation workflow has at most a few seconds to start before approval races it, so it consistently fails with `block_reason=bids_validation_pending`.
Original code (#215) passed `skipCiCheck=true` because the orchestrator is the wrong place to enforce a CI check that hasn't had a chance to run yet — OpenNeuro datasets are validated upstream and the workflow runs separately after push regardless. PR #271 ("Address PR review findings") flipped the flag to `false` with the comment "CI workflows are deployed before push, so checks should run" — but in practice the race is unavoidable from the import code path.
Fix: restore `skipCiCheck=true` (4th arg of `approvePublication`) in the import retry loop and replace the misleading comment with the actual rationale.
Deploy notes
- Fix Add proper test coverage measurement (90%+ target) #1 (workflow template) only affects newly deployed CI workflows. Existing dataset repos already have the unpinned line; deploy backend, then run `nemar admin ci add` (or wait for repo-touching events) to refresh them. Tracked separately.
- Fix Optimize KV usage to stay within free tier limits #2 (orchestrator) ships with the next Worker deploy. Hold off deploying until current in-flight approvals (Bru's batch, ~100 min) complete to avoid mid-flight orchestrator changes.
- Fix CLI shows success then failure on admin approve #3 (CLI) ships in the next `nemar-cli` npm release.
Companion issues
- Duplicate detection: publish-request list display + prevent duplicate dataset uploads #427 — duplicate publish-request rows + duplicate dataset upload detection
- Stale block_reason: publication requests never auto-clear when CI later passes #428 — stale `block_reason` never auto-clears when CI later passes
Activity
fix: three publication regressions (#429)
fix: three publication regressions (#429) (#430)