-
-
Notifications
You must be signed in to change notification settings - Fork 637
Add selfupdate_enable config and respect auto_answer when auto updating #927
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
Conversation
|
Hi, @felipecrs. To clarify, do you mean to prevent the self-update check from happening in a CI environment, or do I misunderstand your intent? If this is indeed the problem you are facing, we already have a config variable called |
|
Hi, @marc0der. The The new configuration Different things, right? To be very specific with you, in scripts I run for example |
|
This issue can be replicated: ❯ docker run -it --rm mcr.microsoft.com/vscode/devcontainers/java:0.201.5-15 bash -c 'echo "sdkman_auto_selfupdate=false" > $SDKMAN_DIR/etc/config && touch -d 20120101 $SDKMAN_DIR/var/delay_upgrade && exec bash -ic "sdk version"'
We periodically need to update the local cache. Please run:
$ sdk update
==== BROADCAST =================================================================
* 2021-06-18: mvnd 0.5.2 available on SDKMAN! https://git.io/Jn0Kl
* 2021-06-17: micronaut 3.0.0-M2 available on SDKMAN!
* 2021-06-15: micronaut 2.5.6 available on SDKMAN!
================================================================================
SDKMAN 5.11.2+698
ATTENTION: A new version of SDKMAN is available...
The current version is 5.11.5+713, but you have 5.11.2+698.
Would you like to upgrade now? (Y/n): |
|
Hey @felipecrs, I understand the problem now. Could we make the naming of this config a little clearer to reflect the what, not the how? How about calling it |
|
Sure! But isn't the existence of both |
|
The name Incidentally, the associated changes in the sdkman-hooks service need to be made in the install and selfupdate scripts. |
But the new configuration is not removing this ability, it's available there with Technically speaking I know exactly the difference between them as I'm the one who proposed, but practically speaking, I'm just wondering if there would be a real use case for both configs. Either the person wants to disable both or no. |
|
This really is quite different, and most certainly a feature used by many people. Think about developers who are using this on their machines (as opposed to in a CI environment) who don't want to be asked if the next update should/shouldn't be installed. For this very scenario, we have auto-update. |
|
What about this existing config: # make sdkman non-interactive, preferred for CI environments
sdkman_auto_answer=true|falseShould not it be respected? If it should, there would not be a point for |
|
So I believe the optimal solution would be to:
|
|
I totally agree with what you are proposing, but the name of BTW, the "auto" in |
|
@marc0der good! I will work on it. |
Well, it could be what it was intended to mean, but still In context, you can turn on/off the On the other hand: Anyway, I'm just discussing to make sure we introduce a good config name to prevent future refactors/breaking changes. |
|
I'm happy with |
|
@felipecrs any update on this one? |
|
@marc0der I believe all the changes are ready to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, just some minor comments on this PR.
Also, we require the changes to be made in the sdkman-hooks service.
|
@marc0der I made the changes. Most of them was due to my lack of attention, while the others I replied you in their own conversation. |
This also deprecates the auto_selfupdate config.
|
@marc0der all done. |
Is-Depended-By: sdkman/sdkman-cli#927
This also deprecates the auto_selfupdate config.
The automatic version check makes the things a lot harder to script in non-attended environments -- such as CI, as it keeps waiting for a response if an updated version is found.
Also, I use my own tool to manage my updates system widely, which I run automatically.
Fixes #925
Depends-On: sdkman/sdkman-hooks#28
Depends-On: sdkman/sdkman-website-playframework#49