-
Notifications
You must be signed in to change notification settings - Fork 993
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
Fix user/channel when searching patterns in a local-recipes-index #17408
Fix user/channel when searching patterns in a local-recipes-index #17408
Conversation
# just add all candidates for now | ||
pattern = f"{pattern_ref.name}/{pattern_ref.version}" | ||
except: | ||
# pattern = pattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think this can actually happen, pattern is already str of a RecipeReference afaik from https://github.com/conan-io/conan/blob/2.10.0/conans/client/graph/range_resolver.py#L55
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is fine to exclude the user/channel for this initial check, but then it has to be re-checked again after the actual conanfile
has been loaded and to match the real user/channel defined by recipe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, this is being done in _search_remote_recipes
https://github.com/conan-io/conan/blob/develop2/conans/client/graph/range_resolver.py#L80 as it expects that the search has ignored the user/channel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There it contains a:
# TODO: This is still necessary to filter user/channel, until search_recipes is fixed
So basically trying this to return the right thing and not rely on RangeResolved to fix it later?
# just add all candidates for now | ||
pattern = f"{pattern_ref.name}/{pattern_ref.version}" | ||
except: | ||
# pattern = pattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is fine to exclude the user/channel for this initial check, but then it has to be re-checked again after the actual conanfile
has been loaded and to match the real user/channel defined by recipe?
tc = TestClient(light=True) | ||
tc.run(f"remote add local '{c3i_user_channel_folder}'") | ||
tc.run(f"graph info --requires=pkg/[*]@") | ||
assert f"pkg/[*]: pkg/2.0" in tc.out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure that this is expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Not sure what you mean. The patterns ending in @
means "no user/channel", that was necessary to represent this use case, otherwise it is not possible via normal patterns.
Changelog: Fix: Fix user/channel when searching patterns in a local-recipes-index.
Docs: Omit
Some minor edits to the code still need to be made, but I think this is a better approach than the current one
Closes #17403