chocolatey / chocolatey/choco

upgrade - add a way to downgrade from prerelease to the latest official version

Open
#2,685 1 comment 0 reactions 0 assignees View on GitHub
0 - Triaging Enhancement
Dominant language
C#
Stars
11.5k
Forks
961
PR merge metrics
No merged PRs in 30d

Description

I sometimes upgrade my company's package on my PC to prerelease version (for a review etc.) and then I want to bring official version back. I have two options:
- Uninstalling and installing the package again without `--pre` flag (performs scripts even if I already am on official version),
- Upgrading to specific official version (requires checking version's number).

I would like to have the third option without drawbacks of the two above, going something like:
`choco upgrade package-name --allow-downgrade --exclude-prerelease`
**Current:**
> package-name v1.0.1-pre is newer than the most recent.
You must be smarter than the average bear...

**Expected:**
> You have package-name v1.0.1-pre installed. Version 1.0.0 is available based on your source(s).

Another flag like "official-only" would also work for me.
Discussion in #686 makes sense to me, but refers to situation when before upgrade there is a package installed that is older than the latest official. In my case, installed package is newer than the latest official.

Contributor guide

Open the contributing guide

Research direction

Start with the upgrade command and its handling of --allow-downgrade and prerelease versions, then read the referenced discussion in #686 for related behavior. Define the version-selection and script-execution cases around an installed prerelease; done means the command selects the latest official version and reports it as expected without the stated drawbacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.