Skip to content

Release v0.6.1: DOI pipeline fixes, tag-triggered CI, BIDS Name titles - #171

Merged
neuromechanist merged 4 commits into
mainfrom
dev
Feb 20, 2026
Merged

neuromechanist merged 4 commits into
mainfrom
dev

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Release v0.6.1 consolidates DOI metadata pipeline improvements and multiple targeted fixes from dev.

DOI Metadata Pipeline (#163, #166)

  • Fix enrichment guard with source hash-based change detection
  • Drop Methods description from DataCite metadata
  • Fix refresh target URL to point to NEMAR page

Archive Generation (#165)

  • Fix archive generation for SHA-addressed S3 storage

Version DOI Target

  • Point version DOI target to NEMAR page, not GitHub release

Multi-fix PR (#170)

Manual Cleanup

  • Deleted 26 orphaned S3 dataset folders (no D1 records, no GitHub repos)

Test plan

  • bun test: 523 pass, 0 fail
  • CI: all checks green on dev
  • S3 bucket verified clean (only nm000103-nm000108 remain)
  • npm publish triggered automatically on merge to main

Closes #149, #155, #160, #163, #165, #166, #168, #169

* 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
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.
…itle, 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
@neuromechanist

Copy link
Copy Markdown
Contributor Author

PR Review Summary (v0.6.1 Release: dev -> main)

Reviewed by 5 specialized agents: code-reviewer, silent-failure-hunter, test-analyzer, comment-analyzer, code-simplifier.

Critical Issues (0 found)

No critical issues that must block merge. The findings below are all pre-existing patterns or acceptable design decisions for a release PR.

Important Issues (3 found, all pre-existing or deferred)

  1. D1/GitHub inconsistency in BIDS Name sync (webhooks.ts:662-677): If D1 update fails, GitHub repo description still updates, creating a data mismatch. The error is logged but not surfaced in the response. Acceptable for now: this is a best-effort sync, and D1 failures in Workers are extremely rare.

  2. Fragile batch index-based result access (deletion.ts:92-106): Adding user_s3_permissions DELETE pushed indices. The code is correct but fragile; a future reorder would silently report wrong counts. Deferred: destructuring batch results is a good future improvement but not a blocker.

  3. Version DOI workflow exits 0 on missing NEMAR_WEBHOOK_TOKEN (github.ts:~957): The workflow silently succeeds when the token is not configured. Should use ::warning:: annotation or exit 1. Deferred: all dataset repos inherit the org secret, so this only matters if the secret is rotated without updating org settings.

Suggestions (5 found)

  • Comment fix: datacite.ts:1357 -- "Skip URL" comment is misleading; it actually extracts the DOI and adds it via addRelatedId
  • Stale header: datacite.ts:306 -- Section references nemar_metadata.json (legacy v1 path) instead of .nemar/metadata.json (v2)
  • Orphaned field: methodsDescription in DataCiteEnrichment is populated but never consumed for DataCite XML output
  • Hash format note: webhooks.ts:710 -- Hash concatenation format (README + "\n---\n" + JSON) should note that changing format invalidates all existing hashes
  • Deletion batch comment: deletion.ts:90 -- Add inline order comment: // [0] versions, [1] pub_requests, [2] collaborators, [3] s3_perms, [4] datasets

Simplifications Applied (by code-simplifier)

  • Extracted classifyIdentifier() helper to eliminate duplicated DOI URL regex in bidsToDataCite()
  • Simplified normalizeIdentifierKey (removed unnecessary conditional)
  • Consolidated re-enrichment log messages with reason variable
  • Simplified ENOENT check in dataset.ts
  • Expanded long interface line in DeletionSteps for readability

Test Coverage Gaps (noted, not blocking)

  • Source hash enrichment guard + force bypass (integration-level, requires D1/GitHub)
  • BIDS Name sync to D1 and GitHub (integration-level)
  • Deletion cascade s3PermsDeleted response shape (existing tests check status codes only)

All gaps require integration testing with real infrastructure, consistent with the project's no-mock policy. These are tracked for future improvement.

Strengths

  • Excellent DOI normalization test coverage (200/200 tests pass)
  • Good deduplication tests across enrichment sources
  • Clean separation of concerns in version-doi workflow
  • S3 deletion simplification is more robust than the 3-prefix approach
  • No mocks anywhere in the test suite

Verdict: Ready to merge

All CI checks pass. No critical issues found. Important issues are pre-existing patterns or acceptable tradeoffs documented above.

@neuromechanist
neuromechanist merged commit 519f2af into main Feb 20, 2026
15 checks passed

This branch was previously deployed

1 inactive deployment
npm — 3f69526b Deployed Feb 20, 2026 by neuromechanist via publish #297
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.

Deletion cascade does not clean up user_s3_permissions

1 participant