Skip to content
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

[Ansible] Add collection badge #8578

Merged
merged 3 commits into from Nov 1, 2022

Conversation

s3lph
Copy link
Contributor

@s3lph s3lph commented Oct 28, 2022

Add a badge for Ansible collections, almost identical to those for Ansible roles.

Unfortuntately, the /api/v2/collections endpoint (as opposed to /api/v1/roles) of Ansible Galaxy exposes neither download numbers nor quality scores, so there's only the name badge for now.

@shields-ci
Copy link

shields-ci commented Oct 28, 2022

Messages
📖 ✨ Thanks for your contribution to Shields, @s3lph!

Generated by 🚫 dangerJS against 39c27ae

@calebcartwright
Copy link
Member

calebcartwright commented Oct 29, 2022

Thank you for the PR. A few things:

  • it would be helpful if you could articulate the what+why for this badge along the same lines of the questions asked in our issue template for new badges
  • the tests you've added are failing, please take a look and get them passing
  • given that there's a single class defined in one file, there's no need for an extra base class in the inheritance hierarchy; let's drop that base and just have the new class extend the basejson class directly

@s3lph
Copy link
Contributor Author

s3lph commented Oct 29, 2022

  • it would be helpful if you could articulate the what+why for this badge along the same lines of the questions asked in our issue template for new badges

📋 Description

  • This new badge is for Ansible Galaxy
  • It shows the name of an Ansible Collection, as it is available on Ansible Galaxy
  • Example: Ansible Galaxy

🔗 Data

🎤 Motivation

  • Collections are the "new" (if we can still consider it "new") packaging format for sharing content on Ansible Galaxy, allowing users to not only distribute single Ansible roles, but e.g. Python modules, plugins, ...
  • Before that, it was only possible to share single Ansible roles on Galaxy.
  • Similar to the already existing "Ansibl Role" badge, this badge shows the name of an Ansible Collection.
  • the tests you've added are failing, please take a look and get them passing

For some reason the tests of some Gitlab service are failing, even though I used the [Ansible] tag in the PR. Got any insights why this might happen?

  • given that there's a single class defined in one file, there's no need for an extra base class in the inheritance hierarchy; let's drop that base and just have the new class extend the basejson class directly

I copied this 1:1 from the Ansible Role service, where there are two additional services. Unfortunately, the data for these services are not (yet) exposed in the collections API. I'd propose to keep the base class around so that they can be added later on. Any thoughts?

Copy link
Member

@chris48s chris48s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your service tests are failing with

AssertionError: label mismatch: expected 'collection' to equal 'role'

You need to switch label: 'role' to label: 'collection' in your service tests. That will get the build passing.


I copied this 1:1 from the Ansible Role service, where there are two additional services. Unfortunately, the data for these services are not (yet) exposed in the collections API. I'd propose to keep the base class around so that they can be added later on. Any thoughts?

I think while we just have the one badge lets drop the base class and move fetch() into AnsibleGalaxyCollectionName. We can factor it out later if we add more badges in future.

Copy link
Member

@chris48s chris48s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work - thanks

@chris48s chris48s added service-badge Accepted and actionable changes, features, and bugs squash when passing labels Nov 1, 2022
@repo-ranger repo-ranger bot merged commit a190bb7 into badges:master Nov 1, 2022
@s3lph s3lph deleted the badge-ansible-collection branch November 7, 2023 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants