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

Allow disabling MinVer #303

Merged
merged 2 commits into from
Dec 22, 2019
Merged

Allow disabling MinVer #303

merged 2 commits into from
Dec 22, 2019

Conversation

slang25
Copy link
Contributor

@slang25 slang25 commented Dec 7, 2019

I've noticed that with solutions of many projects, the total MinVer execution time can exceed a second, so thought it would be useful to add an option to disable it when developing locally.

@slang25
Copy link
Contributor Author

slang25 commented Dec 7, 2019

Hmmm, the MYGET_ADAMRALPH_CI_API_KEY secret is not getting passed, is that cause I'm not you?

@adamralph
Copy link
Owner

@slang25 thanks for raising this!

My first reaction was to see if there's a way to skip a given target using some MSBuild magic but I can't find anything, so I guess something like this is required to allow skipping.

I wonder if the name should be MinVerSkip to align with the rest of the properties?

Hmmm, the MYGET_ADAMRALPH_CI_API_KEY secret is not getting passed, is that cause I'm not you?

Yeah, I think so. I'll see if I can fix that.

@bording
Copy link
Collaborator

bording commented Dec 8, 2019

@adamralph Another option to consider here would be to cache the results to disk, so that the version only needs to be calculated once, which would speed everything up without having to disable MinVer in your projects. Conditionally disabling MinVer could lead to bugs where you've accidentally disabled MinVer when you didn't intend to.

README.md Outdated Show resolved Hide resolved
Co-Authored-By: Ivan Maximov <[email protected]>
@slang25
Copy link
Contributor Author

slang25 commented Dec 8, 2019

Good idea on the property name, done.

On caching, that's an interesting one. We'd always want to execute git to see if we need to bust a cache, so we wouldn't be putting much of the time saving behind the cache. There could be caching done at a solution level, so that the first git command does the work and the others use the result.

It feels like too many moving parts for the benefit. With the ability to skip, it's something you have to add explicitly, we can't stop people getting it wrong, but there's something to be said for the simplicity of it. I think it's better than at the moment, where you might be tempted to put a condition on the PackageReference, but no realise that if your CI runs the restore in a separate step you don't have a Configuration value, so it could skip when you didn't want it to (ask me how I know 🤦‍♂️, not using MinVer but same scenario).

@bording
Copy link
Collaborator

bording commented Dec 9, 2019

On caching, that's an interesting one. We'd always want to execute git to see if we need to bust a cache, so we wouldn't be putting much of the time saving behind the cache. There could be caching done at a solution level, so that the first git command does the work and the others use the result.

I'm certainly not suggesting that it wouldn't be more complex, but other versioning tools already do something similar, so I think it's something that could be considered here, and I have ideas for how it could be done without needing to run git, so it could end up saving time.

However, this PR isn't the place for going into more detail. I'll open a new issue.

it. I think it's better than at the moment, where you might be tempted to put a condition on the PackageReference, but no realize that if your CI runs the restore in a separate step you don't have a Configuration value, so it could skip when you didn't want it to (ask me how I know 🤦‍♂️, not using MinVer but same scenario).

Yeah, when I first saw this PR, I was thinking "Why not just condition the package reference?" but came to the conclusion that it would be a bad idea to alter the restore state like that! 😄

@slang25
Copy link
Contributor Author

slang25 commented Dec 9, 2019

@bording Ah I understand now, yeah it sounds like a good idea and one for a separate issue but I see why you mention it.

@adamralph adamralph added the enhancement New feature or request label Dec 11, 2019
@slang25
Copy link
Contributor Author

slang25 commented Dec 22, 2019

@adamralph Let me know if there's anything you want doing with this, or if it needs further discussion.

@adamralph
Copy link
Owner

@slang25 sorry for the delay. This is good to go. I'll push out a pre-release ASAP and let you know.

@adamralph adamralph merged commit c231fc7 into adamralph:master Dec 22, 2019
@adamralph adamralph added this to the 2.1.0 milestone Dec 22, 2019
@adamralph adamralph changed the title Allow conditionally skipping MinVer Allow disabling MinVer Dec 22, 2019
@adamralph
Copy link
Owner

@slang25 I've pushed this out in 2.1.0-rc.1. Care to give it a try?

@adamralph adamralph mentioned this pull request Dec 22, 2019
12 tasks
@adamralph
Copy link
Owner

ping @slang25 ☝️

@slang25
Copy link
Contributor Author

slang25 commented Feb 9, 2020

Sorry for not getting back to you @adamralph, it works great! 👍

@adamralph
Copy link
Owner

Thanks @slang25, good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants