-
Notifications
You must be signed in to change notification settings - Fork 904
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
(#357) Add Export Command #1825
Conversation
Does this/could this include pinned packages info? And/or installation/package args? |
There is no reason that additional features couldn’t be added to this new command. I would see that as a separate enhancement issue personally though, as there would be design decisions that would need to be made around the persisted arguments. @ferventcoder and I have spoken briefly about changes that need to happen in this area, and things would need to be flushed out. Regarding the pinned package side of things, are you asking that if a pinned is pinned, this makes it into the packages.config file and when replayed on a new machine, that package also ends up being pinned? |
Fair, that makes sense.
Exactly. So if I pinned VS Code on one machine, it would end up pinned on another machine. |
In the current implementation, pin is a standalone command, I.e. you can’t pin a package during the process of installation. As such, this may need to be implemented as a second pass of the packages.config file to look for pinned packages, or a modification to the install command to also pin when installing. Again, more discussion would need to be had on this topic. |
src/chocolatey/infrastructure.app/commands/ChocolateyExportCommand.cs
Outdated
Show resolved
Hide resolved
src/chocolatey/infrastructure.app/commands/ChocolateyExportCommand.cs
Outdated
Show resolved
Hide resolved
src/chocolatey/infrastructure.app/commands/ChocolateyExportCommand.cs
Outdated
Show resolved
Hide resolved
src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs
Show resolved
Hide resolved
src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs
Outdated
Show resolved
Hide resolved
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.
This looks good, there are a couple of things to address. Take a look at those items.
c888688
to
dc18d24
Compare
is there a timeline for this feature to become available? :-) |
@mwallner I have some tidy up work that I need to do on this PR before it would be ready to be merged in. I haven't forgotten about it, just need to get round to it. So, to answer your question, no, there isn't a timeline 😄 |
a0df909
to
358ded8
Compare
@ferventcoder I believe this is ready for another review. There is one outstanding question I believe with regard to the use of XmlService, which I am not clear on. If this is required, can you let me know exactly how you see this working? Thanks |
@ferventcoder |
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.
Overall this looks good to me, bar one question I had around the design here: #1825 (comment)
So that the method to get_all_installed_packages can be consumed from elsewhere in the codebase. This meant extending the interface for INugetService to include this method as well, otherwise, a concrete reference to an instance of NuGetService would be required, which is not available.
This will allow the creation of a packages.config file of all the currently installed packages on the machine. Usage of this command will be: choco export -o c:/temp/packages.config --include-version-numbers This command is particularly useful when re-building a machine. i.e. First export all packages currently installed on machine, and then replay this packages.config via choco install packages.config on new machine.
To cover the new functionality of the export command. This includes verifying the option sets, what methods are called under certain circumstances, etc.
@vexx32 I have updated this PR based on your feedback. If you could take another look, I would appreciate it. I have also added some Unit Tests since the last review. Thanks |
Apart from those two things, everything here looks good to me! |
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.
Looks good to me, nice work! 💖
This will allow the creation of a packages.config file of all the
currently installed packages on the machine. Usage of this command
will be:
choco export -o c:/temp/packages.config --include-version-numbers
This command is particularly useful when re-building a machine. i.e.
First export all packages currently installed on machine, and then
replay this packages.config via choco install packages.config on new
machine.
Fixes #357