Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

choco info command with no package id defined returns 0 packages found rather than provide a warning #2899

Closed
pauby opened this issue Nov 11, 2022 · 2 comments · Fixed by #2904

Comments

@pauby
Copy link
Member

pauby commented Nov 11, 2022

What You Are Seeing?

Running choco info results in:

> choco info
Chocolatey v1.2.0 Business
0 packages found.

What is Expected?

That the command return an error that it needs a package ID passed to it.

How Did You Get This To Happen? (Steps to Reproduce)

  1. Run choco info. Nothing more.

System Details

  • OS Build (In PowerShell run [System.Environment]::OSVersion.version.tostring()): N/A
  • Windows PowerShell version (Run: $PSVersionTable): N/A
  • Chocolatey version (Run choco --version): 1.2.0

Output Log

N/A

@steviecoaster
Copy link
Contributor

@pauby mind if I peek at this one?

steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 12, 2022
Previously when you ran the choco info command without passing a
package id chocolatey would report 0 packages found.

This commit validates the package count and throws an error if either
of the following conditions exist:

No package id was passed, or multiple package ids were passed.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 12, 2022
First we check that we are running the info command, then we do
validation on whether no package ids or multiple package ids have
been passed to the command.

This allows the list command to function as normal, as it happily
accepts 0 or multiple packages.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 13, 2022
Previously when you ran the choco info command without passing a
package id chocolatey would report 0 packages found.

This commit validates the package count and throws an error if either
of the following conditions exist:

No package id was passed, or multiple package ids were passed.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 13, 2022
This commit adds tests to validate the error handling added to the
choco info command.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 13, 2022
Previously when you ran the choco info command without passing a
package id chocolatey would report 0 packages found.

This commit validates the package count and throws an error if either
of the following conditions exist:

No package id was passed, or multiple package ids were passed.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 13, 2022
This commit adds tests to validate the error handling added to the
choco info command.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 13, 2022
Previously when you ran the choco info command without passing a
package id chocolatey would report 0 packages found.

This commit validates the package count and throws an error if either
of the following conditions exist:

No package id was passed, or multiple package ids were passed.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 13, 2022
This commit adds tests to validate the error handling added to the
choco info command.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 13, 2022
Previously when you ran the choco info command without passing a
package id chocolatey would report 0 packages found.

This commit validates the package count and throws an error if either
of the following conditions exist:

No package id was passed, or multiple package ids were passed.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 13, 2022
This commit adds tests to validate the error handling added to the
choco info command.
steviecoaster added a commit to steviecoaster/choco that referenced this issue Nov 14, 2022
Add link to new issue in TODO block for handling multiple package ids
in the info command

Call because() method directly in tests, as we've done the setup there

Remove Exception decorator from error variable in tests
@gep13 gep13 added this to the 2.0.0 milestone Jan 19, 2023
gep13 pushed a commit to steviecoaster/choco that referenced this issue Apr 13, 2023
Previously when you ran the choco info command without passing a
package id chocolatey would report 0 packages found.

This commit validates the package count and throws an error if either
of the following conditions exist:

No package id was passed, or multiple package ids were passed.
gep13 added a commit to steviecoaster/choco that referenced this issue Apr 13, 2023
Previously when you ran the choco info command without passing a
package id chocolatey would report 0 packages found.

This commit validates the package count and throws an error if either
of the following conditions exist:

No package id was passed, or multiple package ids were passed.

Co-authored-by: Stephen Valdinger <stephen@chocolatey.io>
gep13 added a commit to steviecoaster/choco that referenced this issue Apr 13, 2023
Exercise the same checks as in the unit tests, but this time within the
context of Pester, to ensure direct exercising of choco.exe.
gep13 added a commit to steviecoaster/choco that referenced this issue Apr 13, 2023
Exercise the same checks as in the unit tests, but this time within the
context of Pester, to ensure direct exercising of choco.exe.
gep13 added a commit that referenced this issue Apr 13, 2023
(#2899) Info command should warn when no id used
@gep13 gep13 added 4 - Done and removed 3 - Review labels Apr 17, 2023
@gep13 gep13 closed this as completed Apr 17, 2023
@gep13 gep13 changed the title The choco info command on its own returns 0 packages found rather than warn about no package name choco info command with no package id defined returns 0 packages found rather than provide a warning Apr 25, 2023
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

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

Successfully merging a pull request may close this issue.

4 participants