Skip to content

Fix three publication regressions: archiver export, idempotent DOI badge commit, OpenNeuro skip-ci #429

Closed

Description

@neuromechanist

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

Companion issues

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions