linux-system-roles / network

An ansible role to configure networking
https://linux-system-roles.github.io/network/
BSD 3-Clause "New" or "Revised" License
238 stars 106 forks source link

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

Closed richm closed 11 months ago

richm commented 11 months ago

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

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 module documentation must comply with the Ansible standards. One aspect of this is the version_added must be a valid ansible-core version in X.Y.Z format. Note that this version isn't really used anywhere, so it doesn't matter for users of the role, it is purely an ansible-test and import gating issue.

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.

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

The file examples/down_profile+delete_interface.yml was not used and was causing ansible-lint errors.

ansible-lint enforces the order of keywords in plays - name, then hosts, then vars, then tasks.

codecov[bot] commented 11 months ago

Codecov Report

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

Comparison is base (bbdc7f7) 43.31% compared to head (e034387) 45.03%.

Files Patch % Lines
library/network_state.py 0.00% 12 Missing :warning:
module_utils/network_lsr/nm/client.py 20.00% 11 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #661 +/- ## ========================================== + Coverage 43.31% 45.03% +1.71% ========================================== Files 13 12 -1 Lines 3068 3080 +12 Branches 394 428 +34 ========================================== + Hits 1329 1387 +58 + Misses 1739 1692 -47 - Partials 0 1 +1 ``` | [Flag](https://app.codecov.io/gh/linux-system-roles/network/pull/661/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/network/pull/661/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles) | `20.61% <20.00%> (+0.78%)` | :arrow_up: | 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 11 months ago

[citest]

liangwen12year commented 11 months ago

[citest]

richm commented 11 months ago

[citest]

richm commented 11 months ago

[citest bad]

richm commented 11 months ago

[citest]

richm commented 11 months ago

[citest]

richm commented 11 months ago

[citest]

richm commented 11 months ago

[citest bad]