This basically makes it impossible to use any module of this collection when installing the Ansible community collection without manually also installing cisco.nd.
Right now we have no CI testing, except some very, very basic things that are done when trying to build a new release (for the current version and the next version). We did want to run more tests, see for example Testing collections within the ansible package, but we never got far enough to actually run that in CI.
Akini has created a PR to resolve this issue. It is currently being reviewed by our team.
Once merged, we will release a v2.8.0 which will include this fix and other improvements. I hope the Ansible package will be able to pick that change up in the next build.
I have also created a request for cisco.nd to be added to the Ansible package.
Do you know why the “import” checks in Sanity on both Galaxy and Automation Hub did not find this issue?
Do you mean the sanity tests run in CI? My guess is that the cisco.nd collection was installed before running the sanity tests. The sanity tests kind of assume that only the collections that the collection depends on (and transitive dependencies) are installed, so if you install other collections that are not dependencies, the import sanity test will not flag this.
I’m not sure whether Galaxy/AH actually run the import sanity tests: the galaxy importer which could run them does not install any collection dependencies (Galaxy importer: collection dependency handling), so the results of these tests would be mostly unusable (except for collections that have zero collection dependencies).
Based on my experience with private automation hub/galaxy_ng, the importer may take locally distributed collections into account. I.e. galaxy.ansible.com has cisco.nd imported already, so the dependency in cisco.mso’s plugins/modules would be met whether it performed any sanity checks or not.
Running ansible-test sanity --docker default locally on my machine without cisco.nd, against cisco.mso==2.6.0 leads to 9 failed tests.
Lots of plugins/module_utils/mso.py:33:0: traceback: ModuleNotFoundError: No module named 'ansible_collections.cisco.nd'\nplugins/modules/mso_backup.py lines and derivatives about missing the cisco.nd stuff.
The question was about Galaxy and Automation Hub import check when a new version of a collection is uploaded as this is the real gate and not our own CI but I think @Denney-tech mentions that they may take any locally distributed account into account or do not run the import sanity at all (as @felixfontein mentioned) which could be improved.
@allhart - sorry for the direct ping, but thought you might be able to help understand if there’s something galaxy-importer could do to help detect undeclared dependencies when a collection is updated in Galaxy/AH…?
@samccann This may be something the Galaxy team can tackle while discussing the issue of how galaxy-importer handles dependencies in general. They’ll be able to best advise on the status of that, since some other items recently took priority. (CC @galaxy)
@gundalow I think this was a combination of a series of things that will probably not happen again.
Addition to our CI Sanity/Galaxy Importer step of ND as a dependency (when it should only have been added to the Integration test step.
Addition of the dependency in the code
Galaxy and Automation Hub sanities not catching this issue
Ansible package CI not catching this issue.
From our side, as for recent version (v3.2+) of the Cisco MSO product we need the HTTPAPI plugin provided by the cisco.nd collection for authentication and API access, we need to start the process to declare it as a proper dependency.
Because cisco.mso is part of the Ansible package, the first step is to get cisco.nd into the Ansible package. Then we will be able to officially declare it as a dependency in galaxy.yml and remove the manual install of it in the pipeline.