Record and show that an image is already on its newest tag

An image that had been checked and is current looked exactly like one
that was never checked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Dennis Nemec
2026-09-03 20:37:46 +02:00
parent 1cb634afca
commit 4efff51aa7
6 changed files with 69 additions and 15 deletions

View File

@ -151,6 +151,26 @@ describe('FindingGroups for images', () => {
expect(w.find('button[name=update-image]').exists()).toBe(true)
})
it('says the image is current when a check found no newer tag', () => {
const current = image({
update: {
image: 'gitea/gitea:1.22.3',
candidate: '',
checked_at: '2026-09-03T08:00:00Z',
fixed: [],
fixed_counts: { critical: 0, high: 0, medium: 0, low: 0, unknown: 0 },
candidate_total: 0,
},
})
const w = mount(FindingGroups, {
props: { groups: [current], scope: 'container', canAct: true, load: vi.fn() },
global: { stubs: { RouterLink: { template: '<a><slot /></a>' } } },
})
expect(w.text()).toContain('newest tag')
expect(w.find('button[name=update-image]').exists()).toBe(false)
expect(w.find('button[name=check-image]').exists()).toBe(true)
})
it('offers a check when nothing is known yet and hides the actions from viewers', () => {
const w = mount(FindingGroups, {
props: { groups: [image()], scope: 'container', canAct: true, load: vi.fn() },

View File

@ -127,7 +127,18 @@ const shown = (c: SeverityCounts) => chips.filter((s) => c[s.key] > 0)
</span>
</td>
<td v-if="scope === 'container'" class="whitespace-nowrap text-xs" @click.stop>
<template v-if="asImage(g).update">
<template v-if="asImage(g).update && !asImage(g).update!.candidate">
<div class="text-gray-500">on the newest tag</div>
<button
v-if="canAct"
name="check-image"
class="text-blue-600 hover:underline"
@click="emit('check', asImage(g))"
>
Check again
</button>
</template>
<template v-else-if="asImage(g).update">
<div>
<span class="font-mono font-medium text-green-700">{{
tagOf(asImage(g).update!.candidate)