Closed johlju closed 11 months ago
Merging #437 (6044f34) into main (a14049c) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## main #437 +/- ##
===================================
Coverage 81% 81%
===================================
Files 44 44
Lines 2326 2326
===================================
Hits 1906 1906
Misses 420 420
Great idea @johlju thanks! I thin I remember that part of Module fast solution is not using the gallery and instead Justin has some cloudfare shenanigans. It's great for us but maybe not so great for corps environment so we should check and make sure it's documented.
It's a long PR and don't have the time right now, but is it possible to use ResolveDependency.psd1 to set that -UseModuleFast parameter "by default" for the project?
Yes, modules are cached in Cloudflare.
I suggest that ModuleFast shouldn’t be made default in Sampler since there are bugs/restrictions on using ModuleFast. I cannot seem to save individual prerelease modules, and it doesn’t support module versions that are not using semantic versioning (e.g 2.1.0.0). Justin also mentioned it could be breaking changes so we shouldn’t have this as default for that reason too. Also, only works with PowerShell, not Windows PowerShell.
I’m not sure it is possible to use default parameters for scripts (never tried) It works, see next comment. But a user could also just change the pipelines to include UseModuleFast
to pass to build.ps1
, and pass the parameter in command line.
I had a thought it would be controlled by build.yaml but that is not read in until after dependency has been resolved. Thought it be to big of a change to implement that.
I mostly saw ModuleFast as a time saver during the development process and not that much of a time saver for the CI/CD pipeline.
I suggest we have it opt-in for now and when ModuleFast is more stable we can make it default.
It is possible to set the default value using the following - then it will be picked up by the script even if there are no advanced commands in the scripts.
$PSDefaultParameterValues = @{'*:UseModuleFast' = $true}
@gaelcolas when you review, remove whitespace changes and the PR won't be that big. A lot of code are not needed when using ModuleFast so they are wrapped in if-blocks so there are a lot of indentations.
I forgot that we can use Resolve-Dependency.psd1
to set config values! I will update this PR so that it is possible to toggle ModuleFast on or off by config (and be overridden by parameter).
I've got some time lined up this (long) weekend to look at this.
Awesome! I will be ready to rebase (or make changes if that is required) 😃
Pull Request
Pull Request (PR) description
Added
UseModuleFast
to thebuild.ps1
, e.g../build.ps1 -Tasks noop -ResolveDependency -UseModuleFast
. Using ModuleFast will resolve dependencies much faster.Task list
build.ps1 -ResolveDependency
).This change is