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

galaxy[tags] does not align between ansible-lint and galaxy-importer #4409

Open
minsis opened this issue Nov 16, 2024 · 4 comments · May be fixed by #4422
Open

galaxy[tags] does not align between ansible-lint and galaxy-importer #4409

minsis opened this issue Nov 16, 2024 · 4 comments · May be fixed by #4422
Labels

Comments

@minsis
Copy link

minsis commented Nov 16, 2024

Summary

The galaxy-importer library has some additional regex checks on the tags attribute that ansible-lint is missing.

In galaxy-importer you can see a regex is defined for tags where ansible-lint does not:
https://github.com/ansible/galaxy-importer/blob/master/galaxy_importer/constants.py#L47

Issue Type
  • Bug Report
OS / ENVIRONMENT
ansible-lint --version
ansible-lint 24.9.0 using ansible-core:2.17.5 ansible-compat:24.9.1 ruamel-yaml:0.18.6 ruamel-yaml-clib:None
A new release of ansible-lint is available: 24.9.0 → 24.10.0 Upgrade by running: pip install --upgrade ansible-lint
  • ansible installation method: conda
  • ansible-lint installation method: conda
STEPS TO REPRODUCE

Create basic galaxy.yml file:

name: test
namespace: test
description: test
repository: https://repo.com
authors:
  - me
readme: README.md
version: 1.0.0
tags:
  - application
  - tag1
  - tag2
  - tag-3

And run ansible-lint galaxy.yml

ansible-lint galaxy.yml

However when importing into galaxy there is a failure on tag-3

Desired Behavior

ansible-lint should fail on tag-3

Actual Behavior

ansible-lint passes validation

Passed: 0 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'production'.
A new release of ansible-lint is available: 24.9.0 → 24.10.0 Upgrade by running: pip install --upgrade ansible-lint
@minsis minsis added bug new Triage required labels Nov 16, 2024
@alisonlhart alisonlhart removed the new Triage required label Nov 20, 2024
@alisonlhart
Copy link
Contributor

@minsis Thanks for opening this! We've added this to our roadmap. The implementation should be very straightforward, so if you or anyone would like to open a patch for it, we're happy to review.

@minsis
Copy link
Author

minsis commented Nov 22, 2024

I want to add that ansible-lint also does not validate the max number of allowed tags as well. I'm adding this to my patch for the formatting validation as well.

@minsis
Copy link
Author

minsis commented Nov 22, 2024

Also another notable mention is galaxy-import also validates the character length of a tag which I guess I will also add to my patch.

@minsis
Copy link
Author

minsis commented Nov 22, 2024

@alisonlhart I wanted to get an opinion on adding some addtional validations to the galaxy.yml schema file. I guess overall it's kind of confusing in the way the JSON schema vs the "custom" validations.

Since JSON schema support some of the additional work I'm adding I'm wondering if I should add it there. When it's added my tests are failing on both schema[galaxy] and my new validations.

@minsis minsis linked a pull request Nov 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Roadmap
Development

Successfully merging a pull request may close this issue.

2 participants