Skip to content

worker: add POST /extract and GET /status routes - #38

Merged
MekDrop merged 1 commit into
mainfrom
feat/issue-15-extract-status
Apr 23, 2026
Merged

MekDrop merged 1 commit into
mainfrom
feat/issue-15-extract-status

Conversation

@MekDrop

@MekDrop MekDrop commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds POST /extract route that validates required fields, generates a runId, fires orchestration in the background via ctx.waitUntil, and returns { runId, runUrl } immediately
  • Adds GET /status route that proxies GitHub Actions run status for a given runId query parameter
  • Adds CORS preflight (OPTIONS) handlers for both routes
  • Includes a stub actionsOrchestrator.js (throws not yet implemented) so the build passes — replaced by the real implementation when PR Worker: GitHub Actions orchestrator (dispatch + poll + cleanup) #14 is merged

Merge order

This PR must be merged AFTER the PR for issue #14 (feat/issue-14-orchestrator). The stub in worker/src/services/actionsOrchestrator.js will be replaced by PR #14's implementation at merge time.

Test plan

  • npm -w worker run build passes (dry-run)
  • npm -w worker run lint passes
  • POST /extract with all required fields returns { runId, runUrl }
  • POST /extract with missing fields returns 400 with list of missing fields
  • POST /extract with invalid JSON returns 400
  • OPTIONS /extract returns 204 with correct CORS headers
  • GET /status?runId=<id> returns { status, conclusion, runUrl } from GitHub
  • GET /status without runId returns 400
  • OPTIONS /status returns 204 with correct CORS headers

Closes #15

Implements issue #15. Adds handleExtract (POST /extract, OPTIONS /extract)
with CORS, JSON validation, and fire-and-forget orchestration via ctx.waitUntil,
and handleStatus (GET /status, OPTIONS /status) that proxies GitHub Actions run
status. Includes actionsOrchestrator stub (real impl in PR #14).
@MekDrop
MekDrop force-pushed the feat/issue-15-extract-status branch from 4e2ccd3 to db1c0ed Compare April 23, 2026 21:03
@MekDrop
MekDrop merged commit 0413aa6 into main Apr 23, 2026
1 check passed
@MekDrop
MekDrop deleted the feat/issue-15-extract-status branch April 23, 2026 21:10
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.

Worker: POST /extract and GET /status routes

1 participant