Skip to content

refactor: update FindRepoLatest to prioritize repo priority, version, and architecture with lock support.#202

Merged
nguyen-phillip merged 8 commits intogoogle:masterfrom
jm2:master
Apr 22, 2026
Merged

refactor: update FindRepoLatest to prioritize repo priority, version, and architecture with lock support.#202
nguyen-phillip merged 8 commits intogoogle:masterfrom
jm2:master

Conversation

@jm2
Copy link
Copy Markdown
Member

@jm2 jm2 commented Apr 21, 2026

The FindRepoLatest function in googet/client/client.go has been rewritten to change the package selection logic. Previously, it would find the latest version within the first architecture in the provided list (archs) that had any matching packages. This meant a newer version in a lower-preference architecture would be missed.

The new logic collects all possible package matches across all repos and supported architectures. These matches are then sorted based on:

  1. Repo Priority (highest first)
  2. Package Version (newest first)
  3. Architecture Preference (based on the order in the archs slice, e.g., native-arch, compatible-arch, noarch).

jm2 and others added 5 commits April 21, 2026 16:19
… and architecture with lock support.

The FindRepoLatest function in googet/client/client.go has been rewritten to change the package selection logic. Previously, it would find the latest version within the first architecture in the provided list (archs) that had any matching packages. This meant a newer version in a lower-preference architecture would be missed.

The new logic collects all possible package matches across all repos and supported architectures. These matches are then sorted based on:
1. Repo Priority (highest first)
2. Package Version (newest first)
3. Architecture Preference (based on the order in the archs slice, e.g., native-arch, compatible-arch, noarch).
@jm2 jm2 requested a review from nguyen-phillip April 22, 2026 14:08
Comment thread cli/latest/latest.go
Comment thread cli/latest/latest.go Outdated
Comment thread cli/latest/latest.go Outdated
Comment thread goolib/goospec.go
Comment thread client/client.go Outdated
Comment thread client/client.go Outdated
Comment thread client/client.go Outdated
Comment thread cli/latest/latest.go Outdated
Comment thread install/install.go Outdated
Comment thread system/system_windows.go
jm2 added 2 commits April 22, 2026 15:37
…dLockState and optimize candidate sorting using slices.SortFunc
@jm2 jm2 requested a review from nguyen-phillip April 22, 2026 19:43
Copy link
Copy Markdown
Collaborator

@nguyen-phillip nguyen-phillip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nguyen-phillip nguyen-phillip merged commit 304c7ef into google:master Apr 22, 2026
4 checks passed
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