detached 4476ae5

fix(events): deliver mergeability events on owner topics

commit
4476ae5858820f58dd4c8a127bfecb9f064f1dcc
author
brice · · 2026-10-19 14:52 UTC
parent
9fec184
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +14 -1
M internal/usecase/events.go +1 -1
@@ -649,7 +649,7 @@ func isRepoLifecycleEvent(ev domain.Event) bool {
649649 func isItemEvent(ev domain.Event) bool {
650650 switch ev.(type) {
651651 case domain.MergeRequestOpened, domain.MergeRequestMerged, domain.MergeRequestClosed,
652- domain.MergeRequestReady, domain.CommentAdded,
652+ domain.MergeRequestReady, domain.MergeRequestMergeability, domain.CommentAdded,
653653 domain.CommentEdited, domain.CommentDeleted, domain.CommentResolved:
654654 return true
655655 }
@@ -649,7 +649,7 @@ func isRepoLifecycleEvent(ev domain.Event) bool {
649 func isItemEvent(ev domain.Event) bool {649 func isItemEvent(ev domain.Event) bool {
650 switch ev.(type) {650 switch ev.(type) {
651 case domain.MergeRequestOpened, domain.MergeRequestMerged, domain.MergeRequestClosed,651 case domain.MergeRequestOpened, domain.MergeRequestMerged, domain.MergeRequestClosed,
652- domain.MergeRequestReady, domain.CommentAdded,652+ domain.MergeRequestReady, domain.MergeRequestMergeability, domain.CommentAdded,
653 domain.CommentEdited, domain.CommentDeleted, domain.CommentResolved:653 domain.CommentEdited, domain.CommentDeleted, domain.CommentResolved:
654 return true654 return true
655 }655 }
M internal/usecase/events_test.go +13 -0
@@ -997,3 +997,16 @@ func TestNoteMutationEventVisibility(t *testing.T) {
997997 }
998998 })
999999 }
1000+
1001+func TestMergeabilityEventReachesOwnerTopic(t *testing.T) {
1002+ synctest.Test(t, func(t *testing.T) {
1003+ r := newEventRig(t, 0)
1004+ priv := r.repo("priv", domain.VisibilityPrivate)
1005+ ctx, cancel := context.WithCancel(context.Background())
1006+ defer cancel()
1007+ owner := r.watch(ctx, domain.Root(), ports.WatchParams{Topics: []string{"repo:priv"}})
1008+ synctest.Wait()
1009+ r.feed <- domain.MergeRequestMergeability{Repo: priv, Number: 1, Visibility: domain.VisibilityPrivate, CreatedAt: now, At: now}
1010+ assert.Equal(t, priv, owner.next(t).Event.(domain.MergeRequestMergeability).Repo)
1011+ })
1012+}
@@ -997,3 +997,16 @@ func TestNoteMutationEventVisibility(t *testing.T) {
997 }997 }
998 })998 })
999 }999 }
1000+
1001+func TestMergeabilityEventReachesOwnerTopic(t *testing.T) {
1002+ synctest.Test(t, func(t *testing.T) {
1003+ r := newEventRig(t, 0)
1004+ priv := r.repo("priv", domain.VisibilityPrivate)
1005+ ctx, cancel := context.WithCancel(context.Background())
1006+ defer cancel()
1007+ owner := r.watch(ctx, domain.Root(), ports.WatchParams{Topics: []string{"repo:priv"}})
1008+ synctest.Wait()
1009+ r.feed <- domain.MergeRequestMergeability{Repo: priv, Number: 1, Visibility: domain.VisibilityPrivate, CreatedAt: now, At: now}
1010+ assert.Equal(t, priv, owner.next(t).Event.(domain.MergeRequestMergeability).Repo)
1011+ })
1012+}

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 4

Tags 45

↑↓ moveenter openesc close