Skip to content
New issue

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

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

Already on GitHub? # to your account

Ability to select to install matching version already available on the current image #356

Open
Piedone opened this issue Dec 14, 2022 · 9 comments
Assignees
Labels
feature request New feature or request to improve the current logic investigation The issue is under investigation

Comments

@Piedone
Copy link

Piedone commented Dec 14, 2022

Description:

Currently, when you set e.g. dotnet-version: '6.0.x' then the action will install the latest 6.0.x version available online. If this is preinstalled on the current runner image, then no actual installation will happen, only a check; if there is a more recent version available for download from Microsoft (like 6.0.1 is preinstalled but 6.0.2 is released) then it'll download and install that version.

This is all good, but my request would be to add an option to always install the locally available version matching dotnet-version, and only fall back to a download if a local version can't be matched. E.g., if 6.0.1 is preinstalled on the runner image, then just use that for dotnet-version: '6.0.x', even if online a 6.0.2 version is also available.

Related: #284

Justification:

For our builds, we want to keep up to date with the patch versions of .NET, the assumption being that those are safe to auto-update to and also useful because they continuously bring bug fixes. So, we want to tell the action "just install whatever's latest for 6.0.x". However, it's not critical that we're always using the latest version right at the moment it's released, we can wait until GHA images are updated in exchange for not paying the penalty of installation (30-120 seconds) in case the preinstalled version is not the most recent one.

Are you willing to submit a PR?
I wouldn't venture into that for now.

@Piedone Piedone added feature request New feature or request to improve the current logic needs triage labels Dec 14, 2022
@IvanZosimov
Copy link
Contributor

Hi, @Piedone 👋 Thanks for the feature request! The setup-dotnet@v3 got the ability to install locally available .NET versions, you can check it by yourself. If the version is not the latest available, for instance, 6.0.x, you should also use the global.json file, to select the required version manually.

I'm not sure that I fully answered your question, so if you have any additional questions feel free to ask me.

@Piedone
Copy link
Author

Piedone commented Dec 14, 2022

Thank you, I'm aware of that and this is what I intended to explain at the start of the issue description too. I clarified the issue, but the point here is to add an option to always install the locally available version matching dotnet-version, and only fall back to a download if a local version can't be matched. E.g., if 6.0.1 is preinstalled on the runner image, then just use that for dotnet-version: '6.0.x', even if online a 6.0.2 version is also available.

@IvanZosimov
Copy link
Contributor

Thank you for the clarification ❤️, We will investigate the ability to add this feature and get back to you with updates!

@Piedone
Copy link
Author

Piedone commented Dec 14, 2022

Thank you for your quick reply!

@ericsampson
Copy link

I'd like this feature too!!

In 97% of my cases, the ability to tell the action to "use the latest preinstalled version that matches my version string, and if none then fall back to downloading the latest matching as per normal" is what I want to do.

Cheers

@ericsampson
Copy link

@IvanZosimov this may be a dumb question, but what is the purpose of the version argument? As the documentation mentions, the latest preinstalled version will be used, unless the user creates a global.json file.

It just seems to me like the version argument is largely useless, and causes people confusion because it's not how users would rightfully expect things to work based on any of the other setup-XXX GitHub actions.

Cheers

@IvanZosimov
Copy link
Contributor

Hi, @ericsampson 👋 Sorry for the late response, I agree with you. We are working on eliminating these confusions.

@nikolai-laevskii nikolai-laevskii added investigation The issue is under investigation and removed needs eyes labels Aug 10, 2023
@nikolai-laevskii nikolai-laevskii self-assigned this Aug 15, 2023
@ericsampson
Copy link

thank you @IvanZosimov , sorry for my late response! ;)

@VAllens
Copy link

VAllens commented Jan 8, 2024

However, even after I create the global.json file specifying that I want to use version 7.0, it still always installs the latest version(8.0), for me, before finally installing the version specified by the dotnet-version parameter(7.0) for me.
This is unnecessary, it wastes a lot of my time, especially with a slow network, and it doesn't seem to cache the installer packages and the install directory for me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature request New feature or request to improve the current logic investigation The issue is under investigation
Projects
None yet
Development

No branches or pull requests

5 participants