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 upgrading a pinned package without removing the pin beforehand #2050

Closed
CookieHCl opened this issue May 16, 2020 · 9 comments · Fixed by #2464
Closed

Allow upgrading a pinned package without removing the pin beforehand #2050

CookieHCl opened this issue May 16, 2020 · 9 comments · Fixed by #2464

Comments

@CookieHCl
Copy link

Motivation

I've pinned powershell-core because you mess up if you upgrade PowerShell Core in PowerShell Core.
So when I have to upgrade PowerShell Core, I have to remove pin and upgrade and add pin again.
Specifically, I follow this procedure:

  1. choco upgrade all in PowerShell Core
  2. Checks Powershell Core has an upgrade (with this package is pinned warning message)
  3. Go to safer terminal (such as PowerShell 5.1)
  4. choco pin remove -n=powershell-core in Powershell
  5. choco upgrade powershell-core in Powershell
  6. choco pin add -n=powershell-core in Powershell

The point is someone uses pin for delay upgrades, not to block upgrades forever.

Solution

Add a switch --disable-pin to upgrade.
When this switch is enabled, pinned packages will be upgraded.
choco upgrade powershell-core --disable-pin has same effect with the above procedure 4-6.

Other suggestions

Switch name could be

  • --ignore-pin
  • --exclude-pin
  • --disable-pin-once
@ferventcoder
Copy link
Member

I think this may already be an issue? Or at least something related like install with pin.

@ferventcoder ferventcoder changed the title Add a switch to disable pin when upgrade upgrade: Add a switch to disable pin when upgrade May 24, 2020
@FarrelBuch
Copy link

Hear, Hear!
I could not agree more.
I asked this exact question on StackExchange Super User.

At the least, it would be nice if the documentation for pinning explicitly stated that there is no way to temporarily bypass the pin. One can only manually remove the pin, upgrade and repin.

Notwithstanding my asking for more, Chocolatey is really good. Thank you.

@nkrepo
Copy link

nkrepo commented May 28, 2021

I think this may already be an issue? Or at least something related like install with pin.

@ferventcoder is there any progress with that feature ?

@nascentt
Copy link

The Chocolatey docs specifically recommend using pin as a solution for auto-updating apps like Firefox and Chrome, as apparently auto synching doesn't work for package updates. Yet that leaves no way to manually roll out packages updates to the hosts that don't keep those auto-updating applications constantly open.

I don't understand why pinning doesn't just only prevent "choco upgrade all", or hide the package in "choco outdated". Preventing the package from updating at all is a poor solution especially when there's no administrative way to just issue a package upgrade without fiddling around with toggling the pin off and on again.

@TheCakeIsNaOH
Copy link
Member

no administrative way to just issue a package upgrade without fiddling around with toggling the pin off and on again.

@nascentt how about using upgradeAllExceptions instead of pins? See choco config -h for more info on the setting.

@nascentt
Copy link

nascentt commented Sep 2, 2021

no administrative way to just issue a package upgrade without fiddling around with toggling the pin off and on again.

@nascentt how about using upgradeAllExceptions instead of pins? See choco config -h for more info on the setting.

strange, I don't see upgradeAllExceptions mentioned at all in choco config -h. Additionally, I don't see it documented anywhere, only getting 7 results in google.
Playing around with both methods, I'm unsure of the main use case for one over the other. both require chocolatey admin knowledge to bypassed, and both can be bypassed, neither prevent apps showing up in choco outdated by default, although there is a switch to ignore pinned in choco outdated it's not default. But upgradeAllExceptions is good because it completely hides packages by default, but that's only for upgrade and not outdated so can still confuse users. Also upgradeAllExceptions can be set before/regardless of whether the pack is installed yet (so can be set at build time) whereas pin can only be set after the package has been installed (which is a major limitation) apparently there's yet another issue for fixing this which is outstanding.

I guess neither solution really fixes the underlying issue that choco sync doesn't work for version changes, which should really be fixed.

