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

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 some commits Apr 4, 2019

@czoido czoido requested a review from lasote Jul 26, 2019

@lasote
Copy link
Contributor

left a comment

  • 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 added some commits Jul 26, 2019

czoido added some commits Jul 26, 2019

@czoido czoido requested a review from lasote Jul 26, 2019

@lasote
Copy link
Contributor

left a comment

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)

This comment has been minimized.

Copy link
@lasote

lasote Jul 29, 2019

Contributor

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):

This comment has been minimized.

Copy link
@lasote

lasote Jul 29, 2019

Contributor

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"]:

This comment has been minimized.

Copy link
@lasote

lasote Jul 29, 2019

Contributor

This feels hacky too

@czoido czoido force-pushed the czoido:issue/5472 branch from b44e919 to 28bc2f8 Jul 29, 2019

@memsharded memsharded merged commit 16bd14e into conan-io:develop Jul 29, 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
Projects
None yet
3 participants
You can’t perform that action at this time.