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]
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.
In the case of automated unattended scripts, how do you see it working?
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.
@ScottRFrost that makes way too much sense :+1:
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.
@eeevans let's see what you have so far.
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.
This will be in 0.10.4
Awesome, thanks!
On Sun, Mar 19, 2017 at 12:28 PM Rob Reynolds notifications@github.com
wrote:
Closed #686 https://github.com/chocolatey/choco/issues/686.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/chocolatey/choco/issues/686#event-1005921275, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAQpTSdFTkB9P4dyFw_v3MdiyshW0S0Eks5rnWWggaJpZM4IEcCy
.
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?
@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.
@bc3tech that would be a separate issue.
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\chocolateylogs\chocolatey.log).
~~~
@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.