Skip to content

Publish request: --wait for BIDS validation, and say a pending refusal is recorded - #1652

Closed
bruAristimunha wants to merge 1 commit into
nemarOrg:feature/issue-1671-epic-bru-upload-fixesfrom
bruAristimunha:feature/issue-1646-publish-request-wait
Closed

bruAristimunha wants to merge 1 commit into
nemarOrg:feature/issue-1671-epic-bru-upload-fixesfrom
bruAristimunha:feature/issue-1646-publish-request-wait

Conversation

@bruAristimunha

@bruAristimunha bruAristimunha commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem

#1646: right after an upload, nemar dataset publish request is refused with bids_validation_pending or bids_validation_in_progress. The backend records the request as blocked and the daily sweep (#428) clears it once CI passes, but the CLI printed only "re-request publication" and exited 1, so scripted uploads wrapped the command in their own retry loops.

Change

  • Without --wait, a CI-pending refusal says the request is recorded and re-checked automatically once validation passes, and names --wait and nemar dataset ci <id>. Exit code stays 1.
  • --wait [minutes] (default 30, max 24 h) re-requests every 60 s while, and only while, CI has not concluded, and succeeds when the request is accepted. A validation failure or any other refusal is reported at once.
  • Re-requesting updates the one blocked row server-side (publication.ts); admins are emailed only on acceptance, so the loop does not spam them.

No backend change.

Closes #1646

Testing

  • test/publish-request-wait.test.ts (new, 9 tests): only the two CI-not-concluded reasons count; --wait parsing (absent, bare, numeric; garbage is an error); retries while pending then returns the accepted request; a validation failure is thrown at once; gives up after the wait with the last refusal; and through the CLI, the hint on a CI-pending refusal and a bad --wait refused before any request.

  • 5 files that import the changed modules: 79 pass, 0 fail (on current dev).

  • bun run typecheck, biome check on the changed files.

  • CI api-test and integration-dev fail on this PR because it comes from a fork: both call the dev API with the TEST_*_API_KEY secrets, which GitHub does not pass to fork pull requests, so the authenticated cases fail and the unauthenticated ones pass. lint, unit-pure and e2e-sandbox run normally.

Right after an upload, 'nemar dataset publish request' is refused with
block_reason bids_validation_pending ('BIDS validation has not run yet') or
bids_validation_in_progress. The request IS recorded as blocked and a daily
sweep clears it once CI is green, but the CLI exited 1 with only
're-request publication', so scripted uploads (the iEEG campaign lanes)
wrapped the command in their own retry loops.

- Without --wait: a CI-pending refusal says the request is recorded and
  re-checked automatically, and names '--wait' and 'nemar dataset ci <id>'.
- --wait [minutes] (default 30, max 24 h) re-requests every minute while,
  and only while, CI has not concluded; a validation failure or any other
  refusal is reported at once. Re-requesting updates the one blocked row
  server-side; admins are notified only when the request is accepted.
@neuromechanist
neuromechanist changed the base branch from dev to feature/issue-1671-epic-bru-upload-fixes October 7, 2026 22:06
@neuromechanist

Copy link
Copy Markdown
Contributor

Thank you for this change and for the clear write-up of the problem in #1646. It is merged into the integration branch for epic #1671 as PR #1678, with your commit kept (b420d4c on that branch, authored by you). The design changed in review, so this PR is closed in favor of that one.

What changed: the server already records a CI-pending request and a sweep continues it, so the client-side --wait loop was replaced by treating a CI-pending refusal as a pending state. It exits 0 with an explanation, the user checks validation with nemar dataset ci, and the upload output now says to request publication once validation has passed. Your detection of the two pending block reasons and your hint helper are kept. The review also found that the pending path skipped the submission minimums and, for anonymous requests, the blind check, so the request route and the sweep now run one shared gate, and an outage during the readiness check now answers 503 instead of reading as pending.

The epic merges into dev as a unit once 0.10.15 has shipped. The full review record is on #1678.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants