PR composer: From/To labels instead of base/head, cross-repo selection, dropdown fields (no free-form refs) #328
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#328
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What's requested
On the pull-request composer (
/:owner/:name/pulls/new):Current state (code evidence)
web/src/pages/PullNew.jsx— two free-formRefSelectinputs (SSE-streamed ref autocomplete, :33) bound togetBase/getHead(:189-190,?base=/?head=params prefill). Labels say "base ref"/"head ref"; the preview and compare copy says "Base and head" throughout (:113-148).OpenInputcarriesFork *ForkInfo("cross-fork head: fork repo holding head_ref",internal/pulls/service.go:304-310), and the PR doc model hasEndpoint{Repo, Ref}on both sides plusFork{Repo}(internal/pulls/model.go:78-101).OpenPRrequires write on the base repo only (:326-328) and read access on the head source — so the server is ready; the composer just never sends a fork.ctx.repoClient.refStream("branches", …),PullNew.jsx:40-41) — a repo selector per side needs to feed each picker from its chosen repo's ref stream (SDKrepoClientis constructed per repo; the page may need a second client instance for the From side).Proposed design
head_ref/base_ref) unchanged — this is labels and mental-model only (law 12: wire keys never change meaning). Also update?base=/?head=param labels in the UI if surfaced; the params themselves stay for link compatibility (branch pages deep-link with them).owners/{owner}/reposlisting filtered by the user's permission, or the owner's repos plus the viewer's forks — source selection is the implementer's call; simplest correct v1: default current repo, dropdown of the viewer's accessible repos).ForkInfopath exists, so selecting a fork feedsfork.repoon submit.RefSelectSSE picker, re-keyed per repo choice). Same-repo default keeps today's behavior one click deep.commits?ref=— cross-repo previews need the head-side commits fetched from the fork's client. SamecompareHistorieslogic; note the reachability rule: OpenPR publishesrefs/pull/<num>/headonly when the head commit is reachable — cross-fork heads are the designed case, but the UI should surface a clear error when the fork head is unreachable rather than a generic 422.Acceptance criteria
Forkinfo is correct and the PR page renders it.?base=/?head=deep links still prefill).head_ref/base_refand?base=/?head=unchanged; headless test for the label/direction mapping and the repo+ref state machine (repo choice → ref stream re-key).Opened PR #336 (fix/issue-328) for review — From/To composer + cross-repo repo/ref dropdowns, fork on submit, per-side preview errors, inline unreachable-head message, headless tests green (641/641 non-smoke), vite build green. Browser proof still open (shared-daemon loopback guard). Not merging.
REVIEW PR #336 (fix/issue-328, commit
e32445a+ review fixup82cc730) — verified in scratch worktree /tmp/pr336 (removed after), main untouched.ACCEPTANCE CRITERIA (issue #328, all 7):
LAWS: law 1 deps ✓, law 8 seams ✓ (pr-composer.js imports only compare.js; no upward imports), law 12 wire frozen ✓. Cross-owner out of scope is documented in code + doc decision — acceptable v1 (no listing endpoint serves cross-owner repos).
FIX APPLIED (pushed
82cc730to origin/fix/issue-328): the one UI-visible leftover — Pull.jsx:718 'head ref pending — push first' → 'From branch pending — push first' (this is exactly the line cross-fork users land on), plus the adjacent 'base ref' policy comment → 'base branch', lib comment updated to match, and a new pin test covering Pull.jsx rendered copy.NITS (non-blocking, left alone): fmtEndpoint's 3rd param is named currentFull but the caller passes the To repo — display-correct (cross iff From≠To). Mergeability small text still reads 'base X @ / head Y @ ' — pre-existing lowercase, out of scope.
VERIFY: pr-composer.test.js 15/15 ✓; full node --test web/test/unit/*.test.js 645/645, 0 fail ✓; vite build green ✓ (chunk-size warning pre-existing); grep: zero 'base ref'/'head ref' UI leftovers (only an unrelated 'HEAD ref' code comment in activity.js).
NO BROWSER (explicit): node tests + reasoning only, per review instructions; real-browser pass (composer, PR page, /setup, both themes, zero console errors) remains open as the author noted.
MERGE RECOMMENDATION: ready to merge (pending the standard real-browser pass).
Fixed by PR #336 (review clean + one leftover-copy fix by reviewer; wire frozen, cross-repo open, permission filters verified; 645/645), merged. Closing.