Skip to content
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

[bug] conan upload --list errors on empty recipe list #14203

Closed
n-morales opened this issue Jun 30, 2023 · 4 comments · Fixed by #14254
Closed

[bug] conan upload --list errors on empty recipe list #14203

n-morales opened this issue Jun 30, 2023 · 4 comments · Fixed by #14254
Assignees

Comments

@n-morales
Copy link
Contributor

n-morales commented Jun 30, 2023

Environment details

  • Operating System+version:
    Manjaro Linux 23.0.0

  • Compiler+version:
    N/A

  • Conan version:
    Conan version 2.0.7

  • Python version:
    Python 3.11.3

Steps to reproduce

  1. Create a list file as follows (can be generated from something like conan list --graph install_graph.json --graph-binaries build --format json)
{
  "Local Cache": {}
}
  1. conan upload --remote foo --list list.json
  2. Conditional check fails: https://github.com/conan-io/conan/blob/release/2.0/conan/cli/commands/upload.py#L84-L85

Note that I believe this should work since some automation workflows in CI may result in an empty list if a specific package was just cached and --graph-binaries build is set in the list command. I think the conditional check listed below should probably only error if the --list argument was not provided.

Logs

$> conan upload --remote foo --list list.json
ERROR: No recipes found matching pattern 'None'
@AbrilRBS AbrilRBS self-assigned this Jun 30, 2023
@AbrilRBS
Copy link
Member

AbrilRBS commented Jun 30, 2023

Hi @n-morales, thanks a lot for your report and taking the time to diagnose the error!

What you describe seems like a valid use case to me, if you would like to contribute a PR now that you have checked the code, we can discuss it there, but no worries if not :)
(I can't promise it would get merged if the team thinks otherwise of the error, but the discussion is at least worth having, so thanks for bringing it up!)

@memsharded
Copy link
Member

I think that for automation purposes, allowing an empty list makes sense. So this could be changed, and relaxed for the --list argument. It sounds that an info/warning message would be useful, I'd add it too.

So @n-morales would you like to contribute it as you as @RubenRBS suggested? Otherwise, please tell us and we will do it, no problem at all. Thanks!

@n-morales
Copy link
Contributor Author

n-morales commented Jul 3, 2023

@RubenRBS @memsharded I could do it -- do you have suggestions for where I should be putting a unit test for it?

@memsharded
Copy link
Member

Probably https://github.com/conan-io/conan/blob/release/2.0/conans/test/integration/command_v2/test_combined_pkglist_flows.py#L9 is the best, as it contains other upload --list tests. But no need to reuse the fixture with previous data,

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

Successfully merging a pull request may close this issue.

3 participants