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

changelog check does not follow ansible defined best practice for YAML extensions; resulting in undetected changelogs. #4105

Open
r-pufky opened this issue Apr 10, 2024 · 2 comments
Labels

Comments

@r-pufky
Copy link

r-pufky commented Apr 10, 2024

Summary

Ansible best practice defines YAML files to be specified with a yml extension. ansible-galaxy init also ENFORCES this behavior when templating collections and roles; the use of .yaml is accepted throughout documentation as valid but .yml is always preferred in all of their use cases, examples, and documentation.

Some relevant docs (many more):

  1. https://docs.ansible.com/ansible/latest/galaxy/user_guide.html
  2. https://docs.ansible.com/ansible/latest/community/collection_development_process.html#creating-a-changelog-fragment
  3. https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#role-directory-structure
  4. https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html
  5. https://github.com/ansible-community/antsibull-changelog/blob/main/docs/changelog.yaml-format.md
Issue Type
  • Bug Report
OS / ENVIRONMENT
$ ansible-lint --version
ansible-lint 24.2.2 using ansible-core:2.16.5 ansible-compat:4.1.11 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
(ansible) 
  • ansible installation method: pip
  • ansible-lint installation method: pip
STEPS TO REPRODUCE

Place changelog files in the following locations and run ansible-lint:

 file location                        | ansible-lint | interpretation
--------------------------------------|--------------|----------------
 collection/changelog.yaml            | no detect    | correct.
 collection/CHANGELOG.yaml            | no detect    | correct.
 collection/CHANGELOG.yml             | no detect    | correct.
 collection/changelog.yml             | no detect    | correct.
 collection/CHANGELOG.md              | detect       | correct.
 collection/changelog.md              | no detect    | correct.
 collection/CHANGELOG.rst             | detect       | correct.
 collection/changelog.rst             | no detect    | correct.
 collection/changelogs/changelog.yaml | detect       | correct.
 collection/changelogs/CHANGELOG.yaml | no detect    | correct.
 collection/changelogs/CHANGELOG.yml  | no detect    | correct.
 collection/changelogs/changelog.yml  | no detect    | incorrect: accept '.yml'.
 collection/changelogs/CHANGELOG.md   | no detect    | correct.
 collection/changelogs/changelog.md   | no detect    | correct.
 collection/changelogs/CHANGELOG.rst  | no detect    | correct.
 collection/changelogs/changelog.rst  | no detect    | correct.
Desired Behavior

ansible-lint should honor accepted best practices from ansible themselves, and
ether:

  1. Enforce .yml extension over .yaml.
  2. Allow both .yml and .yaml extensions as valid YAML files.

It should be noted that lint enforces .yml extensions for other lints; such as galaxy[no-runtime] rule:

galaxy[no-runtime]: meta/runtime.yml file not found.
galaxy.yml:1
Actual Behavior

.yml changelog files are explicitly failed to be detected. Additionally
capped naming conventions for important user consumer documentation are not
followed.

@r-pufky r-pufky added bug new Triage required labels Apr 10, 2024
@ssbarnea ssbarnea removed the new Triage required label Apr 16, 2024
@ssbarnea
Copy link
Member

A PR to address this will be more than welcomed.

@cavcrosby
Copy link
Contributor

If there was a PR to address this, and it was merged, I presume we would also want to make a PR within the galaxy-importer repository? Basing this on the work done here, #2832. @ssbarnea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

3 participants