feat(master): suggest newer version tags for third-party images (#11) (#31)
Docker Build / docker (push) Successful in 45s

This commit was merged in pull request #31.
This commit is contained in:
2026-10-13 10:18:53 +00:00
parent 850a670446
commit f6446be711
26 changed files with 1090 additions and 48 deletions
+31
View File
@@ -790,3 +790,34 @@ func TestServicePage_AutoBlockedDisablesToggle(t *testing.T) {
_, body := get(t, srv, "/services/1")
assert.Contains(t, body, "Auto unavailable: "+model.ReasonContainer+".")
}
// GetTagVersion returns the digest-less version of repo with this tag.
func (f *fakeStore) GetTagVersion(_ context.Context, repo, tag string) (model.ImageVersion, error) {
for _, v := range f.versions {
if v.Repo == repo && v.Tag == tag && v.Digest == "" {
return v, nil
}
}
return model.ImageVersion{}, model.ErrNotFound
}
func TestOverview_ShowsNewerTagChipBesideUpdateChip(t *testing.T) {
srv, store, _, _, _ := newTestEnv(t)
store.services[0].AvailableRef = "gitea.shcizo.se/shcizo/slusk:1.4.2"
store.services[0].NewerRef = "gitea.shcizo.se/shcizo/slusk:1.5.0"
for _, path := range []string{"/", "/fragments/services"} {
_, body := get(t, srv, path)
assert.Contains(t, body, `class="tag f-newer" title="gitea.shcizo.se/shcizo/slusk:1.5.0">Newer tag<em>1.5.0</em>`, path)
assert.Contains(t, body, `class="tag f-up"`, path)
}
}
func TestOverview_HidesStaleNewerTag(t *testing.T) {
srv, store, _, _, _ := newTestEnv(t)
store.services[0].NewerRef = "gitea.shcizo.se/shcizo/slusk:1.4.1" // not newer than 1.4.2
_, body := get(t, srv, "/")
assert.NotContains(t, body, "f-newer")
}