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

Prevent downgrading on old version in mirror #889

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ghyatzo
Copy link
Contributor

@ghyatzo ghyatzo commented Apr 6, 2024

should fix #250

Copy link
Collaborator

@davidanthoff davidanthoff left a comment

Choose a reason for hiding this comment

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

I think this would also disable the ability to switch from a prerelease channel to the release channel, where we want a downgrade to happen. So I don't think we can merge this as is...

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Apr 15, 2024

I completely missed that possibility, sorry.
I tried to reason about it in terms of detecting a channel change, but as far as I could tell there is no way currently to do it.
Instead I opted for simplifying it, and just warn and ask the user for input when we detect a downgrade.

I have ready an incomplete patch for it, but there is another issue. What should be the default behaviour when the self update is run non interactlively. Should we default to not downgrade at all? Or install whatever it is found on the channel?

I'd be more towards ignoring any downgrades, to avoid surprises.

for now an example of interaction is the following:

$ juliaup self update
Checking for self-updates on channel: release
You are trying to install version: release-1.14.7, but the currently installed version is newer (or the same).
Do you want to continue? yes
Found new version 1.14.7 on channel release.
Updated Juliaup to version 1.14.7.

Other possible behaviour to consider: if the version is the same, just update normally.

EDIT: I'll push the changes made, with the caveat that they are still incomplete and need the non-interactive scenario to be addressed.

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Apr 16, 2024

I just opted for pushing a complete working version, so that if you agree it's ready. Namely:

  • stop all downgrades (even from different channels) when updating in non-interactive mode ( background process )
  • re-installing the same version proceed normally in all cases.

@ghyatzo ghyatzo force-pushed the patch-noselfdowngrade branch from f5f37f4 to c62d3e0 Compare April 16, 2024 10:47
@ghyatzo ghyatzo force-pushed the patch-noselfdowngrade branch from c62d3e0 to cfc4214 Compare May 15, 2024 15:32
@ghyatzo ghyatzo force-pushed the patch-noselfdowngrade branch from cfc4214 to 9bbaf96 Compare September 4, 2024 13:32
…hing back from a preview version to the release version.
fix: reinstalling same version is not counted as downgrading.
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.

Warn if server version is less than installed version.
2 participants