Skip to content

feat(ci): add central run-generate-archive workflow - #10

Merged
neuromechanist merged 3 commits into
mainfrom
9-add-central-run-generate-archive-workflow
May 23, 2026
Merged

neuromechanist merged 3 commits into
mainfrom
9-add-central-run-generate-archive-workflow

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Closes #9. Phase 3 of nemarOrg/nemar-cli#601, sibling to #5 (run-enrichment) and #8 (run-version-doi).

What

New .github/workflows/run-generate-archive.yml — central archive-generation workflow. Lifts the per-repo generate-archive.yml that previously shipped to every dataset repo. Already repository_dispatch[generate-archive]-driven, so this is the lowest-friction phase: the Worker's triggerArchiveGeneration just retargets its POST URL from the dataset repo to nemarDatasets/.github (handled in nemarOrg/nemar-cli#609).

  • Validates dataset_id shape and rejects a leading v on version (S3 key is v<bare>).
  • Mints a per-repo App token scoped to client_payload.dataset_id, checks out the target dataset repo at v<VERSION>.
  • Same streaming archiver + @aws-sdk/lib-storage multipart upload as the legacy template — disk usage stays constant regardless of dataset size.
  • permissions: {} at the job level.
  • workflow_dispatch with dataset_id + version inputs for manual recovery.

Test plan

After merge:

gh workflow run run-generate-archive.yml --repo nemarDatasets/.github \
  -f dataset_id=nm099999 -f version=0.0.0-rc2
gh run watch
aws s3 ls s3://nemar/nm099999/archives/

Expect green; archive at s3://nemar/nm099999/archives/v0.0.0-rc2.zip.

Closes #9. Phase 3 of nemarOrg/nemar-cli#601. Sibling to #5 (run-enrichment) and #8 (run-version-doi). Lifts the per-repo generate-archive.yml template — already repository_dispatch-driven so the Worker just retargets the dispatch URL.
@neuromechanist neuromechanist linked an issue May 23, 2026 that may be closed by this pull request
Phase 3 centralizes generate-archive on .github. The trigger-archive job in run-version-doi.yml previously dispatched against the dataset repo (where the legacy per-repo workflow listened). Update to dispatch against nemarDatasets/.github with the same client_payload, and re-mint the App token with repositories:.github so the dispatch call has actions:write on the right repo. The central run-generate-archive workflow mints its own per-dataset token internally for the checkout step.
Code-review findings: 1) npm install violated the project's no-npm policy (CLAUDE.md). Switch to bun via oven-sh/setup-bun@v2 — bun installs CommonJS packages correctly, and NODE_PATH pointed at the resulting node_modules lets the Node 20 streaming script still run unchanged. 2) When skipped > 0 (annexed files missing from S3), the script was logging a warning and exiting 0, so a partial zip silently became the downloadable artifact. Set process.exitCode = 1 in that branch so the Actions run goes red and the operator is forced to investigate. The S3 upload is already finalized at that point, so the partial artifact is on S3 either way; the red mark is the operator signal, not a rollback.
@neuromechanist
neuromechanist merged commit a3a2480 into main May 23, 2026
@neuromechanist
neuromechanist deleted the 9-add-central-run-generate-archive-workflow branch May 23, 2026 16:06
neuromechanist added a commit to nemarOrg/nemar-cli that referenced this pull request May 23, 2026
….github

Closes #608. Phase 3 of epic #601.

Removes the per-repo .github/workflows/generate-archive.yml that shipped to 123 dataset repos via deployWorkflows() and replaces it with a retarget of the existing triggerArchiveGeneration helper:

- triggerArchiveGeneration() now dispatches against CENTRAL_WORKFLOW_REPO (nemarDatasets/.github) instead of the dataset repo. The legacy repo parameter is preserved in the signature for callsite stability (CLI + admin endpoints still pass the dataset repo name); it's logged for traceability but no longer addresses the dispatch target.

- The generateArchive template string and its entry in getWorkflowTemplates() are removed.

- workflow-yaml.test.ts updated: the archiver-pin test collapses to a single negative assertion (template absence), generate-archive.yml removed from the read-only-templates list since it ships with no template anymore.

- scripts/strip-per-repo-workflow.ts's WORKFLOW_ISSUE_MAP gains a generate-archive.yml entry so default-anchor selection works on the Phase 3 invocation.

- New test test/trigger-archive.test.ts (5 cases) — mirrors trigger-enrichment + trigger-version-doi. Asserts the dispatch retargets to .github, client_payload shape is unchanged (dataset_id/version/public), non-2xx throws, and the legacy repo parameter is tolerated when divergent from dataset_id.

Pairs with nemarDatasets/.github#10 which lands the central run-generate-archive workflow AND retargets run-version-doi's trigger-archive job's dispatch to .github.
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.

Add central run-generate-archive workflow

1 participant