Skip to content

Make pdd checkup --pr rerun when PR head advances mid-checkup#1121

Open
prompt-driven-github[bot] wants to merge 1 commit into
mainfrom
change/issue-1116
Open

Make pdd checkup --pr rerun when PR head advances mid-checkup#1121
prompt-driven-github[bot] wants to merge 1 commit into
mainfrom
change/issue-1116

Conversation

@prompt-driven-github
Copy link
Copy Markdown
Contributor

Problem

pdd checkup --pr can still fail after completing the full checkup loop when the PR branch advances while the run is in progress and the generated local fix commit conflicts with the newer remote PR head.

Solution

Implemented a PR-head freshness lease for pdd checkup --pr:

  1. Capture the PR head SHA at the start of the PR-mode checkup.
  2. Verify freshness before Step 7 (Verification): Re-fetch the remote PR head and compare it with the starting SHA. If it has advanced, discard the stale worktree and rerun the full checkup from the new head.
  3. Verify freshness during final push: If the remote head has advanced, _commit_and_push_if_changed attempts a clean rebase.
    • If the rebase is successful, it reruns Step 7 on the new head.
    • If the rebase conflicts, it triggers a Full rerun of the checkup from the new head.
  4. Bounded Retries: Autonomous reruns are bounded to MAX_PR_HEAD_REFRESHES = 2.
  5. --no-fix Mode Support: Added similar freshness checks and rerun logic for --no-fix mode.
  6. Review Loop Support: Integrated the same freshness lease and rerun logic into the checkup_review_loop.

Fixes #1116

- Capture PR head SHA at start of PR-mode checkup.
- Before Step 7 and final push, re-fetch remote PR head and compare.
- If head advanced and local fix can rebase cleanly, keep rebased path and rerun verifier.
- If rebase conflicts or head advanced before fix, discard stale worktree and rerun full checkup (bounded to 2 reruns).
- Implement PRHeadAdvancedError and retry logic in agentic_checkup_orchestrator.py and checkup_review_loop.py.
- Update prompts to support the new rebase_conflicted and pr_head_refreshes_count fields.
- Update README and CHANGELOG with the new behavior.

Issue: #1116
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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.

Make pdd checkup --pr rerun when PR head advances mid-checkup

1 participant