ansible / ansible-lint

ansible-lint checks playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you
https://ansible.readthedocs.io/projects/lint/
GNU General Public License v3.0
3.51k stars 666 forks source link

Provide linting for ansible-builder files #3613

Open tima opened 1 year ago

tima commented 1 year ago
SUMMARY

Customers should be able to run linting against a builder file. 

This would include syntax and package dependency errors. If we could provide simple steps on how to resolve any dep conflicts within that builder file it would provide some relief for customers who are not python developers trying to use builder for EEs.

ISSUE TYPE
COMPONENT NAME

ansible-lint

ADDITIONAL INFORMATION

From https://issues.redhat.com/browse/AAPRFE-20

ssbarnea commented 1 year ago

@tima Can you please be more specific and also include links to documentation. What do you mean by "ansible-builder files"? Is that the definition of an execution environment, because for these we are already having a JSON Schema that we use to check against, see https://github.com/ansible/ansible-lint/blob/main/src/ansiblelint/schemas/execution-environment.json -- Are there other files?

Now the bad part about it is that the JSON Schema should have being maintained by ansible-builder project itself and not the linter. For example the rule-books JSON schema is maintained by the team developing them, and the linter is only caching it and automatically updating the schema when needed.

Checking conflicts on dependencies is unlikely to be doable in linter as it would require effective build. Still, other stuff might be possible but we will need specific proposal for implementing them.

@cidrblock WDYT?