Skip to content

Phase 5 (E): dispatch generate-records on publish + records-ready callback - #42

Merged
neuromechanist merged 3 commits into
mainfrom
fix/issue-742-records-dispatch-callback
Jun 11, 2026
Merged

neuromechanist merged 3 commits into
mainfrom
fix/issue-742-records-dispatch-callback

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

Phase 5 (E) of epic nemarOrg/nemar-cli#736, the .github half. records.json (neuroschema per-recording descriptor, #615) 404'd for every dataset because generate-records.yml was fully built (emit -> validate -> Tier-2 biosigIO duration patch -> S3 upload) but nothing dispatched it on publish and it had no records-ready callback.

  • run-version-doi.yml: add a trigger-records job — a sibling of the existing trigger-archive job (needs: publish-doi, .github-scoped App token, repository_dispatch generate-records with dataset_id+version). This is the change that makes records.json exist for every publish. Independent job so a records-dispatch failure doesn't block the archive dispatch.
  • generate-records.yml: add a records-ready callback (success + best-effort failure) POSTing to api.nemar.org/webhooks/records-ready with X-Webhook-Token. The success callback is intentionally best-effort (warn, don't fail the run) — unlike archive-ready's strict callback — because records.json is served from S3 directly, so the callback is observability-only; this also avoids reddening generation during this epic's rollout window before the nemarOrg/nemar-cli /webhooks/records-ready endpoint reaches prod. Also fixed the stale header + upload-block comments (they claimed the upload was an unwired TODO skeleton).

Part of epic nemarOrg/nemar-cli#736 (sub-issue #742). The /webhooks/records-ready receiver + records_status column ship in the paired nemar-cli PR.

Test plan

Both workflow YAMLs validate (yaml.safe_load). The dispatch mirrors the proven trigger-archive job verbatim; the callback mirrors run-generate-archive.yml's archive-ready callback. Live: after merge, a real version publish (or a manual generate-records dispatch on nm099999) uploads s3://nemar/<id>/version/v<version>-records.json (served at data.nemar.org/<id>/<version>/records.json) and POSTs the records-ready callback; the callback is non-fatal until the Worker endpoint deploys at epic finalization.

@neuromechanist

Copy link
Copy Markdown
Member Author

Sonnet /review-pr addressed: trigger-records mirrors trigger-archive verbatim; success/failure callback guard logic confirmed correct (best-effort exit-0 keeps post-success.outcome='success' so the failure callback can't double-fire); YAML/security/parallelism sound. Fixed Issue 1 (Important): added a callback_url workflow_dispatch input + extended both CALLBACK_URL expressions to client_payload.callback_url || inputs.callback_url || <default>, matching run-generate-archive.yml so manual recovery runs can retarget the callback.

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