detached 9b07d6a

fix(review) correct misleading comments, dead code, and error detection

commit
9b07d6a82fd1e6432ff7f947c6d3b99eb322b805
author
bnema · · 2026-02-06 21:12 UTC
parent
8ddd497
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +8 -5
M internal/adapters/in/cli/remote/client.go +1 -1
@@ -182,7 +182,7 @@ func retryDelay(attempt int) time.Duration {
182182 }
183183
184184 // requestWithRetry performs an HTTP request and retries transient failures.
185-// Retries occur on transport errors and any 5xx response.
185+// Retries occur on transport errors and gateway errors (502, 503, 504).
186186 func (c *Client) requestWithRetry(ctx context.Context, method, path string, body any) (*http.Response, error) {
187187 var lastErr error
188188
@@ -182,7 +182,7 @@ func retryDelay(attempt int) time.Duration {
182 }182 }
183 183
184 // requestWithRetry performs an HTTP request and retries transient failures.184 // requestWithRetry performs an HTTP request and retries transient failures.
185-// Retries occur on transport errors and any 5xx response.185+// Retries occur on transport errors and gateway errors (502, 503, 504).
186 func (c *Client) requestWithRetry(ctx context.Context, method, path string, body any) (*http.Response, error) {186 func (c *Client) requestWithRetry(ctx context.Context, method, path string, body any) (*http.Response, error) {
187 var lastErr error187 var lastErr error
188 188
M internal/app/run.go +1 -1
@@ -310,7 +310,7 @@ func createServices(ctx context.Context, v *viper.Viper, cfg Config, log zerowra
310310 maxProxyBodySize = parsedSize
311311 }
312312
313- // Parse max_blob_chunk_size config (default: 512MB)
313+ // Parse max_blob_chunk_size config (default: 95MB)
314314 maxBlobChunkSize := int64(registry.DefaultMaxBlobChunkSize)
315315 if cfg.Server.MaxBlobChunkSize != "" {
316316 parsedSize, err := bytesize.Parse(cfg.Server.MaxBlobChunkSize)
@@ -310,7 +310,7 @@ func createServices(ctx context.Context, v *viper.Viper, cfg Config, log zerowra
310 maxProxyBodySize = parsedSize310 maxProxyBodySize = parsedSize
311 }311 }
312 312
313- // Parse max_blob_chunk_size config (default: 512MB)313+ // Parse max_blob_chunk_size config (default: 95MB)
314 maxBlobChunkSize := int64(registry.DefaultMaxBlobChunkSize)314 maxBlobChunkSize := int64(registry.DefaultMaxBlobChunkSize)
315 if cfg.Server.MaxBlobChunkSize != "" {315 if cfg.Server.MaxBlobChunkSize != "" {
316 parsedSize, err := bytesize.Parse(cfg.Server.MaxBlobChunkSize)316 parsedSize, err := bytesize.Parse(cfg.Server.MaxBlobChunkSize)
M internal/usecase/container/service.go +6 -3
@@ -3,6 +3,7 @@ package container
33
44 import (
55 "context"
6+ "errors"
67 "fmt"
78 "maps"
89 "slices"
@@ -1103,8 +1104,7 @@ func (s *Service) pullImageWithRetry(ctx context.Context, pullFn func(context.Co
11031104 return ctx.Err()
11041105 }
11051106 }
1106-
1107- return fmt.Errorf("internal image pull failed after %d attempts", internalPullMaxAttempts)
1107+ return nil
11081108 }
11091109
11101110 func (s *Service) tagImageIfNeeded(ctx context.Context, sourceRef, targetRef string) error {
@@ -1731,6 +1731,9 @@ func isContainerNotFoundError(err error) bool {
17311731 if err == nil {
17321732 return false
17331733 }
1734+ if errors.Is(err, domain.ErrContainerNotFound) {
1735+ return true
1736+ }
17341737 msg := strings.ToLower(err.Error())
17351738 return strings.Contains(msg, "no such container") ||
17361739 strings.Contains(msg, "no container with name or id") ||
@@ -1815,7 +1818,7 @@ func (s *Service) pollContainerRunning(ctx context.Context, containerID string)
18151818 return ctx.Err()
18161819 }
18171820 }
1818- return nil
1821+ return fmt.Errorf("container did not start within 30 seconds")
18191822 }
18201823
18211824 // waitForRecovery waits for a container to recover within the recovery window.
@@ -3,6 +3,7 @@ package container
3 3
4 import (4 import (
5 "context"5 "context"
6+ "errors"
6 "fmt"7 "fmt"
7 "maps"8 "maps"
8 "slices"9 "slices"
@@ -1103,8 +1104,7 @@ func (s *Service) pullImageWithRetry(ctx context.Context, pullFn func(context.Co
1103 return ctx.Err()1104 return ctx.Err()
1104 }1105 }
1105 }1106 }
1106-1107+ return nil
1107- return fmt.Errorf("internal image pull failed after %d attempts", internalPullMaxAttempts)
1108 }1108 }
1109 1109
1110 func (s *Service) tagImageIfNeeded(ctx context.Context, sourceRef, targetRef string) error {1110 func (s *Service) tagImageIfNeeded(ctx context.Context, sourceRef, targetRef string) error {
@@ -1731,6 +1731,9 @@ func isContainerNotFoundError(err error) bool {
1731 if err == nil {1731 if err == nil {
1732 return false1732 return false
1733 }1733 }
1734+ if errors.Is(err, domain.ErrContainerNotFound) {
1735+ return true
1736+ }
1734 msg := strings.ToLower(err.Error())1737 msg := strings.ToLower(err.Error())
1735 return strings.Contains(msg, "no such container") ||1738 return strings.Contains(msg, "no such container") ||
1736 strings.Contains(msg, "no container with name or id") ||1739 strings.Contains(msg, "no container with name or id") ||
@@ -1815,7 +1818,7 @@ func (s *Service) pollContainerRunning(ctx context.Context, containerID string)
1815 return ctx.Err()1818 return ctx.Err()
1816 }1819 }
1817 }1820 }
1818- return nil1821+ return fmt.Errorf("container did not start within 30 seconds")
1819 }1822 }
1820 1823
1821 // waitForRecovery waits for a container to recover within the recovery window.1824 // waitForRecovery waits for a container to recover within the recovery window.

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