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

Ignore args rule finding if value for choice has jinja template #2929

Merged
merged 3 commits into from Jan 24, 2023

Conversation

klaus-tux
Copy link
Contributor

I suggest to ignore the args[module] rule finding for "value of %s must be one of: %s, got: %s" completely if the value contains a jinja template. This fixes #2866 .

This is consistent to ignoring type check errors if they contain jinja templates. I copied the code from this check. Unfortunately, there is no failing test if this check is omitted. So I did not refactor the duplication any further, because I'm rather new to Python development. Feel free to improve :-)

@klaus-tux klaus-tux requested review from a team as code owners January 23, 2023 08:36
@klaus-tux klaus-tux changed the title Ignore args rule finding if value for choice has jinja template bug: Ignore args rule finding if value for choice has jinja template Jan 23, 2023
@audgirka audgirka added the bug label Jan 23, 2023
@ssbarnea
Copy link
Member

@klaus-tux Thanks for fixing this. I checked your code and looks to do exactly what I would have done myself.

The only issue I have is that I see a slight reducing of code coverage reported by codecov. If you can have a look at that it would be awesome.

BTW, you can ignore the "eco" job failure, it is normal to fail sometimes.

@klaus-tux
Copy link
Contributor Author

Hi @ssbarnea ! Thank you for your feedback :-) I added a correctly failing test and now all new lines are covered completely. Please ping me if something else is needed.

@ssbarnea
Copy link
Member

@klaus-tux small typo ;)

@klaus-tux
Copy link
Contributor Author

@ssbarnea Thanks for the heads-up. I learned the lesson: Run the linters before committing... Sorry for the delay.

@ssbarnea ssbarnea changed the title bug: Ignore args rule finding if value for choice has jinja template Ignore args rule finding if value for choice has jinja template Jan 24, 2023
@ssbarnea ssbarnea merged commit 18a42e1 into ansible:main Jan 24, 2023
@klaus-tux klaus-tux deleted the bugfix-value-must-be-one-of branch January 24, 2023 10:26
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.

args[module] flags variables violation
3 participants