feat: update an open PR with its target branch (u) #121
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/118-update-pr"
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?
Summary
uon an open PR you can write to opens a small dialog: merge the latest target branch in, or rebase onto it. GitHub offers merge only. Confirming updates the PR on the forge, the status bar saysUpdated #N (merge)/Updated #N (rebase)or shows the forge's reason, and the PR's row refreshes its head and CI. Works in the PR box, its details, and ★ Renovate PR rows.Refs #118
Changes
BranchUpdatercapability (UpdateStyles,UpdateBranch),ActUpdateBranchgated on write access like merge; Fake and shared contract cases.POST /repos/{o}/{r}/pulls/{n}/update?style=merge|rebase.PUT /repos/{o}/{r}/pulls/{n}/update-branch, merge only; any other style fails as unsupported without a request.Service.UpdateBranchruns the update, re-fetches the PR into the cache (drops it if no longer open); a refresh failure after a successful update is reported as such.ukey, update dialog (reuses the existing dialog,j/kpick,y/enterconfirm,esccancel);uis off where the forge advertises no styles, on non-PR rows, and without write access.u; architecture.md records the capability and API mapping.Decisions
u updateis last in the action hints soo openstays visible at 120 columns;uis always in?help.u, matching approve and close.ror the 5-minute timer).Test plan
Cangating), gitea and github (update_test.gowith recorded handlers), core (update_branch_test.go), ui (update_branch_test.go,update_branch_edges_test.go); every new test mutation-checked by its writer.make build,go test -race ./...all packages pass,golangci-lint run0 issues,golangci-lint fmt --diffclean, Windowsgo vetclean.shellcheckisn't installed locally; this MR touches no shell, CI covers it.udisabled when no styles are advertised); test-quality PASS; comments PASS after one round.🤖 Generated with Claude Code
https://claude.ai/code/session_011V1QHxdTA8cs6mwLNYyVNf
Gitea posts the style to pulls/{n}/update and offers merge and rebase. GitHub puts update-branch and offers merge only; any other style returns ErrUnsupported without a request. Refs #118 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011V1QHxdTA8cs6mwLNYyVNf