detached 935f0d1

fix: normalize suppression keys in registry suppression methods

commit
935f0d1eb531fa31816beb0676700293ccdfb392
author
brice · · 2026-03-04 08:59 UTC
parent
3bec053
signature
unsigned
1 file · +15 -0
M internal/usecase/registry/service.go +15 -0
@@ -54,6 +54,11 @@ func NewService(
5454 // SuppressDeployEvent marks an image name to skip image.pushed events.
5555 // The suppression auto-expires after 2 minutes to prevent leaks.
5656 func (s *Service) SuppressDeployEvent(imageName string) {
57+ imageName = ExtractImageName(strings.TrimSpace(imageName))
58+ if imageName == "" {
59+ return
60+ }
61+
5762 var timer *time.Timer
5863 timer = time.AfterFunc(2*time.Minute, func() {
5964 // Only delete if this timer is still the current one, preventing an
@@ -70,6 +75,11 @@ func (s *Service) SuppressDeployEvent(imageName string) {
7075
7176 // ClearDeployEventSuppression removes event suppression for an image.
7277 func (s *Service) ClearDeployEventSuppression(imageName string) {
78+ imageName = ExtractImageName(strings.TrimSpace(imageName))
79+ if imageName == "" {
80+ return
81+ }
82+
7383 if v, loaded := s.suppressedImages.LoadAndDelete(imageName); loaded {
7484 v.(*time.Timer).Stop()
7585 }
@@ -111,6 +121,11 @@ func ExtractImageName(imageRef string) string {
111121
112122 // IsDeployEventSuppressed checks if deploy events are suppressed for an image.
113123 func (s *Service) IsDeployEventSuppressed(imageName string) bool {
124+ imageName = ExtractImageName(strings.TrimSpace(imageName))
125+ if imageName == "" {
126+ return false
127+ }
128+
114129 _, exists := s.suppressedImages.Load(imageName)
115130 return exists
116131 }
@@ -54,6 +54,11 @@ func NewService(
54 // SuppressDeployEvent marks an image name to skip image.pushed events.54 // SuppressDeployEvent marks an image name to skip image.pushed events.
55 // The suppression auto-expires after 2 minutes to prevent leaks.55 // The suppression auto-expires after 2 minutes to prevent leaks.
56 func (s *Service) SuppressDeployEvent(imageName string) {56 func (s *Service) SuppressDeployEvent(imageName string) {
57+ imageName = ExtractImageName(strings.TrimSpace(imageName))
58+ if imageName == "" {
59+ return
60+ }
61+
57 var timer *time.Timer62 var timer *time.Timer
58 timer = time.AfterFunc(2*time.Minute, func() {63 timer = time.AfterFunc(2*time.Minute, func() {
59 // Only delete if this timer is still the current one, preventing an64 // Only delete if this timer is still the current one, preventing an
@@ -70,6 +75,11 @@ func (s *Service) SuppressDeployEvent(imageName string) {
70 75
71 // ClearDeployEventSuppression removes event suppression for an image.76 // ClearDeployEventSuppression removes event suppression for an image.
72 func (s *Service) ClearDeployEventSuppression(imageName string) {77 func (s *Service) ClearDeployEventSuppression(imageName string) {
78+ imageName = ExtractImageName(strings.TrimSpace(imageName))
79+ if imageName == "" {
80+ return
81+ }
82+
73 if v, loaded := s.suppressedImages.LoadAndDelete(imageName); loaded {83 if v, loaded := s.suppressedImages.LoadAndDelete(imageName); loaded {
74 v.(*time.Timer).Stop()84 v.(*time.Timer).Stop()
75 }85 }
@@ -111,6 +121,11 @@ func ExtractImageName(imageRef string) string {
111 121
112 // IsDeployEventSuppressed checks if deploy events are suppressed for an image.122 // IsDeployEventSuppressed checks if deploy events are suppressed for an image.
113 func (s *Service) IsDeployEventSuppressed(imageName string) bool {123 func (s *Service) IsDeployEventSuppressed(imageName string) bool {
124+ imageName = ExtractImageName(strings.TrimSpace(imageName))
125+ if imageName == "" {
126+ return false
127+ }
128+
114 _, exists := s.suppressedImages.Load(imageName)129 _, exists := s.suppressedImages.Load(imageName)
115 return exists130 return exists
116 }131 }

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 7

Tags 106

↑↓ moveenter openesc close