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

Remove packages when version is asterisk #5346

Merged
merged 5 commits into from Jun 17, 2019

Conversation

Projects
None yet
4 participants
@uilianries
Copy link
Member

commented Jun 12, 2019

When removing a pattern like hello/*@conan/testing, Conan doesn't remove all patterns because all fields (name, version, channel, user) are validated by ConanFileReference. However, when using a pattern like hello*/*@conan/testing, the ConanFileReference won't match the name and will search for recipes.

Changelog: Fix: Remove packages when version is asterisk (#5297)
Docs: Omit

fixes #5297

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

uilianries added some commits Jun 11, 2019

#5297 Add test that reproduces the error
Signed-off-by: Uilian Ries <uilianries@gmail.com>
#5297 Remove all when version is asterisk
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@jgsogo

This comment has been minimized.

Copy link
Member

commented Jun 12, 2019

Wait, just * is valid as a version for a reference?

@uilianries

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

Version range is okay, it's validated by ConanFileReference. The only problem there is about when only version is *. Do you see another scenario?

@uilianries

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

Actually this error only occurs for remove command. You can run search using the same pattern like hello/*@conan/stable and it will work. That's why I only changed that rule in Remover and not in ConanFileReference where all pattern is validated.

@jgsogo

This comment has been minimized.

Copy link
Member

commented Jun 12, 2019

(Forget my comment about the validation.)

This also fails for any pattern with a single * in any of the components of the reference:

conan remove hello/*@conan/stable
conan remove hello/*@*/stable
conan remove hello/version@*/stable
...

@uilianries

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

@jgsogo Oh, it's true, good catch! I'll update that! thanks

uilianries added some commits Jun 12, 2019

#5297 Fix remove rule when using asterisk
- Not only version, but also channel and user can
  contain asterisk

Signed-off-by: Uilian Ries <uilianries@gmail.com>
#5297 Validate channel when removing
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@jgsogo
Copy link
Member

left a comment

Check the suggestion for the if/else block

Show resolved Hide resolved conans/client/remover.py Outdated
#5297 Check valid reference
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@jgsogo

jgsogo approved these changes Jun 13, 2019

@lasote lasote added this to the 1.17 milestone Jun 17, 2019

@danimtb danimtb merged commit cad452a into conan-io:develop Jun 17, 2019

2 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.