Skip to content

[codex] feat(github): add commit status routes - #2

Merged
agustif merged 1 commit into
integration/upstream-candidates-20260624from
codex/feat-github-commit-statuses
Jun 24, 2026
Merged

[codex] feat(github): add commit status routes#2
agustif merged 1 commit into
integration/upstream-candidates-20260624from
codex/feat-github-commit-statuses

Conversation

@agustif

@agustif agustif commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Fork laboratory scope

This draft is for validation inside agustif/emulate. It targets the fork integration branch and is not an upstream vercel-labs/emulate pull request.

Problem

GitHub repository payloads advertise commit-status URLs, but the emulator has no commit-status entity or routes. Clients can exercise Checks APIs but cannot create status contexts or read status history and combined state.

Root cause

The GitHub store and route registry never modeled commit statuses. Repository deletion, webhook dispatch, ref resolution and documentation therefore had no status integration.

Change

  • Add typed repository-scoped commit-status storage.
  • Add status creation, current and legacy history routes, and the combined latest-per-context route.
  • Implement GitHub state precedence, reverse chronological history, pagination and the per-SHA/context limit.
  • Resolve branches, tags, commit prefixes and exact SHAs already accepted by the status API while retaining 404 for unknown refs.
  • Enforce repository access and write authorization.
  • Dispatch the repository status webhook and clean statuses during repository deletion.
  • Document the API in the root README, package README, GitHub skill and web documentation.

Validation

  • Filtered core and GitHub builds passed.
  • GitHub package tests passed: 4 files and 26 tests.
  • TypeScript typecheck passed.
  • ESLint passed with zero errors and only 19 existing warnings.
  • Prettier and git diff --check passed.

Promotion gate

Keep this PR in the fork until its tests and integration with the Checks SHA resolver are accepted. If Checks PR vercel-labs#184 lands first, recreate the final branch from current upstream main and reconcile the shared ref-resolution seam. Opening an upstream PR requires separate authorization.

@agustif
agustif marked this pull request as ready for review June 24, 2026 12:24
@agustif
agustif merged commit 214c71b into integration/upstream-candidates-20260624 Jun 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

const inserted = gh.commitStatuses.insert({
node_id: "",
repo_id: repo.id,
sha,
state,
description,
target_url: targetUrl,
context,
creator_id: actor.id,
} as Omit<GitHubCommitStatus, "id" | "created_at" | "updated_at">);

P2 Badge Honor commit statuses in required checks

When a repository has required_status_checks.contexts and a CI client uses this new endpoint to create a successful legacy status, merging the PR still fails because checkMergeRequirements in packages/@emulators/github/src/routes/pulls.ts:262-267 only scans gh.checkRuns and never consults gh.commitStatuses. That means the statuses persisted here cannot satisfy the existing branch-protection gate, so status-based workflows remain blocked despite a success status on the PR head SHA.


await webhooks.dispatch(
"status",
undefined,
webhookPayload(status, actor, gh, repo, baseUrl),
ownerLoginOf(gh, repo),
repo.name,
);

P2 Badge Do not block status creation on webhook delivery

When a repository has a slow or unreachable status webhook, this await makes POST /statuses/:sha wait for the dispatcher’s network delivery and 10-second timeout per matching hook before returning, unlike the other event-producing GitHub routes that fire webhook delivery in the background. This can make creating a status hang during experiments just because a webhook endpoint is down, even though the status has already been stored.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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