Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/image-bump-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@ services:
postgres: {regex: '^(\d+)-alpine$', track: patch}
python: {regex: '^(\d+)\.(\d+)-slim$', track: patch}
redis: {regex: '^(\d+)-alpine$', track: patch}
valkey: {regex: '^(\d+)\.(\d+)-alpine$', track: patch}
# --- exact versions: patch releases within the current minor ---
alertmanager: {regex: '^v(\d+)\.(\d+)\.(\d+)$', track: patch}
auth: {regex: '^(\d+)\.(\d+)\.(\d+)$', track: patch}
# auth-v14 / hasura-v14: the v1.4 line stays on its own minor (auth 0.36, hasura 2.44);
# only patch releases move. 0.43.0 and later auth need AUTH_ENCRYPTION_KEY.
auth-v14: {regex: '^(\d+)\.(\d+)\.(\d+)$', track: patch}
cadvisor: {regex: '^v(\d+)\.(\d+)\.(\d+)$', track: patch}
elasticsearch: {regex: '^(\d+)\.(\d+)\.(\d+)$', track: patch}
grafana: {regex: '^(\d+)\.(\d+)\.(\d+)$', track: patch}
hasura: {regex: '^v(\d+)\.(\d+)\.(\d+)$', track: patch}
hasura-v14: {regex: '^v(\d+)\.(\d+)\.(\d+)$', track: patch}
lego: {regex: '^v(\d+)\.(\d+)\.(\d+)$', track: patch}
loki: {regex: '^(\d+)\.(\d+)\.(\d+)$', track: patch}
mlflow: {regex: '^v(\d+)\.(\d+)\.(\d+)$', track: patch}
Expand Down
42 changes: 42 additions & 0 deletions tools/imagebump/bump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,45 @@ func TestDryRunWritesNothing(t *testing.T) {
t.Fatal("dry-run modified the file")
}
}

// TestRepoPoliciesCoverEveryPin guards D-1486: every non-plugin pin in the real
// internal/compose/images.yaml needs an entry in the real policy, and its
// current version must match that entry's regex (the weekly run exits 1 on
// either gap).
func TestRepoPoliciesCoverEveryPin(t *testing.T) {
praw, err := os.ReadFile("../../.github/image-bump-policy.yaml")
if err != nil {
t.Fatal(err)
}
pol, err := loadPolicy(praw)
if err != nil {
t.Fatal(err)
}
lraw, err := os.ReadFile("../../internal/compose/images.yaml")
if err != nil {
t.Fatal(err)
}
lf, err := parseLockFile(lraw)
if err != nil {
t.Fatal(err)
}
if len(lf.Images) == 0 {
t.Fatal("images.yaml lists no images")
}
for _, img := range lf.Images {
if img.Role == "plugin" {
continue
}
r, ok := pol.rules[img.Name]
if !ok {
t.Errorf("%s: no entry in .github/image-bump-policy.yaml", img.Name)
continue
}
if r.track == "manual" {
continue
}
if _, matched, err := versionOf(r.re, img.Version); err != nil || !matched {
t.Errorf("%s: version %q does not match its policy regex %s (err %v)", img.Name, img.Version, r.re, err)
}
}
}
Loading