Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: Revert use of API to determine latest version #274

Merged

Conversation

lilyinstarlight
Copy link
Contributor

The GitHub API behavior does not work for any repository that has used GitHub releases in the past but only uses tags for newer versions. The original motivation for the change was to prevent pre-releases from being selected as the latest version, but the --version-regex flag exists precisely for the purpose of selecting only intended versions (and not unrelated versions, pre-releases, dev tags, etc)

As such, the change provided no benefit to the package listed in the motivation, but it did break updates for quite a few packages and has resulted in downgrades and misversioning, among other things

A possible attempt to include the GitHub API could be used to specifically exclude tags associated with pre-releases in the GitHub API, but otherwise continue using tags as the "source of truth" for the latest version. This change does not attempt that as it is only intended to make nix-update work correctly as it did before the change. Feel free to ping me if you attempt to do that as a way forward @jvanbruegge :)

This reverts commits bf33dc4 and 696efb6

Reference #246 (also note #246 (comment)) #269
Fixes #272
Notify @jvanbruegge @Mic92

This behavior does not work for any repository that has used GitHub
releases in the past but only uses tags for newer versions. The original
motivation for the change was to prevent pre-releases from being
selected as the latest version, but the `--version-regex` flag exists
precisely for the purpose of selecting only intended versions (and not
unrelated versions, pre-releases, dev tags, etc).

As such, the change provided no benefit to the purported motivation, but
it did break updates for quite a few packages and has resulted in
downgrades and misversioning, among other things.

A possible attempt to include the GitHub API could be used to
specifically exclude tags associated with pre-releases in the GitHub
API, but otherwise continue using tags as the "source of truth" for the
latest version. This change does not attempt that as it is only intended
to make nix-update work correctly as it did before the change.

This reverts commits bf33dc4 and
696efb6.
@Mic92 Mic92 merged commit 1b151b1 into Mic92:master Sep 6, 2024
5 checks passed
@lilyinstarlight lilyinstarlight deleted the revert/github-api-wrong-versions branch September 6, 2024 16:54
@jian-lin
Copy link

nix-update in Nixpkgs does not have this patch, so it keeps opening "wrong" PRs such as NixOS/nixpkgs#342493.

What about cutting a new release or adding this patch to Nixpkgs?

@Mic92
Copy link
Owner

Mic92 commented Sep 18, 2024

release added.

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.

Github releases may not be the latest
3 participants