detached a79212e

fix(mr): refresh live-event goldens and guard shared issue numbers

commit
a79212e206302d7aae76f52a1b34dcc991327de3
author
brice · · 2026-10-19 14:41 UTC
committer
brice · · 2026-10-19 18:30 UTC
parent
5d95127
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +27 -14
M internal/adapters/kvstore/mergerequests_open_test.go +25 -0
@@ -284,3 +284,28 @@ func TestOpenIndexIsBackfilledOnce(t *testing.T) {
284284 assert.Equal(t, int64(5), five.Number)
285285 assert.Equal(t, []int64{1, 5}, bySource(t, m2, old, "feat/one"))
286286 }
287+
288+// Issues and merge requests share a sequence, but only merge requests belong
289+// to the indexes used by branch-move checks and mergeability rescans.
290+func TestMergeabilityIndexesExcludeIssueNumbers(t *testing.T) {
291+ ctx := context.Background()
292+ s, mrs, repo := repoWithMRs(t)
293+ issue, err := s.Issues().Create(ctx, newIssue(t, repo, "issue"))
294+ require.NoError(t, err)
295+ mr, err := mrs.Create(ctx, newMR(t, repo, "request"))
296+ require.NoError(t, err)
297+ require.Equal(t, issue.Number+1, mr.Number)
298+
299+ source, truncated, err := mrs.OpenBySource(ctx, repo, []string{"feat/x"}, 10)
300+ require.NoError(t, err)
301+ assert.False(t, truncated)
302+ assert.Equal(t, []int64{mr.Number}, source)
303+ target, truncated, err := mrs.OpenByTarget(ctx, repo, []string{"main"}, 10)
304+ require.NoError(t, err)
305+ assert.False(t, truncated)
306+ assert.Equal(t, []int64{mr.Number}, target)
307+ open, err := mrs.ListOpen(ctx, repo)
308+ require.NoError(t, err)
309+ require.Len(t, open, 1)
310+ assert.Equal(t, mr.Number, open[0].Number)
311+}
@@ -284,3 +284,28 @@ func TestOpenIndexIsBackfilledOnce(t *testing.T) {
284 assert.Equal(t, int64(5), five.Number)284 assert.Equal(t, int64(5), five.Number)
285 assert.Equal(t, []int64{1, 5}, bySource(t, m2, old, "feat/one"))285 assert.Equal(t, []int64{1, 5}, bySource(t, m2, old, "feat/one"))
286 }286 }
287+
288+// Issues and merge requests share a sequence, but only merge requests belong
289+// to the indexes used by branch-move checks and mergeability rescans.
290+func TestMergeabilityIndexesExcludeIssueNumbers(t *testing.T) {
291+ ctx := context.Background()
292+ s, mrs, repo := repoWithMRs(t)
293+ issue, err := s.Issues().Create(ctx, newIssue(t, repo, "issue"))
294+ require.NoError(t, err)
295+ mr, err := mrs.Create(ctx, newMR(t, repo, "request"))
296+ require.NoError(t, err)
297+ require.Equal(t, issue.Number+1, mr.Number)
298+
299+ source, truncated, err := mrs.OpenBySource(ctx, repo, []string{"feat/x"}, 10)
300+ require.NoError(t, err)
301+ assert.False(t, truncated)
302+ assert.Equal(t, []int64{mr.Number}, source)
303+ target, truncated, err := mrs.OpenByTarget(ctx, repo, []string{"main"}, 10)
304+ require.NoError(t, err)
305+ assert.False(t, truncated)
306+ assert.Equal(t, []int64{mr.Number}, target)
307+ open, err := mrs.ListOpen(ctx, repo)
308+ require.NoError(t, err)
309+ require.Len(t, open, 1)
310+ assert.Equal(t, mr.Number, open[0].Number)
311+}
M internal/app/testdata/web/commits-root.html +1 -7
@@ -972,13 +972,7 @@
972972 htmx:sse:close, htmx:sse:error -> ermiteLive.lost();
973973 htmx:sse:error -> ermiteLive.error(event.detail.status);
974974 htmx:sse:before:connection -> ermiteLive.gate(event);
975-<<<<<<< HEAD
976- home-list, repo-last-push, refs-list, commits-head, mr-notice, ci-run, ci-job, inbox -> ermiteLive.swap(event.detail.data);
977-||||||| parent of 7eacfea (feat(web,cli): live mergeability in the merge box, merge modes and inline merge errors)
978- home-list, repo-last-push, refs-list, commits-head, mr-notice, ci-run, ci-job -> ermiteLive.swap(event.detail.data);
979-=======
980- home-list, repo-last-push, refs-list, commits-head, mr-notice, mr-mergeability, ci-run, ci-job -> ermiteLive.swap(event.detail.data);
981->>>>>>> 7eacfea (feat(web,cli): live mergeability in the merge box, merge modes and inline merge errors)
975+ home-list, repo-last-push, refs-list, commits-head, mr-notice, mr-mergeability, ci-run, ci-job, inbox -> ermiteLive.swap(event.detail.data);
982976 gap -> ermiteLive.reload()">
983977 </span>
984978 </div>
@@ -972,13 +972,7 @@
972 htmx:sse:close, htmx:sse:error -> ermiteLive.lost();972 htmx:sse:close, htmx:sse:error -> ermiteLive.lost();
973 htmx:sse:error -> ermiteLive.error(event.detail.status);973 htmx:sse:error -> ermiteLive.error(event.detail.status);
974 htmx:sse:before:connection -> ermiteLive.gate(event);974 htmx:sse:before:connection -> ermiteLive.gate(event);
975-<<<<<<< HEAD975+ home-list, repo-last-push, refs-list, commits-head, mr-notice, mr-mergeability, ci-run, ci-job, inbox -> ermiteLive.swap(event.detail.data);
976- home-list, repo-last-push, refs-list, commits-head, mr-notice, ci-run, ci-job, inbox -> ermiteLive.swap(event.detail.data);
977-||||||| parent of 7eacfea (feat(web,cli): live mergeability in the merge box, merge modes and inline merge errors)
978- home-list, repo-last-push, refs-list, commits-head, mr-notice, ci-run, ci-job -> ermiteLive.swap(event.detail.data);
979-=======
980- home-list, repo-last-push, refs-list, commits-head, mr-notice, mr-mergeability, ci-run, ci-job -> ermiteLive.swap(event.detail.data);
981->>>>>>> 7eacfea (feat(web,cli): live mergeability in the merge box, merge modes and inline merge errors)
982 gap -> ermiteLive.reload()">976 gap -> ermiteLive.reload()">
983 </span>977 </span>
984 </div>978 </div>
M internal/app/testdata/web/commits-small.html +1 -7
@@ -317,13 +317,7 @@
317317 htmx:sse:close, htmx:sse:error -> ermiteLive.lost();
318318 htmx:sse:error -> ermiteLive.error(event.detail.status);
319319 htmx:sse:before:connection -> ermiteLive.gate(event);
320-<<<<<<< HEAD
321- home-list, repo-last-push, refs-list, commits-head, mr-notice, ci-run, ci-job, inbox -> ermiteLive.swap(event.detail.data);
322-||||||| parent of 7eacfea (feat(web,cli): live mergeability in the merge box, merge modes and inline merge errors)
323- home-list, repo-last-push, refs-list, commits-head, mr-notice, ci-run, ci-job -> ermiteLive.swap(event.detail.data);
324-=======
325- home-list, repo-last-push, refs-list, commits-head, mr-notice, mr-mergeability, ci-run, ci-job -> ermiteLive.swap(event.detail.data);
326->>>>>>> 7eacfea (feat(web,cli): live mergeability in the merge box, merge modes and inline merge errors)
320+ home-list, repo-last-push, refs-list, commits-head, mr-notice, mr-mergeability, ci-run, ci-job, inbox -> ermiteLive.swap(event.detail.data);
327321 gap -> ermiteLive.reload()">
328322 </span>
329323 </div>
@@ -317,13 +317,7 @@
317 htmx:sse:close, htmx:sse:error -> ermiteLive.lost();317 htmx:sse:close, htmx:sse:error -> ermiteLive.lost();
318 htmx:sse:error -> ermiteLive.error(event.detail.status);318 htmx:sse:error -> ermiteLive.error(event.detail.status);
319 htmx:sse:before:connection -> ermiteLive.gate(event);319 htmx:sse:before:connection -> ermiteLive.gate(event);
320-<<<<<<< HEAD320+ home-list, repo-last-push, refs-list, commits-head, mr-notice, mr-mergeability, ci-run, ci-job, inbox -> ermiteLive.swap(event.detail.data);
321- home-list, repo-last-push, refs-list, commits-head, mr-notice, ci-run, ci-job, inbox -> ermiteLive.swap(event.detail.data);
322-||||||| parent of 7eacfea (feat(web,cli): live mergeability in the merge box, merge modes and inline merge errors)
323- home-list, repo-last-push, refs-list, commits-head, mr-notice, ci-run, ci-job -> ermiteLive.swap(event.detail.data);
324-=======
325- home-list, repo-last-push, refs-list, commits-head, mr-notice, mr-mergeability, ci-run, ci-job -> ermiteLive.swap(event.detail.data);
326->>>>>>> 7eacfea (feat(web,cli): live mergeability in the merge box, merge modes and inline merge errors)
327 gap -> ermiteLive.reload()">321 gap -> ermiteLive.reload()">
328 </span>322 </span>
329 </div>323 </div>

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 43

↑↓ moveenter openesc close