Repository navigation
Description
Motivation
Today we copy a fan-out of CI workflows into every dataset repo via getWorkflowTemplates() + syncWorkflowTemplates():
nemarDatasets/<dataset>/.github/workflows/
├── bids-validation.yml
├── generate-archive.yml ← repository_dispatch-driven
├── publish-version-doi.yml
├── pr-merge-handler.yml
├── version-doi-sync-trigger.yml
└── ... etc
Updating a single line in any of these requires syncWorkflowTemplates to fan-out a commit to N dataset repos. Today that's manageable; with 100+ datasets it's a maintenance tax for every CI tweak. It also means new datasets must run the deploy step before they can publish, instead of "exist + receive the App install = ready to go."
Companion issue: #556 (replacing the broken API-per-pointer manifest generation algorithm). That fix HAS to land somewhere with git available. Doing both at once removes the worker's manifest path entirely.
Proposal
Keep the existing repository_dispatch pattern from triggerArchiveGeneration — just point it at one central repo and have the workflow check out the target dataset at runtime instead of running inside it.
[Dataset repo: tag v1.0.0 pushed]
↓ (GH App "nemar-publish-bot" subscribed to push/tag events on the org)
[api.nemar.org/webhooks/dataset-release] ← worker, signature-validated
↓
[POST repos/nemarOrg/<central>/dispatches event_type=generate-manifest
client_payload: { dataset_id, version, ref }]
↓
[Central repo workflow on GitHub-managed runner:]
- actions/checkout@v4 with repo: nemarDatasets/${dataset_id} ref: v${version}
(uses an App installation token minted server-side, passed as secret)
- python emit_manifest.py ← logic from #556 lives in this script
- aws s3 cp manifest.json s3://nemar/${dataset_id}/version/v${version}.json
- curl POST api.nemar.org/webhooks/manifest-ready
↓
[Worker manifest-ready handler: insert dataset_versions row, mint DOI]
What changes
Central repo (e.g., nemarOrg/nemar-cli or new nemarOrg/dataset-workflows):
.github/workflows/generate-manifest.yml—repository_dispatch: types: [generate-manifest]. Checks outnemarDatasets/<id>@v<X.Y.Z>, runsscripts/emit_manifest.py, uploads to S3scripts/emit_manifest.py— the/tmp/manifest_recover.pyprototype validated today (Replace API-per-pointer manifest generation with git-clone tree walk (today's quota burn) #556 reference)- Same plumbing can host the existing
generate-archiveflow, retiring its per-repo copy
Backend worker (nemar-cli/backend):
- New
POST /webhooks/dataset-releasehandler — signed webhook receiver from the GH App on tag events - New
triggerManifestGeneration(dataset_id, version)mirroringtriggerArchiveGenerationbut pointing at the central repo generateManifest()removed (or shrunk to a fallback)getWorkflowTemplates()shrunk: droppublish-version-doi.yml,generate-archive.yml(caller side now lives centrally)POST /webhooks/manifest-readyhandler — central workflow callback that confirms upload + recordsdataset_versionsrow + mints DOI
Dataset repos (per-repo, one-time migration):
- Delete
publish-version-doi.yml,generate-archive.yml,version-doi-sync-trigger.ymlafter the central pipeline is verified end-to-end - Keep
bids-validation.yml(per-repo CI on push) and any other repo-local workflows - Net: each dataset repo's
.github/workflows/shrinks by ~3 files
GitHub App config:
- Subscribe to
pushevents (tag-filtered) orreleaseevents on installed org - Add a webhook URL pointing at
api.nemar.org/webhooks/dataset-release - App already has needed permissions (
contents:write,metadata:read)
Pros
- Logic changes = one PR to the central repo; instant rollout to all datasets
- Adding a new dataset requires zero workflow setup
- All publish logs visible in the central repo's Actions tab (sortable, searchable, retryable)
- No new infra beyond what GitHub already provides (managed runners, App webhooks)
- Replace API-per-pointer manifest generation with git-clone tree walk (today's quota burn) #556's algorithmic fix lands as a normal script change, not a fan-out
Cons / trade-offs
- One central repo's Actions log becomes high-traffic (every publish for every dataset). Mitigation: filter by
client_payload.dataset_idin the workflow run UI; runs auto-prune after 90 days anyway - App webhook is now critical-path for publishes — if signature validation breaks, no publishes work. Same risk class as today's webhook endpoint, just one more route
- Minting an App installation token per workflow run requires a small server-side step (worker generates an ephemeral token, attaches as input to the dispatch). Standard pattern, well-trodden
Migration order (suggested phasing for the executor)
- PR-1: build the central workflow +
emit_manifest.pyscript +triggerManifestGenerationin the worker. Wire thedataset-releasewebhook receiver but keep oldpublish-version-doi.ymlpath active. End-to-end test onnm099999(test dataset). - PR-2: dual-write phase — both the per-repo
publish-version-doi.ymlAND the centralized workflow fire for each publish, with the central one writing to amanifest_jobstable for verification. Compare manifests across the two paths for a week on real publishes. Resolve any divergence. - PR-3: cut over. Delete per-repo workflows via
syncWorkflowTemplates(it currently adds; teach it to remove). RemovegenerateManifestfrom worker. - PR-4: migrate
generate-archiveto the same central pattern (separate but identical refactor).
Open decision
Central repo location:
- (a)
nemarOrg/nemar-cli— bundled with the existing backend code. Pro: monorepo, single PR for backend + workflow change. Con: nemar-cli already does many things. - (b) New
nemarOrg/dataset-workflows— dedicated repo for centralized publish/archive workflows. Pro: clear separation of concerns. Con: another repo to maintain.
Recommend (a) for simpler ops; (b) only if nemar-cli's Actions tab gets too noisy.
References
- Existing pattern to copy:
backend/src/services/github.ts:triggerArchiveGeneration(lines ~2070-2099) + thegenerateArchiveworkflow string ingetWorkflowTemplates(line ~1098) - Algorithmic fix needed in
emit_manifest.py: Replace API-per-pointer manifest generation with git-clone tree walk (today's quota burn) #556 - Doctor framework + today's recovery context: feat(admin): doctor framework + missing-manifest check #555
- Original stuck-publish report: Stuck publish: ~33% of on* datasets have GitHub tag but no version row #529
- Working prototype script used to recover today:
/tmp/manifest_recover.py(not committed; valid blueprint for the central script)
Activity
Stream B: worker dispatch + manifest-ready callback (#557 PR-1)
Epic #559: Centralize manifest generation (PR-1 of #557 + #556 + #558) (
neuromechanist commentedon May 19, 2026
PR-1 landed in #563 (commit 8b2510d on dev). Behind feature flag
MANIFEST_VIA_CENTRAL_WORKFLOW(default false). Old per-repo workflow path stays active as fallback.Remaining phasing (to be opened as separate sub-issues when work starts):
publish-version-doi.ymlvia syncWorkflowTemplates (teach it to remove); remove worker fallbackgenerateManifest()generate-archiveto the same central patternOps sequence (BLOCKS flag flip):
NEMAR_APP_ID,NEMAR_APP_PRIVATE_KEY,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,MANIFEST_CALLBACK_SECRETonnemarOrg/nemar-clirepoMANIFEST_CALLBACK_SECRETas Workers secret on both prod + devnemar admin e2e-test --verboseagainst SCCN dev with flag=true to verifyKeep this issue open until PR-2/PR-3/PR-4 land. Then close.