I do still believe choco upgrade should have a switch to ignore pins the same way choco outdated does though. For both preventing hacky workaround like disable;upgrade;enable, but also consistency.

regarding the name, as choco upgrade has -ignore-pinned I feel the name of the switch on choco upgrade should be the same

choco upgrade --ignore-pinned

@TheCakeIsNaOH
Copy link
Member

Whoops, sorry that should be choco config -l

TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 21, 2021
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 21, 2021
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 24, 2021
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 17, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 17, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 17, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 17, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Mar 21, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 27, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
@TheCakeIsNaOH TheCakeIsNaOH self-assigned this Jul 30, 2022
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Aug 11, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Aug 23, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Sep 23, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Sep 23, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Sep 23, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Sep 23, 2022
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
@gep13 gep13 added this to the 2.3.0 milestone Dec 14, 2023
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 14, 2023
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 14, 2023
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 14, 2023
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 14, 2023
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 9, 2024
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Apr 25, 2024
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
gep13 added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 25, 2024
This commit adds a simple unit test to verify that the --ignore-pin
option appears in the OptionSet that is generated.
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Apr 25, 2024
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
gep13 added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 25, 2024
This commit adds a simple unit test to verify that the --ignore-pin
option appears in the OptionSet that is generated.
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Apr 25, 2024
This adds a switch to the upgrade command to bypass/ignore any pinned
packages. It will write out a warning message if a pinned package is
being upgraded.

The package will remain pinned after the upgrade completes, although
pinned to the new version.
gep13 added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 25, 2024
This commit adds a simple unit test to verify that the --ignore-pin
option appears in the OptionSet that is generated.
@gep13
Copy link
Member

gep13 commented Apr 25, 2024

In order to be consistent with an existing option on the outdated command, the decision was taken to go with --ignore-pinned as the option for this feature.

