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

conan search <pattern> --revisions with cache Issue/5472 #5537

Merged
merged 35 commits into from Jul 29, 2019

Conversation

czoido
Copy link
Contributor

@czoido czoido commented Jul 26, 2019

Changelog: Feature: Output current revision from references in local cache when using a pattern
Docs: conan-io/docs#1381

Previous behaviour was that current revision number could only be shown if a reference was
given with the --revisions argument but not a pattern.
Now you can use a pattern to list the current revision of the references in the local cache.

Closes #5472

revisions modified

  • 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.

czoido added 25 commits April 4, 2019 11:14
@czoido czoido requested a review from lasote July 26, 2019 06:52
Copy link
Contributor

@lasote lasote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There are no tests: Test the feature, test the --revisions with --remote and not ref
  • I suspect that the search.py will crash for editable packages when gathering the revision?
  • I would avoid passing the with_revision argument, the search_recipes could return always a reference with the revision filled (if any). So the "print_revision" argument would be enough.

@lasote lasote added this to the 1.18 milestone Jul 26, 2019
@czoido czoido requested a review from lasote July 26, 2019 11:48
Copy link
Contributor

@lasote lasote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would try to make the local search return the revisions always, I think it should simplify the things and doesn't look very dangerous: https://github.com/conan-io/conan/compare/develop...lasote:delete/test_search?expand=1

@@ -1194,6 +1194,10 @@ class Test(ConanFile):
client.run("search lib/1.0@user/testing --revisions")
self.assertIn("bd761686d5c57b31f4cd85fd0329751f (No time)", client.out)

# test that the pattern search with --revisions enabled works
client.run("search li* --revisions")
self.assertIn("bd761686d5c57b31f4cd85fd0329751f (No time)", client.out)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it lib/1.0@user/testing#bd761686d5c57b31f4cd85fd0329751f (No time)? In that case assert the whole line because it is confusing what is bd761686d5c57b31f4cd85fd0329751f

@@ -1093,7 +1093,7 @@ def get_remote_by_name(self, remote_name):
return self._cache.registry.load_remotes()[remote_name]

@api_method
def get_recipe_revisions(self, reference, remote_name=None):
def get_recipe_revisions(self, reference, remote_name=None, check_rev_time=True):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't change this method. That check_rev_time is a patch.

info = self._conan.search_recipes(args.pattern_or_reference,
remote_name=args.remote,
case_sensitive=args.case_sensitive)
if info["results"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels hacky too

@memsharded memsharded merged commit 16bd14e into conan-io:develop Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

conan search <pattern> --revisions
3 participants