-
Notifications
You must be signed in to change notification settings - Fork 909
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
(#23) Handle all keyword for install #2541
Conversation
For reference, here is the previous (PowerShell) implementation of handling the all keyword: |
76f382c
to
c1731b5
Compare
TODOs:
|
827332a
to
ac8a735
Compare
ac8a735
to
1192880
Compare
359784c
to
82ee402
Compare
82ee402
to
9108aec
Compare
9108aec
to
ebb2082
Compare
9c52293
to
a4557e9
Compare
001fad7
to
3cdfbd6
Compare
3cdfbd6
to
065d4cb
Compare
e4044bb
to
33c96d1
Compare
Some quick thoughts on this one... We would want to limit usage of this to only custom sources, i.e. don't allow this on CCR, or Licensed Feed. And, add a new property to source element, similar to |
33c96d1
to
0b17437
Compare
This should already be the case, see the
Would that be a breaking change for the |
0b17437
to
f9387f1
Compare
f9387f1
to
c5217a2
Compare
@TheCakeIsNaOH thank you for your work on this. I have taken this for a spin, and made a couple of changes based on a conversation that I have had with @pauby. We are happy to move forward with this as-is, with some follow up work with regard to the introduction and usage of another property on the source element in the chocolatey.config file to allow setting |
This renames the SetPackageNamesIfAllSpecified function to SetLocalPackageNamesIfAllSpecified. This is to increase clarity for when the all keyword is implemented, and a function will be added that sets packages names from a remote source.
This adds the ability to install all packages from a source via the all keyword. It runs a list against the current sources, and sets the package names from that list of packages. This functionality is only intended to be used with internal repositories. Therefore a list of public repositories has been added, and the current sources are checked against it to ensure only internal sources are specified.
This throws a not implemented exception if the all keyword is used with non-nuget alternate sources. This is because the all keyword only has handling built in for normal sources, and it is better to throw an error than to have the source try to install a package called "all"
One test to ensure that if the source is CCR that the install fails. One test to ensure that all packages are install from a local source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@TheCakeIsNaOH thanks again for getting this functionality added in! |
Description Of Changes
This adds the ability to install all packages from a source via the all
keyword. It runs a list against the current sources, and sets the
package names from that list of packages.
This functionality is only intended to be used with internal
repositories. Therefore a list of public repositories has been added,
and the current sources are checked against it to ensure only internal
sources are specified.
Renames the
set_package_names_if_all_is_specified function
toset_local_package_names_if_all_is_specified
. This is to increaseclarity with the
set_remote_package_names_if_all_is_specified
now being added.Also this throws a not implemented exception if the all keyword is used with
non-nuget alternate sources. This is because the all keyword only has
handling built in for normal sources, and it is better to throw an
error than to have the source try to install a package called "all"
Motivation and Context
Adding the all keyword for install will bring C# choco up to feature parity with PowerShell choco. Or, at least all of the feature parity issues will be closed.
Testing
Run these to validate that choco will throw an error because public repositories are one of the sources:
Run these to validate that alternate sources fail with a notimplemented exception:
Download these packages to a local folder:
curl
7.81.0
wget
1.21.2
iperf2
2.0.13
iperf2
2.0.14
iperf2
2.0.14.1001-alpha20201022
Run these commands pointing to that local folder to test the behavior of the all keyword:
Ensure that iperf 2.0.14 (i.e. not the prerelease version), wget and curl are installed:
choco install all --allow-unofficial --source=c:\packages
Ensure that the prerelease iperf is installed when prerelease is specified:
choco install all --allow-unofficial --source=c:\packages --pre
Change Types Made
Related Issue
Fixes #23
Change Checklist