Repository navigation
Description
Sub-task of #601. Phase 3 of the centralization epic.
Scope
Move generate-archive.yml from the per-repo deployWorkflows() set to a single shared workflow on nemarDatasets/.github. The workflow is already repository_dispatch-driven, so this is the lowest-friction phase — no Worker push-handler changes, just a retarget of the dispatch URL.
Deliverables
1. Central workflow — nemarDatasets/.github/.github/workflows/run-generate-archive.yml
Lifts the existing per-repo generate-archive.yml template body.
- Trigger:
repository_dispatch[generate-archive]+workflow_dispatch(manual recovery withdataset_id+versioninputs). - Validates
dataset_idshape againstnm|on|xx + 6 digits(mirrors Phase 1/2 guards). - Mints per-repo App token scoped to
client_payload.dataset_id. - Checks out the target dataset repo at the version tag (
v$VERSION). Required because git-annex pointer resolution needs the dataset's tree. - Same npm install + archiver streaming script as the legacy template, same AWS upload.
permissions: {}at the job level (defense-in-depth, matches Phases 1/2).
2. Worker — triggerArchiveGeneration retarget
Currently in backend/src/services/github.ts:2179 the helper dispatches against ${ORG_NAME}/${repo} (i.e. the dataset repo itself, where the per-repo workflow listens). Change to target ${CENTRAL_WORKFLOW_REPO} instead and put dataset_id in the payload alongside the existing version + public fields.
3. Strip per-repo template
In backend/src/services/github.ts:
- Delete the
generateArchivetemplate string. - Remove
.github/workflows/generate-archive.ymlfromgetWorkflowTemplates(). - Update
test/workflow-yaml.test.tsto drop generate-archive-specific assertions (the archiver-pin test).
4. Update run-version-doi.yml (Phase 2 sibling)
The Phase 2 run-version-doi.yml ends with a trigger-archive job that dispatches event_type=generate-archive against repos/nemarDatasets/$DATASET_ID/dispatches. Retarget to nemarDatasets/.github/dispatches with client_payload.dataset_id added.
5. One-time cleanup
bun run scripts/strip-per-repo-workflow.ts --workflow generate-archive.yml once the central workflow lands and the dispatch is redirected. Add generate-archive.yml: '<issue-number>' to the script's WORKFLOW_ISSUE_MAP.
6. Tests
- New:
test/trigger-archive.test.ts— fake-GitHub fixture asserts the outbound dispatch now targetsnemarDatasets/.githubwithevent_type=generate-archiveandclient_payload.dataset_id. - Update existing tests that referenced
generate-archive.ymlin the per-repo template set.
Ship order
- (nemarDatasets/.github PR) Central workflow lands.
- (this PR) Worker retarget + template strip + run-version-doi.yml update.
- Strip script removes per-repo
generate-archive.ymlfrom all 123 dataset repos. - Verify: trigger a tag push on
nm099999(re-runs the full DOI + archive chain); expect one central run-version-doi run + one central run-generate-archive run, no per-repo runs.
Out of scope
- PR-triggered workflows (Phase 4).
- Final cleanup (Phase 5).
Activity
feat(centralize): retarget triggerArchiveGeneration to nemarDatasets/…