Skip to content

Implement complete DOI publication workflow with Zenodo archive #86

Closed

Description

@neuromechanist

Implement Complete DOI Publication Workflow

Problem

The current nemar admin publish approve orchestrator creates a pre-reserved concept DOI but does NOT complete the critical steps to publish it to Zenodo. This creates an incomplete workflow where:

  1. DOI is pre-reserved from Zenodo ✅
  2. DOI is stored in database ✅
  3. But DOI is never included in the dataset files ❌
  4. Git tag is never created ❌
  5. GitHub release is never created ❌
  6. Release zip is never uploaded to Zenodo ❌
  7. DOI is never published ❌

Why This Matters

The pre-reserved DOI workflow is critical for data integrity:

  1. Pre-reserve DOI from Zenodo
  2. Update dataset_description.json with the DOI (ensures DOI is in the archival copy)
  3. Update README.md with the DOI
  4. Commit changes to git
  5. Create git tag (e.g., v1.0.0)
  6. Push tag (triggers GitHub release)
  7. Download GitHub release zip (contains complete dataset with DOI)
  8. Upload zip to Zenodo (attach dataset to DOI)
  9. Publish DOI (permanent - no going back!)

Critical: The DOI must be embedded in the dataset files BEFORE creating the archive. This ensures the archived dataset contains its own DOI, preventing data loss if GitHub/S3 fails.

Reference Implementation

The workflow is documented in EMG-2-BIDS/nemar/DATASET_REVISION_WORKFLOW.md which describes a register_zenodo_doi.py script that implements this complete workflow.

Current Orchestrator Steps

const allSteps = [
  "ci_check",        // ✅ Verify BIDS validation
  "repo_public",     // ✅ Make GitHub repo public
  "tag_protect",     // ✅ Protect version tags
  "doi_create",      // ⚠️  Only pre-reserves DOI, doesn't publish
  "s3_lock",         // ✅ Enable S3 object lock
  "notify_user",     // ✅ Send email notification
];

Required New Steps

Add these steps to the orchestrator:

const allSteps = [
  "ci_check",
  "repo_public",
  "tag_protect",
  "doi_create",           // Pre-reserve DOI
  "update_metadata",      // NEW: Update dataset_description.json with DOI
  "update_readme",        // NEW: Update README.md with DOI
  "create_tag",           // NEW: Commit + create git tag
  "create_release",       // NEW: Create GitHub release (includes zip)
  "upload_to_zenodo",     // NEW: Download release zip + upload to Zenodo
  "publish_doi",          // NEW: Publish the DOI (permanent!)
  "s3_lock",
  "notify_user",
];

Implementation Checklist

  • Add step: Update dataset_description.json with DOI
    • Clone dataset repo locally (or use GitHub API)
    • Parse existing JSON
    • Update DatasetDOI field
    • Commit change
  • Add step: Update README.md with DOI
    • Parse README
    • Add/update DOI badge
    • Commit change
  • Add step: Create git tag
    • Tag format: v{version} (e.g., v1.0.0)
    • Push tag to GitHub
  • Add step: Create GitHub release
    • Use gh release create or GitHub API
    • Release automatically generates source zip
  • Add step: Upload to Zenodo
    • Download GitHub release zip via API
    • Upload to Zenodo deposition
    • Verify upload checksum
  • Add step: Publish DOI
    • Call Zenodo publish endpoint
    • Verify DOI is live
    • Update database with published status
  • Handle errors/rollback
    • If upload fails, keep DOI draft
    • If publish fails, deposition stays editable
    • Document manual recovery steps

Testing

Test with sandbox dataset (xx-prefix) using --sandbox flag:

# Create draft with all steps
nemar admin publish approve xx000001 --sandbox

# Verify:
# 1. dataset_description.json has DOI
# 2. README.md has DOI badge
# 3. Git tag exists
# 4. GitHub release exists with zip
# 5. Zenodo deposition has uploaded file
# 6. DOI is published and resolvable

References

Priority

Critical - Without this workflow, DOIs are created but never published, and datasets are not properly archived to Zenodo. This defeats the purpose of DOI registration.

Activity

  1. added
    enhancement
    on Jan 28, 2026
  2. added 2 commits that reference this issue on Jan 29, 2026
    032706e
    8d6a7a3
  3. neuromechanist commented on Jan 30, 2026

    @neuromechanist
    ContributorAuthor

    Addressed in #87

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions