Repository navigation
Implement complete DOI publication workflow - #87
Conversation
Add missing steps to publication orchestrator: - update_metadata: Embed DOI in dataset_description.json - update_readme: Add DOI badge to README.md - create_tag: Create git tag from Version field - create_release: Create GitHub release with archive - upload_to_zenodo: Upload release archive to Zenodo - publish_doi: Publish DOI (permanent) Add GitHub helper functions: - createTag(): Create annotated git tags - createRelease(): Create GitHub releases - downloadReleaseArchive(): Download release archives Ensures DOI is embedded in dataset before archiving, preventing data loss if GitHub/S3 fails. Closes #86
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR87Version: 🤖 Updated on each push. |
- Add PublicationStep union type for compile-time step name safety - Replace dynamic imports with static imports in all 6 new steps - Remove duplicate GITHUB_API/ORG_NAME constants from admin.ts - Add getMainBranchSha() to github.ts service layer - Extract helpers: readDatasetDescription, getConceptDoi, getZenodoConfig, getVersionTag - Make updateProgress resilient (catches its own DB errors) - Add console.error logging with full error objects in all catch blocks - Fix publish_doi: separate DB update try/catch after irreversible publish - Fail on missing Version field instead of silently defaulting to 1.0.0 - Add idempotency: handle 422 in createTag and createRelease for re-runs - Add NaN check for parseInt of zenodo_concept_id - Add JSON.parse safety with descriptive error messages - Add content-type and size validation to downloadReleaseArchive - Fix JSDoc: downloadReleaseArchive uses repo archive endpoint not releases API - Add @throws annotations to new github.ts functions
Code Review SummaryRan 6 review agents in parallel (code reviewer, silent failure hunter, code simplifier, comment analyzer, test coverage analyzer, type design analyzer). Here is a summary of findings and the fixes applied in commit de877a0. Critical Issues Found and Fixed
High-Priority Issues Found and Fixed
Code Simplification
JSDoc/Comment Fixes
Type Safety
Not Addressed (out of scope for this PR)
TypeScript verification[x] |
Summary
Implements the complete DOI publication workflow as described in #86. The orchestrator now performs all steps needed to properly publish DOIs to Zenodo with dataset archives.
Changes
New Orchestrator Steps
Added 6 missing steps between
doi_createands3_lock:dataset_description.jsonwith pre-reserved DOIREADME.mdNew GitHub Functions
createTag()- Create annotated git tagscreateRelease()- Create GitHub releases from tagsdownloadReleaseArchive()- Download GitHub-generated release archivesComplete Workflow
Why This Matters
The pre-reserved DOI workflow ensures data integrity:
Critical: The DOI must be embedded in dataset files BEFORE creating the archive. This ensures the archived dataset contains its own DOI, preventing data loss if GitHub/S3 fails.
Testing Plan
Related Issues
Closes #86