Skip to content

fix(ghcr): list latest, nightly and main images ahead of the rest - #86

Merged
vthwang merged 1 commit into
mainfrom
fix/channel-image-order
Oct 17, 2026
Merged

vthwang merged 1 commit into
mainfrom
fix/channel-image-order

Conversation

@geoffturk

Copy link
Copy Markdown
Member

ListTags sorted every tag newest-first and then swapped the latest row with whatever was first. When nightly was the newest build, the swap moved latest to the top and dropped nightly into latest's old slot, below main and unchanneled builds. Nightly and main were never placed on purpose.

  • internal/ghcr/client.go: replace the swap with a stable sort by channel rank (latest, nightly, main, then the rest), so unchanneled tags keep their newest-first order and undated tags stay last. A build carrying several channels takes its highest-ranked slot. result[0] is still the latest row, so frontends default as before.
  • internal/ghcr/client_test.go: cover the nightly-newest case, a build flagged both nightly and main, a missing channel, and no channels.

Tested locally against GHCR via the portal's image dropdowns.

ListTags sorted every tag newest-first and then swapped the latest row
with whatever was first. When nightly was the newest build, the swap
moved latest to the top and dropped nightly into latest's old slot,
below main and unchanneled builds. Nightly and main were never placed
on purpose.

- internal/ghcr/client.go: replace the swap with a stable sort by
  channel rank (latest, nightly, main, then the rest), so unchanneled
  tags keep their newest-first order and undated tags stay last. A
  build carrying several channels takes its highest-ranked slot.
  result[0] is still the latest row, so frontends default as before.
- internal/ghcr/client_test.go: cover the nightly-newest case, a build
  flagged both nightly and main, a missing channel, and no channels.

Signed-off-by: Geoff Turk <geoff@ic3.dev>
@geoffturk
geoffturk requested a review from vthwang October 16, 2026 08:34
@vthwang
vthwang merged commit a5f2fda into main Oct 17, 2026
1 check passed
@vthwang
vthwang deleted the fix/channel-image-order branch October 17, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants