Repository navigation
feat(pm-dispatch): cross-repo grants + reusable Actions (starter/queuer) - #2676
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Part of #2672 (Parts 1 and 2; Part 3 call-site migration follows separately — do not close #2672 on merge).
Part 1 — Cross-repo grants (pm-stack/dispatch)
assertCallerRepoinsrc/auth.tsis now the grants mesh: every allowlisted repo may target every allowlisted repo; repos outside the allowlist can neither call (OIDC caller claim re-checked) nor be targeted; bearer callers remain bound only by the allowlist on the target. The grants rule is stated verbatim in the code comment.test/auth.test.ts): cross-repo allowed (openchamber token → opencode target), caller outside allowlist rejected, target outside allowlist rejected, same-repo still allowed, bearer unaffected by pairing (allowlisted target passes, non-allowlisted rejected).POST /v1/tasksgains optionalissue_number(positive integer, validated inparseTaskRequest/parseIssueNumberwithValidationError): no issue is created; the task uses the canonical dedupe key for that existing issue, enqueues, then attaches — the same agent-note comment format as the create path plusqueue/queued+source/dispatchlabels.issue_numbertakes precedence overissue. On dezren39/nix (no GitHub App installation) the attach is skipped with a warning in the maybeCreateIssue style, but the task still enqueues andissue_numberis still returned. The attach-path response also includesissue_url.Part 2 — Reusable composite actions
.github/actions/pm-dispatch-start— POST /v1/sessions; outputstask_id,session_id,issue_number,issue_url. Pure bash+curl+jq, OIDC audiencepm-dispatch, fails clearly when the caller job lackspermissions: id-token: write(documented in the description), token never printed..github/actions/pm-dispatch-queue— same plumbing over POST /v1/tasks withissue(default "true") and numericissue_number(jq--argjson); outputstask_id,issue_number,issue_url.pm-stack/dispatch/examples/dispatch-workflow.ymlnow uses both actions @main as the canonical example (raw-curl form noted as still working).issue_numberdocumented in the POST /v1/tasks section; new "GitHub Actions (reusable)" section. No other README sections restructured (concurrent nixos/pm-stack work untouched: nonixos/**, nopm-stack/scripts/**).Verification
bun testin pm-stack/dispatch: 34 pass, 0 fail (was 28).bun x tsc --noEmit: clean (afterbun install --frozen-lockfilein the worktree).Need help on this PR? Tag
@codesmith-botwith what you need.