Report and steer resolution of PR conflicts with the base branch #67
No reviewers
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck!67
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/issue-63-base-conflicts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes: #63
bridge/git-tools/base-conflict.ts:checkBaseConflict(fetch +git merge-tree --write-tree --name-only, no worktree/index/HEAD changes) andrebaseInstruction.git_push: after a successful push toorigin, finds the open same-repo PR for the branch and reportsbaseConflict/baseConflictCheckError(never fails the push). Non-ff rejection now points atgit_rebaseinstead of "needs a human".forgejo_create_pr: appends a WARNING +baseConflictFileswhen the new PR conflicts; check failures are appended as a note.forgejo_read_pr: when Forgejo saysmergeable: no, lists the conflicting files (viarefs/pull/<n>/head).Verification:
bun test apps/server/src/bridge/git-tools/ apps/server/src/forgejo/(all pass, incl. newbase-conflict.test.ts),bun run typecheckclean. The manual end-to-end check against this Forgejo instance (deliberately conflicting branch) was not run.@ -261,3 +266,3 @@`Reviewer: @${reviewer} · Verdict: ${verdict}${found}`,...catchUp,"Task: read the whole review and its line comments with forgejo_list_pr_comments_and_reviews. Address the feedback: change the code, commit, push. Reply in every line-comment thread of this review with forgejo_create_pr_thread_comment, naming what changed and the commit sha, or why you did not change it. Post one forgejo_create_pr_comment only if the review body itself has feedback, answering it. If the verdict is approved and there is no feedback, do nothing: no comment, no push.",`Task: read the whole review and its line comments with forgejo_list_pr_comments_and_reviews. Address the feedback: change the code, commit, push. Then check the PR is not in conflict with ${pr?.base?.ref ?? "its base"} (forgejo_read_pr lists conflicting files; git_push reports them); if it is, rebase onto origin/${pr?.base?.ref ?? "<base>"} with git_rebase and git_push force_after_rebase:true. Reply in every line-comment thread of this review with forgejo_create_pr_thread_comment, naming what changed and the commit sha, or why you did not change it. Post one forgejo_create_pr_comment only if the review body itself has feedback, answering it. If the verdict is approved and there is no feedback, post no comment; push only if you had to resolve conflicts with the base.`,So the agent is supposed to run
git_pushjust to check of there are conflicts? The entire idea is to fix conflicts before they create any lasting effect, like needing to force-push. So the idea would be to ensure there are no conflicts before pushing.Agreed. Fixed in
afc4b3a: both prompts now tell the agent togit_fetchand thengit_rebase action:"start" onto:"origin/<base>"before every push. Conflicts get resolved locally, and a force-push is only needed when the rebase rewrites commits that were already pushed. Thegit_push/forgejo_create_prreports stay as a safety net, and the prompts now describe them that way. For an approved review with no feedback, the agent checksforgejo_read_prand pushes only if it had to resolve conflicts with the base.