Skip to content

Fix deletion cascade, test timeout, tag-triggered DOI CI, BIDS Name title, S3 cleanup - #170

Merged
neuromechanist merged 7 commits into
devfrom
fix/multi-fix-149-155-160-168
Feb 20, 2026
Merged

neuromechanist merged 7 commits into
devfrom
fix/multi-fix-149-155-160-168

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Five targeted fixes in a single branch:

Test plan

  • bun test passes (523 pass, 0 fail)
  • Deploy to dev Workers and verify:
    • Delete test dataset, confirm user_s3_permissions cleaned up
    • Push a v* tag on nm099999, verify version-doi.yml fires
    • Upload dataset without --name, verify BIDS Name is used as title
  • Manual S3 orphan cleanup of 26 leftover folders after deploy

Closes #149, #155, #160, #168, #169

Add 30s timeout to all CLI subprocess tests that spawn
bun processes for prerequisite checks.

Closes #155
Extract DOI minting from pr-merge.yml into a standalone
version-doi.yml workflow triggered on v* tag pushes. All
paths (PR merge, admin push, manual tag) now converge
through the tag trigger. Also creates GitHub release if
missing and triggers archive generation.

Closes #160
CLI upload now reads Name from dataset_description.json
instead of using directory basename. The LLM enrichment
webhook also syncs BIDS Name to D1 and GitHub repo
description when dataset_description.json changes.

Closes #168
Scan entire {datasetId}/ prefix instead of only objects/,
version/, archives/ sub-prefixes. Older uploads stored
files directly under the dataset root which were missed.

Closes #169
- Remove if: always() from trigger-archive job so it only
  runs when DOI publish succeeds
- Check setRepoDescription return value instead of relying
  on try/catch (function returns result, does not throw)
- Sanitize BIDS Name (strip newlines, trim to 200 chars)
- Track user_s3_permissions deletion count in DeletionSteps
- Distinguish ENOENT from parse errors in CLI BIDS Name read
- Fix JSDoc and comments per review feedback
@neuromechanist

Copy link
Copy Markdown
Contributor Author

PR Review Summary

Ran 5 review agents (code-reviewer, silent-failure-hunter, pr-test-analyzer, comment-analyzer, code-simplifier) in parallel. All findings addressed in commit 49e2eb8.

Critical Issues (2 found, both fixed)

  1. trigger-archive job used if: always() - would run archive generation even when DOI publish fails. Fixed: removed if: always(), now only runs on success.

    • backend/src/services/github.ts (version-doi workflow template)
  2. setRepoDescription return value ignored - function returns { ok, status, error } instead of throwing, so the try/catch never caught GitHub API failures (403/404/422). Fixed: check .ok explicitly, log HTTP errors.

    • backend/src/routes/webhooks.ts

Important Issues (4 found, all fixed)

  1. user_s3_permissions deletion count untracked - if s3_prefix format didn't match, zero rows deleted silently. Fixed: added s3PermsDeleted to DeletionSteps interface and result tracking.

    • backend/src/services/deletion.ts
  2. Empty catch in CLI BIDS Name reading - hid JSON parse errors and permission errors; user would get wrong dataset name with no warning. Fixed: distinguish ENOENT (expected) from other errors and warn user.

    • src/commands/dataset.ts
  3. BIDS Name unsanitized - no length/newline check before setting as GitHub repo description (350 char limit). Fixed: strip newlines, trim to 200 chars.

    • backend/src/routes/webhooks.ts
  4. Duplicate dataset_description.json reads - read once for BIDS Name, again for Authors. Fixed: consolidated to single read with shared bidsDescription variable.

    • src/commands/dataset.ts

Suggestions (addressed where quick)

  • Fixed JSDoc wording in deleteDatasetObjects ("legacy direct-path uploads" replaced with accurate defensive rationale)
  • Expanded workflow comment to mention both DOI and archive jobs
  • Added rationale comment explaining why BIDS Name sync lives in the llm-enrich webhook

Test Results

523 pass, 0 fail after all fixes.

@neuromechanist
neuromechanist merged commit 77bb7bc into dev Feb 20, 2026
7 checks passed
@neuromechanist
neuromechanist deleted the fix/multi-fix-149-155-160-168 branch February 20, 2026 20:55
neuromechanist added a commit that referenced this pull request Feb 20, 2026
* Fix archive generation for SHA-addressed S3 storage (#165)

* Fix archive generation for SHA-addressed S3 storage

Use annex key (SHA hash) for S3 URL instead of BIDS file path.
Replace process.exit(1) with process.exitCode for proper output flushing.

Fixes #164

* Fix upload error propagation and entry event race

* Point version DOI target to NEMAR page, not GitHub

Version DOIs were resolving to the GitHub release page. Both
concept and version DOIs should resolve to the NEMAR data
explorer with appropriate query params.

* Fix deletion cascade, test timeout, tag-triggered DOI CI, BIDS Name title, S3 cleanup (#170)

* Fix deletion cascade: clean up user_s3_permissions

Closes #149

* Fix flaky e2e-upload test timeout

Add 30s timeout to all CLI subprocess tests that spawn
bun processes for prerequisite checks.

Closes #155

* Add tag-triggered CI for version DOI

Extract DOI minting from pr-merge.yml into a standalone
version-doi.yml workflow triggered on v* tag pushes. All
paths (PR merge, admin push, manual tag) now converge
through the tag trigger. Also creates GitHub release if
missing and triggers archive generation.

Closes #160

* Use BIDS Name as authoritative dataset title

CLI upload now reads Name from dataset_description.json
instead of using directory basename. The LLM enrichment
webhook also syncs BIDS Name to D1 and GitHub repo
description when dataset_description.json changes.

Closes #168

* Fix S3 deletion to clean all objects under prefix

Scan entire {datasetId}/ prefix instead of only objects/,
version/, archives/ sub-prefixes. Older uploads stored
files directly under the dataset root which were missed.

Closes #169

* Address PR review findings

- Remove if: always() from trigger-archive job so it only
  runs when DOI publish succeeds
- Check setRepoDescription return value instead of relying
  on try/catch (function returns result, does not throw)
- Sanitize BIDS Name (strip newlines, trim to 200 chars)
- Track user_s3_permissions deletion count in DeletionSteps
- Distinguish ENOENT from parse errors in CLI BIDS Name read
- Fix JSDoc and comments per review feedback

* Fix biome formatting

* chore: bump version to 0.6.1
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