fix: regenerate PR title and body when updating existing pull request#1520
Closed
zerone0x wants to merge 1 commit intopingdotgg:mainfrom
Closed
fix: regenerate PR title and body when updating existing pull request#1520zerone0x wants to merge 1 commit intopingdotgg:mainfrom
zerone0x wants to merge 1 commit intopingdotgg:mainfrom
Conversation
When a user pushes new commits to a branch that already has an open PR, the PR title and body are now regenerated from the current diffs and the existing PR is updated via `gh pr edit`. Previously the stale title/body from the original PR creation was returned unchanged. Fixes pingdotgg#1487 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Author
|
Closing duplicate — already addressed in #1519. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runPrStepinGitManagernow regenerates the PR title and body from the current diffs instead of returning the stale original titleeditPullRequestmethod toGitHubCliShapeservice (usinggh pr edit) to update existing PRseditPullRequestcall before returningRoot cause
In
runPrStep, whenfindOpenPrfound an existing open PR for the current branch, the code returned early withstatus: "opened_existing"and the original PR title — without regenerating content from the latest diffs. This meant subsequent pushes to the same branch never refreshed the PR metadata.Changes
apps/server/src/git/Services/GitHubCli.ts— AddededitPullRequestto the service interfaceapps/server/src/git/Layers/GitHubCli.ts— ImplementededitPullRequestusinggh pr editapps/server/src/git/Layers/GitManager.ts— RestructuredrunPrStepto always generate fresh PR content from current diffs, and calleditPullRequestwhen an open PR already existsTest plan
Fixes #1487
🤖 Generated with Claude Code
Note
Medium Risk
Changes PR orchestration to edit existing GitHub PRs via
gh pr edit, which affects a user-facing workflow and depends on external CLI behavior and temp-file handling.Overview
runPrStepnow always regenerates pull request title/body from the current commit/diff range, even when an open PR already exists for the branch.When an existing open PR is found, it updates that PR in-place via a new
GitHubCli.editPullRequest(implemented withgh pr edit --title/--body-file) instead of returning the stale original title, while still cleaning up the generated temp body file in both edit and create paths.Written by Cursor Bugbot for commit c62c862. This will update automatically on new commits. Configure here.
Note
Regenerate and update PR title and body when an existing pull request is found
Previously,
runPrStepreturned early with the existing PR's title and body unchanged when a matching open PR was found. Now it generates new PR content and callsgh pr editto update the existing PR's title and body.editPullRequesttoGitHubCliShapeand implements it inmakeGitHubCliusinggh pr edit <number> --title --body-file.makeGitManager.runPrStepto resolve the base branch before searching for an existing PR, so that path is no longer skipped.runPrStep.Macroscope summarized c62c862.