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

Pin package for ansible-lint in pre-commit #180

Closed
wants to merge 3 commits into from

Conversation

jsf9k
Copy link
Member

@jsf9k jsf9k commented May 4, 2024

🗣 Description

This pull request pins ansible-core when running ansible-lint in pre-commit. It also adds a comment explaining why the Python package ansible may sometimes need to be added as an additional dependency for the ansible-lint linter in .pre-commit-config.yaml.

💭 Motivation and context

This is done to match the pinning that was done in cisagov/skeleton-ansible-role#193.

🧪 Testing

All automated tests pass.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

@jsf9k jsf9k added the improvement This issue or pull request will add or improve functionality, maintainability, or ease of use label May 4, 2024
@jsf9k jsf9k self-assigned this May 4, 2024
@jsf9k jsf9k marked this pull request as ready for review May 4, 2024 14:23
@jsf9k jsf9k requested a review from a team May 4, 2024 14:23
@jsf9k jsf9k force-pushed the improvement/pin-packages-for-ansible-lint branch 2 times, most recently from 933a6e6 to 2336d87 Compare May 5, 2024 02:49
jsf9k and others added 2 commits May 6, 2024 10:16
See skeleton-ansible-role#178 for more details.

Co-authored-by: Nick <[email protected]>
The line is not only unnecessary, it was commented out to boot!
@jsf9k jsf9k force-pushed the improvement/pin-packages-for-ansible-lint branch from 2336d87 to 1ab9eca Compare May 6, 2024 14:16
@jsf9k jsf9k added the kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release label May 6, 2024
…lint

On its own ansible-lint does not pull in ansible, only ansible-core.
Therefore, if an Ansible module lives in ansible instead of
ansible-core, the linter will complain that the module is unknown.  In
these cases it is necessary to add the ansible package itself as an
additional dependency, with the same pinning as is done in
requirements-test.txt of cisagov/skeleton-ansible-role.
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Approval intensifies.

@jsf9k
Copy link
Member Author

jsf9k commented May 21, 2024

We can close this pull request because a new version of the ansible-core Python package has been released that does not suffer from the bug discussed in ansible/ansible#82702. This bug broke any symlinked files in vars, tasks, etc. for any Ansible role installed via ansible-galaxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants