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

Add meta-unsupported-ansible rule for checking requires_ansible values #2770

Merged
merged 5 commits into from Dec 4, 2022

Conversation

alisonlhart
Copy link
Contributor

Adding rule to check that the requires_ansible variable in meta/runtime.yml is set to a supported version of ansible-core.

Example error:

---
requires_ansible: ">=2.9.0"  <---- not a supported version of ansible

Example pass:

---
requires_ansible: ">=2.9.10"  <---- a supported version of ansible

Fixes #2102

@alisonlhart alisonlhart marked this pull request as ready for review December 2, 2022 22:07
@alisonlhart alisonlhart requested review from a team as code owners December 2, 2022 22:07
@ssbarnea ssbarnea changed the title Adding new rule meta-unsupported-ansible and adjustments Add meta-unsupported-ansible rule for checking requires_ansible values Dec 4, 2022
@ssbarnea ssbarnea merged commit 7e03fee into ansible:main Dec 4, 2022
@alisonlhart alisonlhart deleted the meta_unsupported_ansible branch December 7, 2022 14:04
@SRv6d
Copy link

SRv6d commented Apr 12, 2023

This rule breaks version numbers that omit the patch version.
Omitting the patch version is common practice and even suggested in the docs.
If this was an intentional decision, it should at least be documented.

@alisonlhart
Copy link
Contributor Author

@ssbarnea RE: comment above - There's an argument to be had for omitting the patch version requirement. However, as far as I can see, the only instance needed for omitting patch version is for compatibility with prerelease versions of Ansible. As stated in the docs: Ansible deviates from PEP440 behavior by truncating prerelease segments from the Ansible version. Ansible 2.11.0b1 is compatible with something that requires_ansible: ">=2.11".

So, since the intention of the shared profile is best practices for building useful content to be shared on Galaxy, Automation Hub, and private instances, I would argue there's not really an instance where using a patch version specifier would be an issue, unless you think the above would be a valid reason to change it.

I would say it's ideal to always specify patch versions, but again, I could see the benefit with removing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

meta-unsupported-ansible: requires_ansible key
3 participants