linux-system-roles / certificate

Role for managing TLS/SSL certificate issuance and renewal
https://linux-system-roles.github.io/certificate/
MIT License
30 stars 21 forks source link

ci: Use supported ansible-lint action; run ansible-lint against the collection #210

Closed richm closed 9 months ago

richm commented 9 months ago

The old ansible-community ansible-lint is deprecated. There is a new ansible-lint github action. The new ansible-lint has several checks related to ansible-test and the ignore files. Many of our ignore settings are not allowed any more and are required to be fixed or addressed in the Ansible preferred way.

The python imports have to be wrapped in a try/except ImportError, and where possible, an error must be returned from the module explaining what was not able to be imported.

The result of this is that the .sanity files can be reduced to the bare minimum which will greatly reduce the maintenance burden of those files, make it easier to support newer versions of Ansible, and make it easier to import the system roles collection into Galaxy and Automation Hub.

distutils.version is deprecated, and it is a hard error in python 3.12 Instead, use packaging.version - unfortunately, this means having to add a dependency on python3-packaging on platforms that support it - notably, there is no python-packaging available on EL7, so fall back to using distutils.version there.

The latest Ansible repo gating tests run ansible-lint against the collection format instead of against individual roles. We have to convert the role to collection format before running ansible-test.

Role developers can run this locally using tox -e collection,ansible-lint-collection See https://github.com/linux-system-roles/tox-lsr/pull/125

Add --- doc start to .markdownlint.yaml

Signed-off-by: Rich Megginson rmeggins@redhat.com

codecov[bot] commented 9 months ago

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (4f50fa1) 0.00% compared to head (ee5e5b7) 32.95%.

Files Patch % Lines
module_utils/certificate_lsr/providers/base.py 79.62% 11 Missing :warning:
...dule_utils/certificate_lsr/providers/certmonger.py 64.00% 9 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #210 +/- ## ========================================= + Coverage 0 32.95% +32.95% ========================================= Files 0 3 +3 Lines 0 613 +613 Branches 0 128 +128 ========================================= + Hits 0 202 +202 - Misses 0 411 +411 ``` | [Flag](https://app.codecov.io/gh/linux-system-roles/certificate/pull/210/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles) | Coverage Δ | | |---|---|---| | [sanity](https://app.codecov.io/gh/linux-system-roles/certificate/pull/210/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles) | `32.95% <74.68%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

richm commented 9 months ago

[citest]

richm commented 9 months ago

[citest]

richm commented 9 months ago

centos 7 and 9 failures are baseos ci issues - the tests pass on those platforms locally