ci: Comply with Ansible partner certification checking [citest_skip]#285
Merged
Conversation
https://github.com/ansible-collections/partner-certification-checker/blob/main/README.md Unfortunately we cannot use the checkers provided by their team because they assume the git repo is in collection format - you cannot convert to collection format first then point the checkers at that collection. Instead, implement our own checkers that do the same (and more) - check with multiple versions of ansible-lint and ansible-test to ensure we cover: * all supported versions of EL * Automation Hub gating * the latest versions of Ansible, including the latest milestone version This requires the latest version of tox-lsr Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Contributor
Reviewer's GuideUpdates CI workflows to align with Ansible partner certification expectations by running ansible-lint and ansible-test via tox-lsr across multiple Ansible/Python versions and upgrading tox-lsr, replacing GitHub Actions ansible-lint/ansible-test steps with tox-based execution. Sequence diagram for updated ansible-lint CI job with tox-lsr matrixsequenceDiagram
participant GH as GitHub
participant WF as ansible-lint_workflow
participant RNR as runner_ubuntu
participant PIP as pip
participant TOX as tox_lsr_3_18_0
participant ENV as tox_envs_collection_and_ansible_lint_collection
participant LINT as ansible_lint
participant CORE as ansible_core
GH->>WF: Trigger workflow (push or PR)
WF->>RNR: Start ansible-lint job with matrix (ansible_lint, ansible, python)
loop for each matrix.versions entry
RNR->>PIP: pip install tox-lsr==3.18.0
RNR->>RNR: actions/setup-python with matrix python
RNR->>TOX: tox -e collection,ansible-lint-collection
TOX->>ENV: Create/prepare tox envs
ENV->>CORE: Install ansible-core==matrix.ansible
ENV->>LINT: Install ansible-lint==matrix.ansible_lint
ENV->>ENV: Convert role to collection format
ENV->>LINT: Run ansible-lint on generated collection
LINT-->>ENV: Lint results (pass or fail)
end
ENV-->>RNR: Aggregate status for all matrix entries
RNR-->>WF: Job status
WF-->>GH: Report check status on commit/PR
Flow diagram for replacing GitHub ansible-lint action with tox-based executionflowchart TD
S["Start: ansible-lint workflow job"] --> CISTATUS["Check [citest_skip] in commit/PR"]
CISTATUS -->|"skip"| END["End job (skipped)"]
CISTATUS -->|"do not skip"| MATRIX["Iterate over matrix.versions
(ansible-lint, ansible-core, python)"]
MATRIX --> PIP["Install tox-lsr 3.18.0 via pip"]
PIP --> PYV["Set up Python using actions/setup-python
with matrix python version"]
PYV --> TOX["Run tox:
LSR_ANSIBLE_LINT_DEP=ansible-lint==<matrix.ansible_lint>
LSR_ANSIBLE_LINT_ANSIBLE_DEP=ansible-core==<matrix.ansible>
tox -x testenv:ansible-lint-collection.basepython=python<matrix.python>
-e collection,ansible-lint-collection"]
TOX --> COLLECT["tox env: collection
convert role to collection format"]
COLLECT --> LINTENV["tox env: ansible-lint-collection
install deps and run ansible-lint"]
LINTENV --> RES["Collect ansible-lint results
for this matrix entry"]
RES --> DECIDE{"Any matrix entry failed?"}
DECIDE -->|"yes"| FAIL["Job fails"]
DECIDE -->|"no"| PASS["Job passes"]
FAIL --> END
PASS --> END
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In both
ansible-lint.ymlandansible-test.yml, consider moving thepip3 install ... tox-lsrstep to afteractions/setup-pythonso tox/tox-lsr are installed into the matrix Python environment instead of the default system interpreter. - The
tox-lsr@3.18.0pin is now duplicated across several workflows; consider centralizing this version (e.g., via a reusable workflow or a shared env variable) to make future upgrades less error-prone.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In both `ansible-lint.yml` and `ansible-test.yml`, consider moving the `pip3 install ... tox-lsr` step to after `actions/setup-python` so tox/tox-lsr are installed into the matrix Python environment instead of the default system interpreter.
- The `tox-lsr@3.18.0` pin is now duplicated across several workflows; consider centralizing this version (e.g., via a reusable workflow or a shared env variable) to make future upgrades less error-prone.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/ansible-collections/partner-certification-checker/blob/main/README.md
Unfortunately we cannot use the checkers provided by their team because they assume
the git repo is in collection format - you cannot convert to collection format first
then point the checkers at that collection. Instead, implement our own checkers that
do the same (and more) - check with multiple versions of ansible-lint and ansible-test
to ensure we cover:
This requires the latest version of tox-lsr
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Expand CI coverage for Ansible linting and testing across multiple supported and latest Ansible/Python versions using tox-based workflows aligned with partner certification requirements.
CI: