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

Support prerelease with ModuleFast and make PSResourceGet the default method #453

Merged
merged 16 commits into from
Jan 9, 2024

Conversation

johlju
Copy link
Collaborator

@johlju johlju commented Dec 21, 2023

Pull Request

Pull Request (PR) description

Fixed

  • ModuleFast now supports resolving individual pre-release dependencies
    that is part of RequiredModules.psd1. This only works when setting the
    parameter value ModuleFastBleedingEdge to $true in the configuration
    file Resolve-Dependencies.psd1. When ModuleFastBleedingEdge is enabled
    it is also possible to specify NuGet version ranges
    in RequiredModules.psd1, although then the file is not compatible with
    PSResourceGet or PSDepend (so no fallback can happen).
  • Update PSResourceGet to default to v1.0.1 if no version is passes in parameter
    or specific version is configured.
  • Templates was changed to use PSResourceGet as the default method
    of resolving dependencies. It is possible to change to the method
    PowerShellGet & PSDepend by changing the configuration.

Closes #450
Fixes #445

Task list

  • The PR represents a single logical change. i.e. Cosmetic updates should go in different PRs.
  • Added an entry under the Unreleased section of in the CHANGELOG.md as per format.
  • Local clean build passes without issue or fail tests (build.ps1 -ResolveDependency).
  • Documentation added/updated in README.md.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju
Copy link
Collaborator Author

johlju commented Dec 21, 2023

This need to be documented in the README.md. But gonna wait a while to see what more changes happen around resolving dependencies.

@johlju johlju force-pushed the fix/prerelease-support-for-ModuleFast branch from 3bc5326 to a61e59d Compare January 6, 2024 19:07
@johlju
Copy link
Collaborator Author

johlju commented Jan 6, 2024

Todo:

  • Wait on ModuleFast full release (and make sure there are no breaking changes in that)
  • Update documentation and clean up diff
  • Copy needed changes to the template files
  • Default templates to use PSResourceGet
  • Document in template files how to revert to PowerShellGet (if needed)

@johlju johlju marked this pull request as ready for review January 6, 2024 19:17
Copy link

codecov bot commented Jan 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dc2c207) 81% compared to head (a4fe355) 81%.

Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #453   +/-   ##
===================================
  Coverage    81%    81%           
===================================
  Files        44     44           
  Lines      2328   2328           
===================================
  Hits       1904   1904           
  Misses      424    424           

@johlju johlju changed the title Support prerelease with ModuleFast Support prerelease with ModuleFast and make PSResourceGet the default method Jan 7, 2024
@johlju johlju added the needs review The pull request needs a code review. label Jan 7, 2024
@johlju johlju force-pushed the fix/prerelease-support-for-ModuleFast branch from 9f84426 to 0f35500 Compare January 8, 2024 19:46
Copy link
Collaborator Author

@johlju johlju left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions


CHANGELOG.md line 17 at r1 (raw file):

  modules when using `Get-Module -ListAvailable`. The templates already has
  this configuration.
- Update PSResourceGet to default to v1.0.1 if no version is passes in parameter

Typo


README.md line 93 at r1 (raw file):

It is possible to use [PSResourceGet](https://github.com/PowerShell/PSResourceGet)
to resolve dependencies. PSResourceGet works with WIndows PowerShell and

Typo


README.md line 150 at r1 (raw file):

   'ComputerManagementDsc' =  ':[9.1.0-preview0002]'

   # Must be greater than 9.1.0-preview0002

higher version


README.md line 153 at r1 (raw file):

   'ComputerManagementDsc' =  '>9.1.0-preview0002'

   # Must be less than 9.1.0-preview0002

lower version


README.md line 162 at r1 (raw file):

   'ComputerManagementDsc' =  '>=9.1.0-preview0002'

   # Must be greater than 9.1.0-preview0002

Duplicate example


Resolve-Dependency.ps1 line 738 at r1 (raw file):

                $modulesToSave = @(
                    'PSDepend'  # Always include PSDepend for backward compatibility.

Extra white space


Resolve-Dependency.ps1 line 876 at r1 (raw file):

                        {
                            $modulesToSave += @{
                                Name    = $requiredModule.Name

Extra white space

Copy link
Collaborator Author

@johlju johlju left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 5 of 5 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)

@johlju
Copy link
Collaborator Author

johlju commented Jan 9, 2024

I'm merging this. Tested generating and building a SimpleModule with this change. Let me know if there are any issues and I will fix them as soon as possible.

@johlju
Copy link
Collaborator Author

johlju commented Jan 9, 2024

/az run

@johlju johlju merged commit 18a8ecb into gaelcolas:main Jan 9, 2024
13 checks passed
@johlju johlju deleted the fix/prerelease-support-for-ModuleFast branch January 9, 2024 14:02
@johlju johlju removed the needs review The pull request needs a code review. label Jan 9, 2024
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.

A mistake in the psresourceget section of the README.md
1 participant