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
Add warning when downloading recipes from bintray #9416
Add warning when downloading recipes from bintray #9416
Conversation
Warning is only displayed when downloading a recipe from the remote | ||
""" | ||
client = TestClient() | ||
client.run("remote add conan-center https://conan.bintray.com") |
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 tried to avoid using the real bintray remote with a test server using the same URL. However, this lead to modifications to the TestServer class and others in the requester...
Anyway, I think it could be useful to have a test that tracks the availability of the remote so we can drop the message once it is no longer available 🤷♂️
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.
Then, in my opinion, I think we should use a "fake" Bintray URL and check the output:
client = TestClient()
fake_bintray_url = "https://myfakebintray.com"
with patch.object(proxy, "BINTRAY_DEPRECATED_URL", return_value=fake_bintray_url):
client.run("remote add conan-center %s" % fake_bintray_url)
# .....
What do you think @danimtb?
EDIT: perhaps that client.run()
can be outside of the patch
conans/client/graph/proxy.py
Outdated
@@ -113,6 +113,11 @@ def _download_recipe(self, layout, ref, output, remotes, remote, recorder): | |||
def _retrieve_from_remote(the_remote): | |||
output.info("Trying with '%s'..." % the_remote.name) | |||
# If incomplete, resolve the latest in server | |||
if "https://conan.bintray.com" in the_remote.url: |
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 think we should declare that URL as a global variable in this module like:
BINTRAY_DEPRECATED_URL = "https://conan.bintray.com"
# .....
if the_remote.url.startswith(BINTRAY_DEPRECATED_URL):
# whatever
Then, it should be easier to use it in any test.
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.
Two picky comments
conans/client/graph/proxy.py
Outdated
output.warn("Please use the new 'conancenter' default remote " | ||
"(https://center.conan.io).") |
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.
For these messages, I really find it useful to provide a copy/paste solution to users:
output.warn("Please use the new 'conancenter' default remote " | |
"(https://center.conan.io).") | |
output.warn("Please use the new 'conancenter' default remote. Add it to your remotes with " | |
"'conan remote add --insert 0 conancenter https://center.conan.io'.") |
conans/client/graph/proxy.py
Outdated
@@ -113,6 +113,11 @@ def _download_recipe(self, layout, ref, output, remotes, remote, recorder): | |||
def _retrieve_from_remote(the_remote): | |||
output.info("Trying with '%s'..." % the_remote.name) | |||
# If incomplete, resolve the latest in server | |||
if "https://conan.bintray.com" in the_remote.url: |
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.
When using Bintray, if you clicked the set me up
button it didn't show you the https://conan.bintray.com/...
URL, but https://bintray.com/conan....
(I cannot remember exactly the path)... and many people had that one configured. Do you remember? Do we want to check also for that URL?
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.
Yes, I'd say to check fur bintray.com
, that should be good enough for both cases, isn't it?
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.
the URL https://bintray.com/conan....
will be useless as it is not working (only conan.bintray.com
is still operational), so checking for it doesn't make sense as it won't work from the beginning and would never get this warning message
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.
This is a very good reason indeed 😄
conans/client/graph/proxy.py
Outdated
@@ -113,6 +113,11 @@ def _download_recipe(self, layout, ref, output, remotes, remote, recorder): | |||
def _retrieve_from_remote(the_remote): | |||
output.info("Trying with '%s'..." % the_remote.name) | |||
# If incomplete, resolve the latest in server | |||
if "https://conan.bintray.com" in the_remote.url: |
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.
Yes, I'd say to check fur bintray.com
, that should be good enough for both cases, isn't it?
Changelog: omit
Docs: omit
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.
Here you can check the output of an install command: