Skip to content

Phase 3: centralize generate-archive workflow - #609

Merged
neuromechanist merged 2 commits into
feature/issue-601-epic-centralize-workflowsfrom
feature/issue-608-phase3-generate-archive
May 23, 2026
Merged

neuromechanist merged 2 commits into
feature/issue-601-epic-centralize-workflowsfrom
feature/issue-608-phase3-generate-archive

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Closes #608. Phase 3 of epic #601.

Summary

Move the per-repo .github/workflows/generate-archive.yml (123 dataset repos) into a single shared workflow on nemarDatasets/.github. The legacy template was already repository_dispatch-driven, so this is the lowest-friction phase — just a retarget of the dispatch URL inside triggerArchiveGeneration.

Pairs with nemarDatasets/.github#10 which lands the central workflow AND retargets the trigger-archive job in run-version-doi.yml (Phase 2) so the v→DOI→archive chain continues to work after centralization.

Changes

  • backend/src/services/github.ts
    • triggerArchiveGeneration now POSTs to ${CENTRAL_WORKFLOW_REPO}/dispatches (i.e. nemarDatasets/.github) instead of the dataset repo. Legacy repo parameter preserved in the signature (CLI/admin callers still pass it), now logged for traceability rather than addressing the dispatch target.
    • The generateArchive template string and its entry in getWorkflowTemplates() are removed. New dataset imports no longer ship the legacy file.
  • scripts/strip-per-repo-workflow.ts — WORKFLOW_ISSUE_MAP gains generate-archive.yml: '608' so the default invocation anchors back to this PR.
  • test/trigger-archive.test.ts (new, 5 cases) — fake-GitHub fixture asserts the dispatch retargets to .github, client_payload shape is unchanged, non-2xx throws, and the legacy repo parameter is tolerated when divergent.
  • test/workflow-yaml.test.ts — the archiver-pin test collapses to a single negative assertion (template absence); read-only-templates list drops generate-archive.yml.

Cutover

  1. feat(ci): add central run-generate-archive workflow nemarDatasets/.github#10 lands — central workflow available AND run-version-doi's trigger-archive job retargets to .github at the same time.
  2. This PR merges to epic branch → epic → dev → main → Worker deploys. New triggerArchiveGeneration calls hit .github.
  3. bun run scripts/strip-per-repo-workflow.ts --workflow generate-archive.yml — operator sweeps the legacy file from all 123 dataset repos.
  4. Verify: trigger a tag push on nm099999 (full DOI + archive chain); expect one run-version-doi run + one run-generate-archive run on .github, no per-repo runs.

Test plan

  • bun run lint clean
  • bun run typecheck clean
  • 72/72 unit tests pass on touched files
  • bun run scripts/strip-per-repo-workflow.ts --workflow generate-archive.yml --dry-run nm000132 smoke-tested
  • After deploy + datalad install #10 merge: gh workflow run run-generate-archive.yml --repo nemarDatasets/.github -f dataset_id=nm099999 -f version=0.0.0-rc2 produces a green run
  • Synthetic triggerArchiveGeneration from a test endpoint or the CLI should dispatch to .github, not the dataset repo (verified by gh run list --repo nemarDatasets/.github --workflow run-generate-archive.yml)

….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.
@github-actions

github-actions Bot commented May 23, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR609

Version: 0.8.33-PR609.a65ceac
Commit: a65ceac


🤖 Updated on each push.

Code-review findings (docs-only): 1) docs/operations/access-policies.md listed generate-archive.yml under per-dataset workflows shipped via getWorkflowTemplates() — stale after Phase 3. Replaces with a new entry for the central run-generate-archive.yml on nemarDatasets/.github. 2) docs/guides/github-app-setup.md justified the Actions:Read & write permission with 'dataset-repo CI can dispatch generate-archive' — incorrect after Phase 3 since the dispatch flows Worker → .github (or central workflow → .github). Updated to reference the cross-workflow dispatch pattern on .github.
@neuromechanist
neuromechanist merged commit 3f7ad2f into feature/issue-601-epic-centralize-workflows May 23, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feature/issue-608-phase3-generate-archive branch May 23, 2026 16:07
@neuromechanist neuromechanist mentioned this pull request Nov 27, 2026
5 tasks done

This branch was previously deployed

1 inactive deployment
npm — a65ceac9 Deployed May 23, 2026 by neuromechanist via publish #1134
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.

1 participant