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

Fixes bug with nuspec dependency version range calculation for RequiredModules #1784

Merged

Conversation

afroz429
Copy link

@afroz429 afroz429 commented Jan 24, 2025

PR Summary

Fix for #1777. The PR generates correct nuspec dependency version range for modules specified in RequiredModules section of the module manifest file.

Per the nuget version reference doc

  • When RequiredVersion is specified, the version range is set as [RequiredVersion] which is an exact match

  • When MaximumVersion is specified, the version range is set as (, MaximumVersion] which is <=MaximumVersion

  • When ModuleVersion is specified, the version range is set as ModuleVersion which is >=ModuleVersion. This notation is used since publish-module uses the same notation

  • When both ModuleVersion and MaximumVersion are specified, the version range is set to [ModuleVersion, MaximumVersion] which is exact range, inclusive

  • Added Pester tests

PR Context

Fix for #1777

PR Checklist

@afroz429
Copy link
Author

@microsoft-github-policy-service agree

…hen versions are specified in RequiredModules section

Fixes bug with generated nuspec dependency version range when RequiredVersion,MaxiumumVersion and ModuleVersion are specified in RequiredModules section
@afroz429 afroz429 force-pushed the afroz429-requiredmodules-requiredversion branch from 4968cef to eb2443b Compare January 24, 2025 21:27
@afroz429 afroz429 marked this pull request as ready for review January 24, 2025 21:30
Copy link
Member

@anamnavi anamnavi left a comment

Choose a reason for hiding this comment

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

Thanks for creating this thorough PR @afroz429 I pushed a few commits to fix a separate test that wasn't cleaning up files written to unzippedPath, which meant when your test extracted files to that path it was throwing an error about needing to overwrite them. I also wrapped the code that checks which type of version the dependency version hashtable contains in an if block, for the case where the dependency name was provided without any version information.

@anamnavi anamnavi merged commit 5de7cbe into PowerShell:master Mar 5, 2025
12 checks passed
@afroz429
Copy link
Author

afroz429 commented Mar 5, 2025

@anamnavi Thanks for cleaning up the PR and merging it. What time frame will this change release?

@adityapatwardhan
Copy link
Member

@afroz429 we are planning a release this week. Thanks for the contribution!

@anamnavi
Copy link
Member

anamnavi commented Mar 7, 2025

@afroz429 the release with this change went out today, it's present in the latest stable version 1.1.1 of PSResourceGet thank you for the contribution!

@afroz429 afroz429 deleted the afroz429-requiredmodules-requiredversion branch March 7, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants