Skip to content

fix(review-pr): defer approval on fork PRs until CI passes - #1406

Closed
worktrunk-bot wants to merge 1 commit into
mainfrom
hourly/review-22847633269
Closed

worktrunk-bot wants to merge 1 commit into
mainfrom
hourly/review-22847633269

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Summary

  • Detect cross-repository (fork) PRs in the verdict step and defer approval until after CI passes
  • Add a note about dismiss 404s on fork PRs in the CI monitoring step
  • When CI passes on a fork PR, approve at that point (instead of approving before CI)

Context

In run 22847633269 reviewing #1404 (a fork PR), the bot approved commit c9bdb36, then CI failed (cargo fmt). The bot tried to dismiss its approval but got HTTP 404 — GitHub doesn't expose the dismiss endpoint for cross-repository PRs. This left a stale approval contradicting red CI until the author pushed a fix.

The fix reverses the order for fork PRs: review with COMMENT first, wait for CI, then approve only if CI passes.

Fixes #1405

🤖 Generated with Claude Code

GitHub's dismiss API returns 404 on cross-repository PRs, so the bot
cannot undo an approval if CI fails. This left stale approvals
contradicting red CI on fork PRs (observed in run 22847633269 on #1404).

The fix defers approval to after CI passes for fork PRs, eliminating the
stale-approval window entirely.

Fixes #1405

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@max-sixty

Copy link
Copy Markdown
Owner

are you sure? we can't dismiss approvals on fork PRs?!

@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

Good catch questioning this — I was wrong. Dismissing approvals on fork PRs works fine. The actual root cause was the wrong HTTP method: gh api defaults to POST when called with -f flags, but the dismiss endpoint requires PUT.

I found this while investigating the earlier run on the same fork PR (22845135867), where the bot tried both methods back-to-back — POST returned 404, PUT succeeded. I posted the correction on #1405.

#1407 (adding -X PUT to the dismiss instruction) is already merged and is the correct fix. This PR's deferred-approval approach is unnecessary — I'd suggest closing it.

@max-sixty max-sixty closed this Mar 9, 2026
@max-sixty
max-sixty deleted the hourly/review-22847633269 branch June 18, 2026 06:00
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.

review-pr: cannot dismiss approval on fork PRs, leaving stale approval when CI fails

2 participants