Skip to content

version-doi: poll for async publish completion (#751) - #50

Merged
neuromechanist merged 1 commit into
mainfrom
fix/issue-751-version-doi-poll
Jun 16, 2026
Merged

neuromechanist merged 1 commit into
mainfrom
fix/issue-751-version-doi-poll

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

Companion to nemarOrg/nemar-cli#758 (epic nemarOrg/nemar-cli#749, Phase 2 / #751).

Rewrites the "Publish version DOI" step of run-version-doi.yml. Instead of one curl --max-time 60 POST (which timed out deterministically for high-file-count datasets), it:

  1. Enqueues POST /webhooks/publish-version-doi (fast; --max-time 30, 3 attempts, 4xx terminal). Handles all three server responses:
    • 202 {accepted:true} — central async flow → poll for completion.
    • 200 {version_doi} — legacy synchronous flow (prod before the central-flow flip) → done, no poll.
    • 200 {skipped:true} — no concept DOI / non-semver → skip.
  2. On 202, polls GET /webhooks/version-doi-status with capped exponential backoff (5s→30s), bounded well inside the 15-min job cap, until the manifest_jobs row reaches ready (published) or failed.

trigger-archive / trigger-records keep needs: publish-doi, so they only fire once the version is truly published.

DO NOT MERGE until the Worker is live on prod

The poll hits GET /webhooks/version-doi-status, which only exists once nemarOrg/nemar-cli#758 is deployed to prod. Merging earlier would 404 the poll. Draft until then.

Test plan

  • YAML validates (yaml.safe_load).
  • Backward compatible: handles the legacy 200 synchronous response, so it is safe to merge before the prod MANIFEST_VIA_CENTRAL_WORKFLOW flip.

Enqueue /webhooks/publish-version-doi (202 central / 200 legacy), then poll
/webhooks/version-doi-status with capped exponential backoff until ready/failed,
bounded by the 15-min job cap. Replaces the single 60s synchronous curl that
timed out deterministically for high-file-count datasets (on005385 3265 files,
on005752 11000 files). Handles legacy synchronous 200 + skipped short-circuits.
@neuromechanist
neuromechanist marked this pull request as ready for review June 16, 2026 14:15
@neuromechanist
neuromechanist merged commit 2a613f0 into main Jun 16, 2026
@neuromechanist
neuromechanist deleted the fix/issue-751-version-doi-poll branch June 16, 2026 14:15
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