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
Recursively extract tasks from blocks #1809
Recursively extract tasks from blocks #1809
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change needs a modification of at least one test that will verify the fixed bug or we risk breaking it in the future.
Can you modify one test or add a new one that ensures that this change fixes a bug? The test should fail without it and pass after this change goes in.
If I understood correctly it should be ok to modify one example and add a deep bug that is not found without this change.
allow matchtask() to match embedded tasks - block: - block: - template: src: ...
2a984e4
to
c1cccd2
Compare
c1cccd2
to
f45e5b7
Compare
LOL. I updated |
Updating one rule/test to make use of it should be enough to prevent regression. Feel free to add |
Now that CommandHasChangesCheckRule looks in blocks, we need to adjust a playbook to make sure it does not have false positives.
I only had to update 1 playbook. 😌 Tests are green now. |
allow matchtask() to match embedded tasks
See for example:
https://github.com/ansible-community/ansible-lint/blob/ff90dd4a5b1f105028a4c4d5d70a9cd2bcb69bdb/examples/roles/role_for_no_same_owner/tasks/fail.yml#L13-L19
The
no-same-owner
rule, added in #1450, uses that test tasks file. It does its own task parsing to ensure it can recursively find tasks. We should allow all rules to recursively find tasks.