chocolatey-community / chocolatey-azuredevops

Chocolatey Extension for Azure DevOps
MIT License
21 stars 11 forks source link

Allow install/upgrade multi packages #67

Open WenceyWang opened 2 years ago

WenceyWang commented 2 years ago

What I have done

I changed the way the $installPackageId and $upgradePackageId was handled and allow multiple package name will be split into multiple arguments instead of one.

This will fix https://github.com/chocolatey-community/chocolatey-azuredevops/issues/49 .

The following content is copied from https://github.com/chocolatey-community/chocolatey-azuredevops/issues/49

Expected Behavior

Multiple packages are installed.

Current Behavior

Chocolatey can't find "name1 name2" package.

Possible Solution

Support package names separator or update description to not allow multiple packages to be installed.

Steps to Reproduce (for bugs)

- task: ChocolateyCommand@0
  inputs:
    command: 'install'
    installPackageId: 'name1 name2'

Context

Your Environment

WenceyWang commented 2 years ago

@gep13 @ferventcoder @flcdrg @mkevenaar Can you team take a look at this pr and update a version at the marketplace? and maybe also process #65?

pauby commented 2 years ago

@WenceyWang Before we look at this, can you complete the PR template?

WenceyWang commented 2 years ago

@WenceyWang Before we look at this, can you complete the PR template?

OK, I have edited the message, and please review it, as there are only 2 lines changed.

And I think the template itself is very strange for a PR.

JPRuskin commented 2 years ago

So, a few things: First, though this may have been what you expected it to do, this current behaviour (install one package) is valid (if not enforced very well).

i.e. Is this better behaviour if someone passes a Package Version too? What happens if someone wants to pass multiple package versions? Do we need to remove/ignore the package version if multiple packages are passed, or try and install everything to the given version?

Edit: Just noticed that the text on the field does say The id of the package(s) that are to be installed. Fun! Somewhat ignore the above, then. :)

If we do want to go ahead and make this the new behaviour (instead of, for instance, enforcing no spaces in the package ID field), is it worth adding more valid separators, e.g. semicolons / commas?

If we do go ahead, at the very least, we probably also want to update the help text around the field to show an example of this being used and mention any valid separators.

WenceyWang commented 2 years ago

i.e. Is this better behaviour if someone passes a Package Version too? What happens if someone wants to pass multiple package versions?

It's very interesting as choco itself actually accepts a "--version" while multiple package name is given. So it's choco's problem for these counterintuitive command line arguments.

And as there's no package with their name containing whitespace, I don't think any other separators are really necessary.