Commit bcabfb7
Unify PR creation codepaths for conflict/non-conflict syncs. (#20)
## Description
Unifies the conflict and non-conflict codepaths in both
`_sync_private_to_public` and `_sync_public_to_private`.
Previously, a cherry-pick conflict caused the code to branch into a
completely separate `_handle_cherry_pick_conflict` function that
duplicated much of the standard flow (description building, trailer
appending, push, PR creation). This made it easy for the two paths to
drift — most recently, conflict PRs were getting `[CONFLICT]` prepended
to their titles and losing their original PR descriptions.
Now both functions follow a single linear flow with `is_conflict`
conditionals at the points where behavior differs:
1. Cherry-pick → set `is_conflict`
2. Commit handling (raw conflict commit + resolution agent vs. amend)
3. Build PR description (shared, identical logic)
4. Append trailers (origin always; conflict trailer only if conflict)
5. Push + create PR
6. Post-creation conflict steps if needed (label, reviewer, comment,
slack)
Other changes:
- Conflict PRs no longer get `[CONFLICT]` prepended to their title.
- Conflict PRs now preserve the original description (source PR body or
agent-generated) instead of replacing it with a generic conflict
message.
- A comment is posted on conflict PRs noting the reviewer assignment,
rather than baking that info into the PR body.
- Added `GhOps.add_pr_comment()` method.
## Testing
All 251 existing tests pass. Verified via manual inspection of a
conflict sync PR (warpdotdev/warp-internal#24195).
Co-Authored-By: Oz <oz-agent@warp.dev>1 parent 46eaa04 commit bcabfb7
3 files changed
Lines changed: 246 additions & 147 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
250 | 264 | | |
251 | 265 | | |
252 | 266 | | |
| |||
0 commit comments