Skip to content

Publication workflow: request/approve pipeline with resumable orchestration #68

Closed

Description

@neuromechanist

Problem

After upload, there's no process for users to request publication or for admins to approve it. The gap between "private dataset uploaded" and "public dataset with DOI" has no CLI support.

Proposed Command Tree

Admin Commands (new/restructured)

nemar admin s3
  regenerate-iam <user>          # Existing, moved from top-level
  lock <dataset>                 # Apply S3 Object Lock to tagged version (#56)

nemar admin ci
  check <dataset>                # Verify BIDS CI is present + passing
  add <dataset>                  # Add BIDS CI workflow to dataset repo

nemar admin repo
  public <dataset>               # Make dataset repo public on GitHub
  private <dataset>              # Make dataset repo private

nemar admin publish
  list                           # List pending publication requests
  approve <dataset> [--resume]   # Run full orchestration (or resume from failure)
  deny <dataset> --reason "..."  # Deny with feedback to user

User Commands (new)

nemar dataset publish
  request                        # Signal dataset is ready for publication
  status                         # Check publication pipeline status
  resend                         # Re-notify admin

State Machine (D1)

┌──────────┐    ┌───────────┐    ┌──────────────┐    ┌───────────┐
│  PRIVATE  │───▶│ REQUESTED │───▶│  APPROVING   │───▶│ PUBLISHED │
│           │    │           │    │ (in progress) │    │           │
└──────────┘    └───────────┘    └──────────────┘    └───────────┘
                      │                  │
                      ▼                  ▼
                 ┌──────────┐      (--resume from
                 │  DENIED  │       failed step)
                 └──────────┘

D1 table: publication_requests

  • dataset_id, status, requested_at, approved_at, denied_reason
  • steps_completed (JSON array for resume tracking)

Orchestration: nemar admin publish approve

Runs sub-commands in sequence, each tracked in D1:

Step 1: nemar admin ci check <id>       → Verify BIDS CI present + passing (add if missing)
Step 2: nemar admin repo public <id>    → Make repo public on GitHub
Step 3: nemar admin doi create <id>     → Concept DOI + v1.0.0 tag
Step 4: nemar admin s3 lock <id>        → S3 Object Lock on tagged annex keys
Step 5: Notify user (email)             → "Your dataset is public with DOI: ..."

Recovery options when a step fails:

  • nemar admin publish approve <id> --resume - skips completed steps, retries from failure
  • Or call the specific sub-command directly, then resume

Each sub-command is idempotent (safe to re-run).

BIDS CI Strategy

When: Added at upload time (not publish time)

Users get immediate BIDS validation feedback on PRs while iterating on their dataset. The publish step just verifies CI is present and passing.

How: GitHub Actions workflow using Bun

The BIDS validator is Deno-based but should run via bunx for fast cold starts:

# .github/workflows/bids-validate.yml
name: BIDS Validation
on: [push, pull_request]
jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: oven-sh/setup-bun@v2
      - run: bunx bids-validator .

If bunx doesn't work with the Deno-based validator, fallback to npx or direct Deno install. Key requirement: fast CI startup.

nemar admin ci check behavior:

  1. Check if .github/workflows/bids-validate.yml exists in repo
  2. If missing: add it (same as ci add)
  3. If present: check latest CI run status via GitHub API
  4. Return pass/fail/missing

Email Notifications

Event Recipient Content
publish request Admin "Dataset nm000151 requests publication"
publish approve (complete) User "Your dataset is now public with DOI: ..."
publish deny User "Publication denied: "
publish resend Admin Re-sends request notification

Migration: regenerate-iam

Move existing nemar admin regenerate-iam under nemar admin s3 regenerate-iam. Keep the old command as a hidden alias for backwards compatibility during transition.

Implementation Phases

Phase 1: Sub-commands

  • nemar admin ci add - generate and push BIDS CI workflow
  • nemar admin ci check - verify CI presence + status via GitHub API
  • nemar admin repo public/private - toggle repo visibility
  • Move regenerate-iam under nemar admin s3

Phase 2: Publication request flow

  • D1 schema for publication_requests table
  • nemar dataset publish request/status/resend
  • nemar admin publish list/deny
  • Email notifications (mechanism TBD: SES, Cloudflare Email Workers, etc.)

Phase 3: Orchestrator

Phase 4: Upload-time CI

  • Auto-add BIDS CI workflow during nemar dataset upload
  • Validate bunx/bun compatibility with Deno-based bids-validator

Related Issues

Open Questions

  1. Email mechanism: SES? Cloudflare Email Workers? Simple SMTP via existing infra?
  2. Re-request after deny: Should denied datasets be able to re-request? (Likely yes, after addressing feedback)
  3. bunx + bids-validator: Need to verify the Deno-based validator runs under bunx/bun. If not, use npx or deno directly in CI.
  4. CI added at upload vs first PR: Adding at upload means the initial commit triggers CI. Could be noisy if dataset isn't ready yet. Alternative: add on first PR only.

Activity

  1. added
    enhancement
    on Jan 23, 2026
  2. neuromechanist commented on Jan 24, 2026

    @neuromechanist
    ContributorAuthor

    Implemented in PRs #72, #74: admin restructuring (s3/ci/repo subgroups), publication request/approve pipeline with resumable orchestrator, email notifications.

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