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

Fix ansible-lint on tests #1046

Merged
merged 4 commits into from
Feb 22, 2023
Merged

Conversation

rjeffman
Copy link
Member

Recent PR checks are failing due to ansible-lint being more strict and complaining about errors it didn't before.

With this PR, the errors are fixed and pre-commit is updated to match the upstream tool versions, so verification can be done, also, on commit time, before opening a PR.

By merging this changes, the PRs which are showing ansible-lint failures need to be rebased to upstream/master.

@rjeffman rjeffman changed the title Fix ansible lint tests Fix ansible-lint on tests Feb 20, 2023
@@ -0,0 +1,3504 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

This is created within the test. What about having only "{}" as content?

Copy link
Member

Choose a reason for hiding this comment

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

But the pre-generated file will stop create_users_json.yml from creating the proper file with valid expiration dates.
Should the file still be missing instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a mistake on my side. This file should not make into the patch.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed now. I removed the file.

@t-woerner
Copy link
Member

It would be good to have the pre-commit changes in a separate PR. They are not really related to ansible-lint.

ansible-lint is issuing an warning when using '# noqa 505' instead of
'#noqa missing-import' on playbooks. This patch changes all occurrences
of the tag to use the newer format.
In latest ansible-lint versions, the use of "blocks" has a required
order to be implemented. According to ansible-lint error mesage, the
order is name, when, block, rescue, always.

As not following this rule is now an error, this patch fixes all tests
for the 'key-order[task]' error.
A dangling 'when:' clause was failing anisble-lint tests as the task did
not match any valid schema. The dangling clause was removed, and the
usage of 'shell' was changed from free form to use the 'cmd' parameter.
@rjeffman
Copy link
Member Author

pre-commit commit moved to #1049.

@t-woerner
Copy link
Member

LGTM

@t-woerner t-woerner merged commit 77cd20b into freeipa:master Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants