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

upgrade - when a prerelease is installed, it should upgrade to latest prerelease unless excluded - typically seen in choco upgrade all #686

Closed
ScottRFrost opened this issue Apr 11, 2016 · 14 comments

Comments

@ScottRFrost
Copy link

ScottRFrost commented Apr 11, 2016

If you do "choco upgrade all -y" and it encounters a package that's newer than newest, perhaps it should check prerelease or at least offer to do so.

Current:
chocolatey v0.9.10-beta-20160402 is newer than the most recent.

Proposed:
chocolatey v0.9.10-beta-20160402 is newer than the most recent. Would you like to check prereleases for chocolatey? [y] [n]

Notes

NOTE: admin edit to add notes for breaking change

When you run choco upgrade all, it never catches the prereleases. However if you run choco upgrade all --pre, it may upgrade some of your stable installs to prereleases. Neither of these situations are desirable. So by default, we've made it so that choco upgrade all just does the right thing, which is to upgrade your stable releases to the latest stable release and your prerelease packages will upgrade to the absolute latest available, whether that be stable or prerelease. If you need to change the behavior back to the old way for upgrade all, simply add the --exclude-prerelease option.

@ferventcoder
Copy link
Member

In the case of automated unattended scripts, how do you see it working?

@ScottRFrost
Copy link
Author

Well, it would be dangerous to ever run "choco upgrade all -y -pre" because then it would upgrade ALL of your stuff to prerelease versions. Perhaps you could add a flag "-includepre" or something that upgrades packages that are already prerelease to a newer prerelease, but leaves stable packages alone (and does not upgrade them to prerelease versions).

This flag would allow unintended scripts to function without blocking waiting for y/n while still upgrading your prerlease packages to the latest bits.

@ferventcoder
Copy link
Member

@ScottRFrost that makes way too much sense 👍

@ferventcoder ferventcoder added this to the 0.9.10.x milestone Apr 11, 2016
@eeevans
Copy link

eeevans commented Sep 6, 2016

I'd like to work on this feature and tbh I've already got a lot of the code in place other than the prompting if run without the -includepre switch...I was just wondering if you really want to do that or just spit out info messages informing of the switch to allow it.

@ferventcoder
Copy link
Member

ferventcoder commented Sep 6, 2016

@eeevans let's see what you have so far.

@eeevans eeevans mentioned this issue Sep 6, 2016
@ferventcoder ferventcoder self-assigned this Mar 19, 2017
@ferventcoder ferventcoder changed the title Feature Req - 'choco upgrade all' should prompt to check prerelease if pkg is newer than most recent 'choco upgrade all' should prompt to check prerelease if pkg is newer than most recent Mar 19, 2017
@ferventcoder ferventcoder modified the milestones: 0.10.4, 0.10.x Mar 19, 2017
@ferventcoder ferventcoder changed the title 'choco upgrade all' should prompt to check prerelease if pkg is newer than most recent When a prerelease is installed, it should upgrade to latest prerelease unless excluded - typically seen in choco upgrade all Mar 19, 2017
@ferventcoder
Copy link
Member

So this feature will go into 0.10.4 like this - if you have prereleases installed it will upgrade them without needing to explicitly specify prerelease. This will allow everything to upgrade automatically. When it is a prerelease and the latest version is pre or stable, that is what it will upgrade to.

When you want the old behavior, just add --exclude-prerelease. I've tagged this with breaking change as it may have an effect on someone's workflow out there.

@ferventcoder
Copy link
Member

This will be in 0.10.4

ferventcoder added a commit that referenced this issue Mar 19, 2017
When a prerelease is installed, it should automatically be upgraded to
the newest absolute version (prerelease or stable) unless
`--exclude-prerelease` is specified. This means when running `choco
upgrade all`, all packages will be upgraded automatically in a way that
makes sense.
ferventcoder added a commit that referenced this issue Mar 19, 2017
- upgrade existing package with prerelease available but without
prerelease specified
- Upgrading an existing package with prerelease available and
prerelease specified
- Upgrade installed prerelease without prerelease specified
- Upgrade installed prerelease with prerelease available with
`--exclude-prerelease`
- Upgrade all with prereleases installed
- Upgrade all with prereleases installed with `--exclude-prerelease`
specified
ferventcoder added a commit that referenced this issue Mar 19, 2017
* stable:
  (GH-1098) Get-FtpFile - change int to long / improve error handling
  (docs) update generated docs
  (GH-1187) Get-ChocolateyUnzip - support both archs
  (GH-1039) Remove quotes before testing path
  (GH-686) Upgrade Scenarios for Prereleases
  (GH-686) Upgrade Prereleases
  (GH-1151) Option - Stop on first package failure
  (GH-902) Fix: User changed to SYSTEM during env update
@eeevans
Copy link

eeevans commented Mar 19, 2017 via email

@FranklinYu
Copy link
Contributor

If we upgrade with --exclude-prerelease, will the flag of remembered --pre be removed (forgotten)? For example, I upgrade from 1.0 to 1.1-rc1 with --pre, then upgrade to 1.1 with --exclude-prerelease, will it still upgrade to 1.2-rc1 when I cup all?

@bc3tech
Copy link
Contributor

bc3tech commented Nov 18, 2019

@ferventcoder
Consider reopening; this doesn't work if your prerelease pkg has a prerelease dependency - it'll fail the upgrade of the meta pkg saying the dependency can't be found (unless you run with -pre)

Or I can file a new issue.

@ferventcoder
Copy link
Member

@bc3tech that would be a separate issue.

@ferventcoder ferventcoder changed the title When a prerelease is installed, it should upgrade to latest prerelease unless excluded - typically seen in choco upgrade all upgrade - when a prerelease is installed, it should upgrade to latest prerelease unless excluded - typically seen in choco upgrade all Feb 4, 2020
@ferventcoder
Copy link
Member

#1957 follow on - upgrade here doesn't also apply to dependencies that are prereleases.

@bc3tech
Copy link
Contributor

bc3tech commented Feb 4, 2020

This should be re-opened:

C:\Users\brand> cup all -y
Chocolatey v0.10.15 Professional
Upgrading the following packages:
all
By upgrading you accept licenses for the packages.
...
You have vivaldi v2.11.1805.3-snapshot installed. Version 2.11.1811.3-snapshot is available based on your source(s).
vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.
vivaldi package files upgrade completed. Performing other installation steps.
The upgrade of vivaldi was NOT successful.
vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.

You have vivaldi.portable v2.11.1805.3-snapshot installed. Version 2.11.1811.3-snapshot is available based on your source(s).
vivaldi.portable not upgraded. An error occurred during installation:
 Updating 'vivaldi.portable 2.11.1805.3-snapshot' to 'vivaldi.portable 2.11.1811.3-snapshot' failed. Unable to find a version of 'vivaldi' that is compatible with 'vivaldi.portable 2.11.1811.3-snapshot'.
vivaldi.portable package files upgrade completed. Performing other installation steps.The upgrade of vivaldi.portable was NOT successful.
vivaldi.portable not upgraded. An error occurred during installation:
 Updating 'vivaldi.portable 2.11.1805.3-snapshot' to 'vivaldi.portable 2.11.1811.3-snapshot' failed. Unable to find a version of 'vivaldi' that is compatible with 'vivaldi.portable 2.11.1811.3-snapshot'.

Chocolatey upgraded 2/83 packages. 2 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

@chocolatey chocolatey deleted a comment from ScottRFrost Feb 5, 2020
@ferventcoder
Copy link
Member

@bc3tech can we please stop asking to reopen an issue? There is maybe a regression, but this issue was fixed in the release it went into. The question of whether it works if the prerelease has prerelease dependencies is a separate issue IMHO. It's likely a bug, but still not the same issue. If it is the same issue, that's called a regression and it still opens as a new issue b/c it cropped back up again later.

However, this issue is whether a prerelease would move to find and upgrade and it does, even based on your log. It found the prerelease: You have vivaldi v2.11.1805.3-snapshot installed. Version 2.11.1811.3-snapshot is available based on your source(s).

Then it was prevented from upgrading based on dependencies. That means we either have a regression or a followup issue to handle prereleases with dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants