Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package gitlab-container-registry for
openSUSE:Factory checked in at 2026-05-28 17:32:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gitlab-container-registry (Old)
and /work/SRC/openSUSE:Factory/.gitlab-container-registry.new.1937 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gitlab-container-registry"
Thu May 28 17:32:11 2026 rev:25 rq:1355596 version:4.40.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/gitlab-container-registry/gitlab-container-registry.changes
2026-05-15 23:55:09.969198982 +0200
+++
/work/SRC/openSUSE:Factory/.gitlab-container-registry.new.1937/gitlab-container-registry.changes
2026-05-28 17:32:16.976987753 +0200
@@ -1,0 +2,8 @@
+Thu May 28 07:34:31 UTC 2026 - Johannes Kastl
<[email protected]>
+
+- Update to version 4.40.1:
+ * Bux Fixes
+ - fix(handlers): defer router init until metadata DB resolves
+ prefer-fallback
+
+-------------------------------------------------------------------
Old:
----
gitlab-container-registry-4.40.0.obscpio
New:
----
gitlab-container-registry-4.40.1.obscpio
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gitlab-container-registry.spec ++++++
--- /var/tmp/diff_new_pack.cdai4H/_old 2026-05-28 17:32:21.489174123 +0200
+++ /var/tmp/diff_new_pack.cdai4H/_new 2026-05-28 17:32:21.493174289 +0200
@@ -17,7 +17,7 @@
Name: gitlab-container-registry
-Version: 4.40.0
+Version: 4.40.1
Release: 0
Summary: The GitLab Container Registry
License: Apache-2.0
++++++ _service ++++++
--- /var/tmp/diff_new_pack.cdai4H/_old 2026-05-28 17:32:21.537176106 +0200
+++ /var/tmp/diff_new_pack.cdai4H/_new 2026-05-28 17:32:21.541176271 +0200
@@ -3,7 +3,7 @@
<param
name="url">https://gitlab.com/gitlab-org/container-registry.git</param>
<param name="scm">git</param>
<param name="exclude">.git</param>
- <param name="revision">v4.40.0-gitlab</param>
+ <param name="revision">v4.40.1-gitlab</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">v(.*)-gitlab</param>
<param name="changesgenerate">enable</param>
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.cdai4H/_old 2026-05-28 17:32:21.577177758 +0200
+++ /var/tmp/diff_new_pack.cdai4H/_new 2026-05-28 17:32:21.581177924 +0200
@@ -1,6 +1,6 @@
<servicedata>
<service name="tar_scm">
<param
name="url">https://gitlab.com/gitlab-org/container-registry.git</param>
- <param
name="changesrevision">4eb13967692b3cc00abbeb4f70c491bf403c2355</param></service></servicedata>
+ <param
name="changesrevision">b4c21f9e3907860dbb70cb2a3d6ee438077032cb</param></service></servicedata>
(No newline at EOF)
++++++ gitlab-container-registry-4.40.0.obscpio ->
gitlab-container-registry-4.40.1.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gitlab-container-registry-4.40.0/CHANGELOG.md
new/gitlab-container-registry-4.40.1/CHANGELOG.md
--- old/gitlab-container-registry-4.40.0/CHANGELOG.md 2026-05-14
01:54:05.000000000 +0200
+++ new/gitlab-container-registry-4.40.1/CHANGELOG.md 2026-05-22
21:07:54.000000000 +0200
@@ -1,3 +1,10 @@
+##
[4.40.1](https://gitlab.com/gitlab-org/container-registry/compare/v4.40.0-gitlab...v4.40.1)
(2026-05-22)
+
+
+### 🐛 Bug Fixes 🐛
+
+* **handlers:** defer router init until metadata DB resolves prefer-fallback
([9d2e6bd](https://gitlab.com/gitlab-org/container-registry/commit/9d2e6bd31e9771c3fc6774c1e60f3ea8876f84ed))
+
##
[4.40.0](https://gitlab.com/gitlab-org/container-registry/compare/v4.39.0-gitlab...v4.40.0)
(2026-05-13)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/gitlab-container-registry-4.40.0/registry/handlers/app.go
new/gitlab-container-registry-4.40.1/registry/handlers/app.go
--- old/gitlab-container-registry-4.40.0/registry/handlers/app.go
2026-05-14 01:54:05.000000000 +0200
+++ new/gitlab-container-registry-4.40.1/registry/handlers/app.go
2026-05-22 21:07:54.000000000 +0200
@@ -199,10 +199,6 @@
}
}()
- if err = app.initRouter(); err != nil {
- return nil, fmt.Errorf("initializing router: %w", err)
- }
-
storageParams := config.Storage.Parameters()
if storageParams == nil {
storageParams = make(configuration.Parameters)
@@ -415,6 +411,12 @@
}
options = append(options, opts...)
+ // initRouter must run after initializeMetadataDatabase so the gates
inside it
+ // read the post-fallback IsEnabled() value (see
gitlab-org/gitlab#600955).
+ if err = app.initRouter(); err != nil {
+ return nil, fmt.Errorf("initializing router: %w", err)
+ }
+
// configure storage caches
// It's possible that the metadata database will fill the same original
need
// as the blob descriptor cache (avoiding slow and/or expensive calls to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/gitlab-container-registry-4.40.0/registry/handlers/app_integration_test.go
new/gitlab-container-registry-4.40.1/registry/handlers/app_integration_test.go
---
old/gitlab-container-registry-4.40.0/registry/handlers/app_integration_test.go
2026-05-14 01:54:05.000000000 +0200
+++
new/gitlab-container-registry-4.40.1/registry/handlers/app_integration_test.go
2026-05-22 21:07:54.000000000 +0200
@@ -5,6 +5,8 @@
import (
"context"
"io"
+ "net/http"
+ "net/http/httptest"
"os"
"path/filepath"
"strings"
@@ -458,6 +460,89 @@
})
}
}
+
+// TestNewApp_PreferFallback_V1RoutesReturn404 is a regression test for
+// gitlab-org/gitlab#600955. When NewApp runs in prefer mode with an existing
+// filesystem lockfile, initializeMetadataDatabase sets
+// config.Database.PreferFallback = true and returns without initializing
+// app.db. Before the fix, initRouter ran before initializeMetadataDatabase
+// and captured a stale IsEnabled() = true, so the /gitlab/v1/... routes
+// dispatched to handlers that dereferenced nil app.db. After the fix, the
+// router sees IsEnabled() = false and the dbAssertionhandler wrap returns
+// the 404 handler for all eleven v1 routes.
+func TestNewApp_PreferFallback_V1RoutesReturn404(t *testing.T) {
+ skipDatabaseNotEnabled(t)
+
+ // Set up a prefer-fallback environment: copy the happy-path fixture,
+ // lock the filesystem, unlock the database, and configure prefer mode.
+ tmpDir := t.TempDir()
+ copyFixture(t, tmpDir)
+
+ config := newConfig(withFSDriver(tmpDir))
+
+ ctx := context.Background()
+ l := newTestLockers(t, &config)
+ require.NoError(t, l.FS.Lock(ctx))
+ require.NoError(t, l.DB.Unlock(ctx))
+
+ config.Database.Enabled = configuration.DatabaseEnabledPrefer
+
+ truncateTables := runMigrations(t, &config)
+ t.Cleanup(truncateTables)
+
+ app, err := handlers.NewApp(context.Background(), &config)
+ require.NoError(t, err)
+ require.NotNil(t, app)
+
+ t.Cleanup(func() {
+ if err := app.GracefulShutdown(context.Background()); err !=
nil {
+ t.Logf("GracefulShutdown error: %v", err)
+ }
+ })
+
+ // Confirm the fallback path was taken. If this fails, the rest of the
+ // table tests below would not be exercising the bug.
+ require.True(t, config.Database.PreferFallback, "expected
prefer-fallback to engage")
+
+ server := httptest.NewServer(app)
+ t.Cleanup(server.Close)
+
+ // Literal URL paths from registry/api/gitlab/v1/routes.go. The route
+ // names are stable identifiers used as subtest names for traceability.
+ // We do not synthesize URLs from v1.Route.Path because the path strings
+ // contain gorilla/mux regex segments (e.g. "{name:REGEX}") that are not
+ // safe to substitute via strings.Replace.
+ testCases := []struct {
+ routeName string
+ url string
+ }{
+ {routeName: "Base", url: "/gitlab/v1/"},
+ {routeName: "RepositoryTags", url:
"/gitlab/v1/repositories/foo/bar/tags/list/"},
+ {routeName: "RepositoryTagDetail", url:
"/gitlab/v1/repositories/foo/bar/tags/detail/v1/"},
+ {routeName: "Repositories", url:
"/gitlab/v1/repositories/foo/bar/"},
+ {routeName: "SubRepositories", url:
"/gitlab/v1/repository-paths/foo/bar/repositories/list/"},
+ {routeName: "Statistics", url: "/gitlab/v1/statistics/"},
+ {routeName: "BBM", url: "/gitlab/v1/background-migrations/"},
+ {routeName: "BBMById", url:
"/gitlab/v1/background-migrations/1/"},
+ {routeName: "BBMPause", url:
"/gitlab/v1/background-migrations/pause/"},
+ {routeName: "BBMResume", url:
"/gitlab/v1/background-migrations/resume/"},
+ {routeName: "BBMRestart", url: "/gitlab/v1/restart/1/"},
+ }
+
+ for _, tc := range testCases {
+ t.Run(tc.routeName, func(tt *testing.T) {
+ req, err := http.NewRequestWithContext(ctx,
http.MethodGet, server.URL+tc.url, nil)
+ require.NoError(tt, err)
+
+ resp, err := http.DefaultClient.Do(req)
+ require.NoError(tt, err)
+ defer resp.Body.Close()
+
+ assert.Equal(tt, http.StatusNotFound, resp.StatusCode,
"route %s (%s) should return 404 in prefer-fallback mode", tc.routeName, tc.url)
+ assert.NotEmpty(tt,
resp.Header.Get("Gitlab-Container-Registry-Version"), "route %s (%s) should set
Gitlab-Container-Registry-Version header", tc.routeName, tc.url)
+ })
+ }
+}
// TestInitializeMetadataDatabase_FSLockedEnabledMode tests
initializeMetadataDatabase
// behavior in enabled mode when filesystem is locked.
++++++ gitlab-container-registry.obsinfo ++++++
--- /var/tmp/diff_new_pack.cdai4H/_old 2026-05-28 17:32:24.821311753 +0200
+++ /var/tmp/diff_new_pack.cdai4H/_new 2026-05-28 17:32:24.829312083 +0200
@@ -1,5 +1,5 @@
name: gitlab-container-registry
-version: 4.40.0
-mtime: 1778716445
-commit: 4eb13967692b3cc00abbeb4f70c491bf403c2355
+version: 4.40.1
+mtime: 1779476874
+commit: b4c21f9e3907860dbb70cb2a3d6ee438077032cb
++++++ vendor.tar.gz ++++++
/work/SRC/openSUSE:Factory/gitlab-container-registry/vendor.tar.gz
/work/SRC/openSUSE:Factory/.gitlab-container-registry.new.1937/vendor.tar.gz
differ: char 13, line 1