Skip to content

Fix BIDS CI failures from annex pointers and branch naming - #271

Merged
neuromechanist merged 2 commits into
devfrom
fix/266-267-ci-fixes
Mar 10, 2026
Merged

neuromechanist merged 2 commits into
devfrom
fix/266-267-ci-fixes

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • Build passes
  • Existing tests pass (no regressions)
  • Deploy updated workflow to a dataset with annexed files (e.g., nm000108) and verify CI passes
  • Test OpenNeuro import with a dataset that uses master branch

Closes #266
Closes #267

- Filter out validation errors from git-annex pointer files in
  the BIDS validation workflow (#267). Detects both symlinks
  (locked repos) and pointer content (unlocked repos), excludes
  their errors from the failure count.

- Rename non-main branches to main after OpenNeuro clone (#266).
  Prevents the import flow from pushing to master while CI
  workflows are deployed on main.

Closes #266
Closes #267
@github-actions

github-actions Bot commented Mar 9, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR271

Version: 0.7.16-PR271.20c316b
Commit: 20c316b


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 7955870 into dev Mar 10, 2026
8 checks passed
@neuromechanist
neuromechanist deleted the fix/266-267-ci-fixes branch March 10, 2026 01:53
neuromechanist added a commit that referenced this pull request May 11, 2026
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.
neuromechanist added a commit that referenced this pull request May 11, 2026
* fix: three publication regressions (#429)

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.

* fix: address PR review findings on #430

- 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.

* fix(auth): direct github_username dup check before GitHub validation

#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.

This branch was previously deployed

1 inactive deployment
npm — 20c316be Deployed Mar 9, 2026 by neuromechanist via publish #458
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.

1 participant