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

bug: ansible-lint fix warning count violations #3680

Closed
wants to merge 2 commits into from

Conversation

TommyE123
Copy link
Contributor

Fixes #3446

Currently the count for the warning violations regex errors and doesn’t display the correct count.

Proposed Changes

Changed the regex to count the violations that ansible-lint outputs.

image

Testing

I’ve checked this on both Github and Azure pipelines using 2 different repositories and the results are as expected.

Before:
image

After:
image

If there are any issues or concerns, please let me know, and I will address them promptly.
Thank you for reviewing this PR and I look forward to your feedback.
Tom

@echoix
Copy link
Collaborator

echoix commented Jun 22, 2024

@TommyE123 Do you think the ansible lint test failure here is transient?

@nvuillam
Copy link
Member

image

Not sure the new regex matches such output :(

@echoix
Copy link
Collaborator

echoix commented Jun 22, 2024

Does it have to do with some env vars that change the logging format?

@echoix echoix marked this pull request as draft June 22, 2024 15:51
@TommyE123
Copy link
Contributor Author

Well I'm angry now with myself!

I must have missed a scenario. However I think we need to use both mine and the existing regex but will check. Please don't merge and I will come back with a better more robust solution!

I've also been looking at a better way to detect if ansible should be active in general.

Thank you both for all your hard work today getting everything merged. 🙂

Tom

@nvuillam
Copy link
Member

@TommyE123 no problem haha ,thanks for your hard work :)

@TommyE123
Copy link
Contributor Author

After some testing, I've discovered that the current regex only works when quiet: false is set or not specified in the .ansible-lint config file.

Setting quiet: true doesn't significantly reduce the log information across Azure, GitHub, and GitLab environments. In fact, it results in missing out on a valuable breakdown table of issues, as shown below as an example.
image

Given these findings, I'm closing this PR as the change doesn't work as initially intended. However, this does explain the behavior @alexanderbazhenoff encountered in #3446 (comment).

I believe we can also close #3680 now, as this was the only outstanding issue there.

Tom

@TommyE123 TommyE123 closed this Jun 23, 2024
@alexanderbazhenoff
Copy link
Contributor

No prob, I haven't had any time for sure for the last few months either. May be I'll take a look into ansible-lint output also once I get back to refactoring my four roles. Thanks for trying anyway.

@TommyE123 TommyE123 deleted the Ansible_Error_Count_Fix branch July 4, 2024 20:18
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.

Unable to get number of errors with regex_number
4 participants