Skip to content

feat(review): adopt pre-created hosted review check and eyes reaction - #311

Open
factory-andrew-yang wants to merge 1 commit into
devfrom
andrew/adopt-review-ack
Open

factory-andrew-yang wants to merge 1 commit into
devfrom
andrew/adopt-review-ack

Conversation

@factory-andrew-yang

Copy link
Copy Markdown
Contributor

Problem

Hosted code review automations experience cold-start dead air while a fresh Droid Computer is provisioned and droid-action boots. Posting an immediate queued Check Run and 👀 reaction from the backend webhook handler would otherwise create duplicate Check Runs (and leave 👀 orphaned when createForIssue returns HTTP 200 instead of 201 or when a hosted run skips early).

Fix

  • src/github/operations/review-checks.ts: Add adoptReviewCheck (gated on FACTORY_AUTOMATION=true) to find and update an existing open check run matching check_name and external_id (${GITHUB_RUN_ID}:${GITHUB_RUN_ATTEMPT}) in place instead of creating a second Check Run.
  • src/github/operations/review-lifecycle.ts:
    • Attempt check adoption before handling run.skipReason so skipped hosted runs settle any pre-created queued check rather than leaving it stuck.
    • Accept HTTP 200 in createEyes when FACTORY_AUTOMATION=true so droid-action takes ownership of a pre-created 👀 reaction and cleans it up in finishReviewLifecycle.

Verification

  • bun test test/github/review-lifecycle.test.ts (120 pass, 0 fail)
  • bun run typecheck (pass)
  • bun run format:check (pass)

When running in a hosted automation (FACTORY_AUTOMATION=true), adopt an
existing open check matching the run's external_id and accept an HTTP 200
eyes reaction so the backend can post an immediate queued ack before the
review environment finishes cold-starting without leaving duplicate checks
or orphaned reactions.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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