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

Make FQCN import tasks include their relevant files for checking #1854

Merged
merged 6 commits into from Feb 17, 2022

Conversation

ryaner
Copy link
Contributor

@ryaner ryaner commented Feb 7, 2022

Tasks can come in in either the short format or the FQCN format
as this is called before noramlize_task functions.

@ryaner ryaner requested a review from a team as a code owner February 7, 2022 21:05
@ryaner ryaner requested review from relrod, ganeshrn and priyamsahoo and removed request for a team February 7, 2022 21:05
@ryaner
Copy link
Contributor Author

ryaner commented Feb 7, 2022

Another option for fixing would be to split the string down on L328 (k, v) = item.
k can either be import_tasks or ansible.builtin.import_tasks.
Including the cases where the functions have FQCNs is slightly faster given the number of times the function is called.

Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

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

The fix seems logic and thanks for creating the PR.

Also, please update the tests in order to include a regression prevention measure. Think about a change, even to existing test covering the same functionality, that would fail if we remove your fix.

Tasks can come in in either the short format or the FQCN format
as this is called before noramlize_task functions.
…named

Includes the FQCN in the in the other locations that are called before
normalize functions. This triggers the proper includes in all paths as
well as fixing the `All tasks should be named` error when the FCQN
version is used.
@ryaner
Copy link
Contributor Author

ryaner commented Feb 8, 2022

I combined in the fix for #1615 as adding the FQCN into the tests caused the All tasks should be named to trigger during the tests. If you'd prefer I separate things I can do so, making this dependant on a PR for #1615.

This does not fix the fact that import_ calls do not trigger the FQCN ruleset. I don't see a way to pass the tasks to only a subset of the rulesets.

@ssbarnea ssbarnea merged commit ce89ad8 into ansible:main Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants