Skip to content

Phase 3: Cut over orchestrator + webhooks to GitHub App auth (#432) #438

Closed

Description

@neuromechanist

Scope

Replace direct `env.GITHUB_ADMIN_PAT` reads in the orchestrator and webhook handlers with `getDefaultGitHubAuth(env)` from Phase 2. PAT path remains as fallback for graceful dev behavior.

Targets

  • `backend/src/routes/admin.ts` — orchestrator step harness, `POST /admin/publish/:id/approve`.
  • `backend/src/routes/webhooks.ts` — `workflow_run`, `llm-enrich`, `publish-version-doi` handlers.
  • `backend/src/services/github.ts` — `githubFetchWithRetry` signature accepts a token source instead of a raw string. Internal token resolve cached per-request to avoid mint-per-call.

Acceptance

  • e2e-test (`nemar admin e2e-test --verbose`) passes on dev with App auth.
  • A full publication orchestrator run on a test dataset (`nm099999`) completes end-to-end on dev using App auth.
  • Rate-limit logs (`github-rl` tag) show the new App bucket's `remaining` value (different from the user bucket's cadence).
  • Existing tests still pass with PAT fallback (dev env without App secrets configured).

Part of epic #432. Depends on Phase 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    infrastructure

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions