Galaxy importer: collection dependency handling

I noticed that apparently galaxy-importer does not care about collection dependencies that have been installed before running it, and it itself does no attempt at installing collection dependencies, and apparently also doesn’t do that when publishing collections to https://galaxy.ansible.com/.

This has a serious drawback: some collections use docs fragments from collections they depend on! Since galaxy-importer does not use any collection except the one to import, this means that any module / plugin whose documentation depends on another collection has no documentation rendered in the UI at https://galaxy.ansible.com!

Examples:

I think this is something that should get fixed.

CC @tannerjc since you’ve looked at the docs loading code in galaxy-importer recently.

3 Likes

(And yes, I do understand that this isn’t easy to fix :slight_smile: I mainly noticed when I was trying to get GitHub - ansible-community/github-action-test-galaxy-import: GitHub Action for testing Galaxy import of an Ansible collection to actually consider dependencies. I tried to look into how this was done on Zuul for community.aws, in the end realizing that they simply disabled the ansible-doc part of the import, and then digging into the galaxy-importer code, to find out that it has no mechanism to use any collection dependencies, no matter whether they have been installed before or not.)

This also affects other tests run by the importer, like ansible-lint, see Ansible-galaxy lint unexpected warnings.

Pinging @galaxy in case you didn’t see this so far. I think this is rather serious since it breaks documentation rendering for all collections that use docs fragments from other collections.