Skip to content

fix: plan a draft PR when it's marked ready for review - #2751

Open
dannysauer wants to merge 1 commit into
diggerhq:developfrom
neverendingsupport:fix/dannys/ready-for-review-upstream
Open

dannysauer wants to merge 1 commit into
diggerhq:developfrom
neverendingsupport:fix/dannys/ready-for-review-upstream

Conversation

@dannysauer

Copy link
Copy Markdown
Contributor

Summary

Fixes #2291. With allow_draft_prs: false, pushes to a draft PR are skipped, and the ready_for_review event that follows was ignored. Marking a draft ready planned nothing until another push or a digger plan comment.

The backend now handles ready_for_review like a push when draft PRs are disabled. When they're enabled, the draft's pushes were already planned, so it ignores the event.

This builds on #2294 by @MrKeiKun, which first proposed handling ready_for_review. Thank you for that. This version differs in three ways:

If this lands, #2294 can be closed.

Notes for reviewers

  • Locks: with pr_locks, marking a PR ready takes the locks that converting it to draft released.
  • Backendless mode: the guard lives in the shared job conversion, so a workflow that subscribes to ready_for_review follows the same allow_draft_prs rule.
  • Who the plan runs as: the user who clicked "Ready for review", as with reopened or a digger plan comment.

Testing

  • A new test in libs/ci/github checks that ready_for_review produces exactly the jobs synchronize does.
  • backend/controllers tests pass.
  • The docs for draft PRs, allow_draft_prs and on_pull_request_pushed are updated.

We run this on our self-hosted backend: marking a draft ready now plans it.

We reviewed it with Claude Code and then with Codex before opening.

With allow_draft_prs false, pushes to a draft are skipped, and the
ready_for_review event that follows was ignored, so nothing planned the
PR until another push or a "digger plan" comment. Handle
ready_for_review like a push when draft PRs are disabled. When they're
enabled, the draft's pushes were already planned, so ignore it.

This builds on diggerhq#2294 by @MrKeiKun, which first proposed handling
ready_for_review, and differs in three ways:
- It ignores ready_for_review when allow_draft_prs is true, so a draft
  that was already planned isn't planned again.
- It reuses the existing pull request job path instead of copying it,
  so new job fields can't drift between the two.
- It leaves out diggerhq#2294's change to closed events. Develop has handled
  branches deleted after merge since diggerhq#2312.

The guard lives in the shared job conversion, so the CLI's backendless
mode follows the same rule for a workflow that subscribes to
ready_for_review. The backend also returns early, before impacted-project
detection, so an ignored event doesn't touch the PR's checks.

Fixes diggerhq#2291

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

github draft pr conversion to "ready for review" is ignored

1 participant