gep13 added a commit that referenced this issue Apr 25, 2024
(#2050) Upgrade add parameter to ignore pins
@gep13 gep13 added 4 - Done and removed 3 - Review labels Apr 25, 2024
gep13 added a commit that referenced this issue Apr 30, 2024
In a previous commit
(fb22630)
a change was made to remove the pinned source dependencies from the
list of available packages only when we are not ignoring pinned
packages.  While this change was valid, it forgot to populate the
removedSources property with the results of the call to
RemovePinnedSourceDependencies.  This was an oversight, and although
the change was tested locally, a complete execution of all the
integration tests was not performed, which would have caught this
problem.
gep13 added a commit to gep13/choco that referenced this issue May 24, 2024
With the next release of Chocolatey CLI, it is possible to run choco
upgrade --ignore-pinned, rather than first having to run a choco pin
remove command.

This commit adds a Pester test to cover the usage of the
--ignore-pinned option on the upgrade command.  This tests relies on
correct execution of the --pin option on the install command, but this
is tested elsewhere.
corbob pushed a commit to gep13/choco that referenced this issue May 27, 2024
With the next release of Chocolatey CLI, it is possible to run choco
upgrade --ignore-pinned, rather than first having to run a choco pin
remove command.

This commit adds a Pester test to cover the usage of the
--ignore-pinned option on the upgrade command.  This tests relies on
correct execution of the --pin option on the install command, but this
is tested elsewhere.
gep13 added a commit to gep13/choco that referenced this issue May 28, 2024
With the next release of Chocolatey CLI, it is possible to run choco
upgrade --ignore-pinned, rather than first having to run a choco pin
remove command.

This commit adds a Pester test to cover the usage of the
--ignore-pinned option on the upgrade command.  This tests relies on
correct execution of the --pin option on the install command, but this
is tested elsewhere.
@pauby pauby changed the title upgrade: Add a switch to disable pin when upgrade Allow upgrading a pinned package without removing the pin beforehand May 28, 2024
vexx32 pushed a commit to gep13/choco that referenced this issue May 30, 2024
With the next release of Chocolatey CLI, it is possible to run choco
upgrade --ignore-pinned, rather than first having to run a choco pin
remove command.

This commit adds a Pester test to cover the usage of the
--ignore-pinned option on the upgrade command.  This tests relies on
correct execution of the --pin option on the install command, but this
is tested elsewhere.
gep13 added a commit to gep13/choco that referenced this issue May 30, 2024
With the next release of Chocolatey CLI, it is possible to run choco
upgrade --ignore-pinned, rather than first having to run a choco pin
remove command.

This commit adds a Pester test to cover the usage of the
--ignore-pinned option on the upgrade command.  This tests relies on
correct execution of the --pin option on the install command, but this
is tested elsewhere.
gep13 added a commit that referenced this issue Jun 5, 2024
* release/2.3.0: (153 commits)
  (#23) Move call to SetRemotePackageNamesIfAllSpecified
  (#1901) Revert commit to display location
  (maint) Update Authenticode Signature
  (tests) Some minor tweaks for test consistency
  (#310) Set-EnvironmentVariable: delete values properly
  (tests) Remove v2 import tests
  (#310) Fix test issues
  (#310) Fixup v2 compatibility
  (tests) Working on tests during pairing session
  (#2050) Add Pester test for --ignore-pinned option
  (#3381) Add Pester tests for rule command
  (#1144) Add Pester test to cover hash validation
  (#72) Add Pester tests to cover new functionality
  (test) Update assertions for push commands
  (#1310) Add Pester test to validate output
  (#23) Add tests to handle install all
  (#2200) Add test for new enhanced exit code
  (#1764) Add test for new enhanced exit code
  (#1760) Add test for new enhanced exit code
  (#1759) Add test for new enhanced exit code
  ...
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.3.0 🎉

The release is available on:

Your GitReleaseManager bot 📦 🚀

gep13 added a commit that referenced this issue Jun 5, 2024
* master: (37 commits)
  (#310) Fix path to chocolatey.lib files
  (maint) Corrected casing of file
  (#23) Move call to SetRemotePackageNamesIfAllSpecified
  (#1901) Revert commit to display location
  (maint) Update Authenticode Signature
  (tests) Some minor tweaks for test consistency
  (#310) Set-EnvironmentVariable: delete values properly
  (tests) Remove v2 import tests
  (#310) Fix test issues
  (#310) Fixup v2 compatibility
  (tests) Working on tests during pairing session
  (#2050) Add Pester test for --ignore-pinned option
  (#3381) Add Pester tests for rule command
  (#1144) Add Pester test to cover hash validation
  (#72) Add Pester tests to cover new functionality
  (test) Update assertions for push commands
  (#1310) Add Pester test to validate output
  (#23) Add tests to handle install all
  (#2200) Add test for new enhanced exit code
  (#1764) Add test for new enhanced exit code
  ...
josh-cooley added a commit to josh-cooley/choco that referenced this issue Jul 8, 2024
…evelop

* 'develop' of https://github.com/josh-cooley/choco: (145 commits)
  (maint) Add CODEOWNERS files
  (build) Add templated notifications to all builds
  (build) Add verification of source scripts
  (doc) Further tweak docgen for Chocolatey.PowerShell
  (doc) Tweak docgen for Chocolatey.PowerShell
  (chocolatey#3446) Update GenerateDocs.ps1
  (chocolatey#3307) Do not create Tools directory from MSI
  (maint) Do not create Chocolatey directory in MSI
  (chocolatey#310) Fix path to chocolatey.lib files
  (maint) Corrected casing of file
  (chocolatey#23) Move call to SetRemotePackageNamesIfAllSpecified
  (chocolatey#1901) Revert commit to display location
  (maint) Update Authenticode Signature
  (tests) Some minor tweaks for test consistency
  (chocolatey#310) Set-EnvironmentVariable: delete values properly
  (tests) Remove v2 import tests
  (chocolatey#310) Fix test issues
  (chocolatey#310) Fixup v2 compatibility
  (tests) Working on tests during pairing session
  (chocolatey#2050) Add Pester test for --ignore-pinned option
  ...
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.

8 participants