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

Package version normalization is not being applied everywhere #3174

Closed
4 tasks done
vexx32 opened this issue May 31, 2023 · 1 comment · Fixed by #3175
Closed
4 tasks done

Package version normalization is not being applied everywhere #3174

vexx32 opened this issue May 31, 2023 · 1 comment · Fixed by #3175

Comments

@vexx32
Copy link
Member

vexx32 commented May 31, 2023

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.

What You Are Seeing?

When using choco upgrade --noop 7zip with 7zip installed, in some cases it seems to not be applying version normalization and shows two slightly different version numbers:

PS> choco upgrade --noop 7zip -r
7zip|22.1.0|22.1|false

What is Expected?

The upgrade command should be normalizing both version numbers it shows so as to avoid confusion.

How Did You Get This To Happen?

  1. choco install 7zip
  2. choco upgrade --noop 7zip

System Details

  • Operating System: Win11
  • Windows PowerShell version: 5.1
  • Chocolatey CLI Version: 2.0.0
  • Chocolatey Licensed Extension version: 6.0.0
  • Chocolatey License type: Business
  • Terminal/Emulator: Microsoft Terminal

Installed Packages

7zip 22.1.0

Output Log

https://gist.github.com/vexx32/568fb18678c8accebd43f7f2fd04f238

Additional Context

No response

@vexx32 vexx32 added the Bug label May 31, 2023
vexx32 added a commit to vexx32/choco that referenced this issue May 31, 2023
Went through all references to `ToStringSafe` which were being called on
a NuGetVersion instance and changed them all to
`ToNormalizedStringChecked`.

Additionally, found a place in the upgrade dry-run code that was just
missing a call to this method and outputting a non-normalized version
string and added it.
AdmiringWorm pushed a commit to vexx32/choco that referenced this issue Jun 1, 2023
Went through all references to `ToStringSafe` which were being called on
a NuGetVersion instance and changed them all to
`ToNormalizedStringChecked`.

Additionally, found a place in the upgrade dry-run code that was just
missing a call to this method and outputting a non-normalized version
string and added it.
AdmiringWorm pushed a commit to vexx32/choco that referenced this issue Jun 1, 2023
Went through all references to `ToStringSafe` which were being called on
a NuGetVersion instance and changed them all to
`ToNormalizedStringChecked`.

Additionally, found a place in the upgrade dry-run code that was just
missing a call to this method and outputting a non-normalized version
string and added it.
@gep13 gep13 added this to the 2.1.0 milestone Jun 5, 2023
gep13 pushed a commit to vexx32/choco that referenced this issue Jun 5, 2023
Went through all references to `ToStringSafe` which were being called on
a NuGetVersion instance and changed them all to
`ToNormalizedStringChecked`.

Additionally, found a place in the upgrade dry-run code that was just
missing a call to this method and outputting a non-normalized version
string and added it.
gep13 added a commit that referenced this issue Jun 5, 2023
(#3174) Apply version number normalizing consistently
@gep13 gep13 added 4 - Done and removed 3 - Review labels Jun 7, 2023
@gep13 gep13 changed the title Version normalization is not being applied everywhere Package version normalization is not being applied everywhere Jun 7, 2023
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 26, 2023
In a previous change we normalized all versions that was being used
in Chocolatey CLI. This caused certain packages that uses non-normalized
version numbers to start failing to look up additional information in other
products.

To work around this problem we need to store the non-normalized version
of the package when scripts are being ran. This is done by adding a new
environment variable that can be used, this environment variable is considered
private and is not for public consumption.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 26, 2023
In a previous change we normalized all versions that was being used
in Chocolatey CLI. This caused certain packages that uses non-normalized
version numbers to start failing to look up additional information in other
products.

To work around this problem we need to store the non-normalized version
of the package when scripts are being ran. This is done by adding a new
environment variable that can be used, this environment variable is considered
private and is not for public consumption.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 27, 2023
In a previous change we normalized all versions that was being used
in Chocolatey CLI. This caused certain packages that uses non-normalized
version numbers to start failing to look up additional information in other
products.

To work around this problem we need to store the non-normalized version
of the package when scripts are being ran. This is done by adding a new
environment variable that can be used, this environment variable is considered
private and is not for public consumption.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue Jun 27, 2023
In a previous change we normalized all versions that was being used
in Chocolatey CLI. This caused certain packages that uses non-normalized
version numbers to start failing to look up additional information in other
products.

To work around this problem we need to store the non-normalized version
of the package when scripts are being ran. This is done by adding a new
environment variable that can be used, this environment variable is considered
private and is not for public consumption.
gep13 added a commit that referenced this issue Jun 27, 2023
gep13 added a commit that referenced this issue Jun 29, 2023
* release/2.1.0: (52 commits)
  (maint) If statement formatting change
  (#3224) Add Assembly Loaded configuration option
  (maint) Resave without BOM
  (#3224) Update version check tests
  (#3174) Store non-normalized package version
  (maint) Add required whitespace
  (#3225) Add Pester Tests to ensure environment
  (#3201 #3225) Re-instate setting of config values
  (maint) Remove env variable for release version
  (maint) Fix encoding of file
  (#3194) Add tab completion for cache command
  (#2854) Re-save file with UTF-8 with BOM
  (#3218) Update Tab Expansion to use Test-Path
  (#3218) Remove try catch block for tab completion
  (build) Use latest Chocolatey.Cake.Recipe package
  (#2854) Do Write-Error instead of Write-Warning
  (#2854) Pester tests to Get-ChocolateyConfigValue
  (maint) Resave Get-ChocolateyConfigValue as CRLF
  (#2854) Add helper to read config values
  (#3214) Add Pester tests to ensure cache cleared
  ...
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.1.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

gep13 added a commit that referenced this issue Jun 29, 2023
* master:
  (maint) If statement formatting change
  (#3224) Add Assembly Loaded configuration option
  (maint) Resave without BOM
  (#3224) Update version check tests
  (#3174) Store non-normalized package version
  (maint) Add required whitespace
  (#3225) Add Pester Tests to ensure environment
  (#3201 #3225) Re-instate setting of config values
  (maint) Remove env variable for release version
  (maint) Fix encoding of file
  (#3194) Add tab completion for cache command
  (#2854) Re-save file with UTF-8 with BOM
  (#3218) Update Tab Expansion to use Test-Path
  (#3218) Remove try catch block for tab completion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants