Role import from GitHub results in "master" release, not the tag release, breaking installs

For my latest release of the geerlingguy.pip role on Galaxy, it should be 3.0.0 (that’s the latest tag on GitHub—see GitHub Actions run here: Role versions doesn't match the GitHub releases

But when the action ran:

ansible-galaxy role import --api-key *** $(echo geerlingguy/ansible-role-pip | cut -d/ -f1) $(echo geerlingguy/ansible-role-pip | cut -d/ -f2)
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.6/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.6/x64/lib
Successfully submitted import request 2052579235646249945729608737351613182
running
role imported successfully

It resulted in a master release, but no tag 3.0.0.

This has resulted in users of the role getting the following error upon trying to install the role:

[WARNING]: - geerlingguy.pip was NOT installed successfully: Unable to compare
role versions (1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0, 2.1.0, 2.2.0,
master) to determine the most recent version due to incompatible version
formats. Please contact the role author to resolve versioning conflicts, or
specify an explicit role version to install.
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.

See: error: unable to compare role versions · Issue #60 · geerlingguy/ansible-role-pip · GitHub

I think Role versions doesn't match the GitHub releases might be related, but wasn’t exactly this problem AFAICT, so I thought I’d open a new issue.

When I try viewing the role page on Galaxy NG, it appears to show no versions at all now: Galaxy NG

1 Like

Looking around in the Galaxy UI, it seems like all my roles have “No versions”, maybe some database connection or UI issue?

Some similar issues were mentioned in:

Just posting for reference.

The missing versions in the UI should be resolved by Remove duplicate trailing slash on fetching legacy role versions and content by jctanner · Pull Request #4424 · ansible/ansible-hub-ui · GitHub once merged and deployed.

The tag versus branches issue should be resolved by Revamp legacyrole versions. by jctanner · Pull Request #1946 · ansible/galaxy_ng · GitHub but still needs some more work and testing.

2 Likes

I figured out, the --branch option is used for the galaxy-ng version. So if you are on your latest release tag on the main or master branch, you can run:

ansible-galaxy role import \
  --api-key <GalaxyAPIKey> \
  --branch <YourGitReleaseTag> \
  github_username github_repo

I created a github action, that can import new ansible role release with the correct set version to galaxy.ng: Action Ansible Galaxy Release · Actions · GitHub Marketplace · GitHub
It is using the GITHUB_REF_NAME enviroment variable as version name.

I created a post about this topic here:

Also tried that –branch option. But basically got the same error that I always got (besides one try):

Successfully submitted import request 2053172058356991462981303515328567548
running
git clone for https://github.com/githubixx/etcd failed
  File "/venv/lib64/python3.11/site-packages/pulpcore/tasking/tasks.py", line 66, in _execute_task
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/app/galaxy_ng/app/api/v1/tasks.py", line 167, in legacy_role_import
    raise Exception(f'git clone for {clone_url} failed')

So :person_shrugging: :wink:

1 Like

Sorry it die not worked for you.

Looks like a gagaxy dev should look at it.

@tannerjc maybe?

I’m having the same problem. I deleted andrewrothstein.kubelogin and re-imported it. Now I only have a “main” version. I’m expecting the ansible-galaxy role import --branch main --role-name kubelogin andrewrothstein ansible-kubelogin to bring in all the semver tags hanging off any commits in the main branch. It’s not working as the documentation suggests.

1 Like

Oh yes, it would be nice if Dokumentation and reality could be merged Plesse!

It is anoying to discovery in a trial an error Basis how it is Wirkung now.

Since yesterday evening I was able to successfully import a role again. The tags are visible as versions, main is gone.

role imported successfully

1 Like

For me it’s still not working. Still same error as mentioned in my post above.

1 Like

What does your import command look like?

git clone for https://github.com/githubixx/etcd failed

It sounds like the repository name you passed as a parameter is wrong.

I think the correct command should be as follows:
ansible-galaxy role import githubixx ansible-role-etcd

1 Like

The big patch(es) that I wrote for revamping role versions and imports went live into production this weekend.

@geerlingguy when get a moment can you validate imports for your roles please?

1 Like

Oh man… How blind one can be :man_facepalming: You’re right. It’s working now. Thanks a lot for the hint! :+1: Versions are also looking good now.

1 Like

@andrewrothstein if you could retest again too please, that would be helpful

If this is in prod its still failing it seems. Im getting a failure with “geerlingguy.java”:

[WARNING]: - geerlingguy.java was NOT installed successfully: Unable to compare…

geerlingguy.pip is working now: Galaxy NG

geerlingguy.java is not yet: Galaxy NG

I’m running the GitHub Actions release job right now, will see if that fixes it…

geerlingguy.java latest release is now “Released in 5 hours” :slight_smile: maybe timezone thing

2 Likes

All working for me, cheers! I think a few were failing earlier but all good now:

  • src: geerlingguy.firewall
  • src: geerlingguy.php-versions
  • src: geerlingguy.php-redis
  • src: geerlingguy.composer
  • src: geerlingguy.java
  • src: geerlingguy.elasticsearch
2 Likes