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
Provide verbose details about which galaxy server was used #61190
Conversation
Ping @jborean93 |
lib/ansible/galaxy/collection.py
Outdated
@@ -320,6 +320,7 @@ def from_name(collection, apis, requirement, force, parent=None): | |||
resp = json.load(open_url(n_collection_url, validate_certs=api.validate_certs, headers=headers)) | |||
except urllib_error.HTTPError as err: | |||
if err.code == 404: | |||
display.vvvv("Collection '%s' is not available from server '%s'" % (collection, api.name)) |
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.
actually, we would prefer 3 v's because
https://github.com/ansible/awx/blob/43d816b6e4c7ea01c31e42e713101cf51011b534/awx/main/tasks.py#L1887
825a99b
to
4e50ca9
Compare
lib/ansible/galaxy/collection.py
Outdated
@@ -320,6 +320,7 @@ def from_name(collection, apis, requirement, force, parent=None): | |||
resp = json.load(open_url(n_collection_url, validate_certs=api.validate_certs, headers=headers)) | |||
except urllib_error.HTTPError as err: | |||
if err.code == 404: | |||
display.vvv("Collection '%s' is not available from server '%s'" % (collection, api.name)) |
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 would be good to also add the URL used to this and the other message you've added below. The name isn't that useful for people who are relying on the defaults and seeing the URL as well helps them to understand what was actually used. An example is https://github.com/ansible/ansible/blob/devel/lib/ansible/galaxy/collection.py#L435
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.
yeah, formatting (collection , api.name, api.api_server)
looks good to me
4e50ca9
to
aeffd4a
Compare
With latest update, output looks like this:
I agree, that is a nice aesthetic. |
SUMMARY
This adds debug messages so that people can ascertain the source for the requirements they are using. As far as I can tell, there's no other output telling the user what the correspondence is.
ISSUE TYPE
COMPONENT NAME
lib/ansible/galaxy/collection.py
ADDITIONAL INFORMATION
I'm building examples for such cases:
https://github.com/AlanCoding/collection-requirements-cases
Here is the output for a case that makes use of @chrismeyersfsu https://galaxy.ansible.com/chrismeyersfsu/test_things, which is not available on https://galaxy-dev.ansible.com. It first tries galaxy-dev, and gets a 404. It then installs from the release galaxy. These debugging statements make that traceable.