galaxy: Lots of broken dependencies due to `role_name` changing hyphens to underscores
Bug Report
SUMMARY
The new naming convention has broken a lot of linked repos which need to be reverted or we would like recommendation for a future proof naming convention.
STEPS TO REPRODUCE
Yesterday, we noticed with one of our recent roles stackhpc.beegfs
that the ansible-role-
part was not being omitted as it previously did each time Travis CI build job triggered a notification API. Then, we noticed that adding role_name: beegfs
to meta/main.yml
ensured that the ansible-role-
part was omitting. We made the fatal assumption that this change affected all our other repos so as a result, charged ahead with adding this line to about 30+ roles currently available on our Ansible Galaxy repository. We came under the impression that this was a way to guarantee that this would secure their name. Then we noticed that the repositories with hyphens in have now converted to underscores.
The situation is that now we have lots of broken dependencies that affect almost all our other repositories. Is there a way to revert this change? At the moment, we have in total 26 repositories that previously had hyphens in that need to go back to their original state. Despited removing the role_name
from meta/main.yml
file, it appears that this does not restore the previous state.
EXPECTED RESULTS
Either: Restore former hyphenated names to 26+ repos under stackhpc organisation.
Or: Recommend us a future proof naming scheme that is unlikely to change again in the near future as we observed in one of the issues that even the role_name
variable is under discussions to be deprecated (https://github.com/ansible/galaxy/issues/1042, https://github.com/ansible/mazer/issues/62).
ACTUAL RESULTS
At the moment, there does not appear to be any way of going back as a lay user.
Sample import log for one of our roles showing the rename taking place irreversiable.
INFO Starting import: task_id=281479, repository=stackhpc/ansible-role-dell-powerconnect-switch
INFO Content search - Looking for file "apb.yml"
INFO Content search - Looking for top level role metadata file
WARNING [role] Missing 'dependencies' field in metadata.
INFO [role] Linting...
INFO [role] Linting OK.
INFO Updating repository name "dell-powerconnect-switch" -> "dell_powerconnect_switch"
INFO [ROLE: dell_powerconnect_switch] Created new Content instance: id=29348, content_type="role", name="dell_powerconnect_switch"
INFO [ROLE: dell_powerconnect_switch] Adding role metadata tags
INFO [ROLE: dell_powerconnect_switch] Adding role platforms
INFO Deleting Content instance: content_type=role, namespace=stackhpc-3269, name=dell-powerconnect-switch
INFO Updating repository versions...
Import completed
Many thanks.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (7 by maintainers)
Late to the “party” (more of a nightmare!), but still wanted to express my opinion about the forced renames. Briefly, a major blow for the community as a whole a) without a logical reason (what does “support for multiple roles within a repository” have to do with dash vs underscore, or what ever users want to use); b) without proper planning (today use
role_name
, next day don’t, or may-be-yes-or-may-be-no). My 2ctsThanks @chouseknecht - that (renaming _ to -) would get us out of a sticky situation for the time being. I trust that if we do not delete the role in Galaxy then imports will not trigger a rename?
Looking to the future, will there come a time when we need to change these names to use underscores? If so, it will be crucial to have a backwards compatible migration path that does not break users and CI/CD pipelines everywhere (not just ours).
IMO without the prefix magic, some solution will be required for setting the name of a role,
role_name
or otherwise.@markgoddard
You can keep the
ansible-
andansible-role-
in the repo name, and userole_name
for now to force dropping these prefixes during import. Just know that at some pointrole_name
will be deprecated.As for the ‘-’, if you would like us to restore the ‘-’ in your existing roles we can. Just know that if and when you delete a role and re-import it, the ‘-’ will again be converted to ‘_’.