Skip to content

ci: Comply with Ansible partner certification checking [citest_skip]#189

Merged
richm merged 1 commit into
mainfrom
ci-ansible-lint-ansible-test-matrix
Apr 8, 2026
Merged

ci: Comply with Ansible partner certification checking [citest_skip]#189
richm merged 1 commit into
mainfrom
ci-ansible-lint-ansible-test-matrix

Conversation

@richm
Copy link
Copy Markdown
Contributor

@richm richm commented Apr 8, 2026

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

Summary by Sourcery

Align CI Ansible linting and testing workflows with Ansible partner certification requirements by running matrixed ansible-lint and ansible-test jobs across multiple supported Ansible and Python versions using updated tox-lsr tooling.

CI:

  • Run ansible-lint in CI via tox against multiple ansible-lint and ansible-core version combinations instead of the ansible-lint GitHub Action.
  • Run ansible-test sanity checks in CI via tox across a matrix of Ansible core and Python versions, including milestone releases.
  • Disable fail-fast in matrixed ansible-lint and ansible-test jobs to collect all failures across versions.
  • Upgrade all GitHub workflows to use tox-lsr 3.18.0.

Tests:

  • Drive ansible-lint and ansible-test execution through tox collection-based environments rather than ad hoc GitHub Actions or custom scripting.

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>
@richm richm self-assigned this Apr 8, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 8, 2026

Reviewer's Guide

Update GitHub Actions CI workflows to align with Ansible partner certification requirements by running ansible-lint and ansible-test through tox-lsr across multiple Ansible/Python versions, and by upgrading tox-lsr to 3.18.0 throughout the repository.

Sequence diagram for ansible-lint job using tox-lsr across multiple versions

sequenceDiagram
  actor Developer
  participant GitHub as GitHubActions
  participant Job as ansible-lint_job
  participant Matrix as MatrixRunner
  participant SetupPy as setup-python_action
  participant tox as tox_lsr
  participant AnsCore as ansible_core
  participant AnsLint as ansible_lint

  Developer->>GitHub: Push or open PR (without [citest_skip])
  GitHub->>Job: Trigger ansible-lint workflow
  Job->>Matrix: Initialize matrix {ansible_lint, ansible, python}
  loop For each matrix entry
    Matrix->>SetupPy: Configure Python version
    SetupPy-->>Matrix: Python runtime ready
    Matrix->>tox: Install tox-lsr 3.18.0 and invoke tox
    tox->>tox: Run env collection (convert role to collection)
    tox->>AnsCore: Install ansible-core==matrix.ansible
    tox->>AnsLint: Install ansible-lint==matrix.ansible_lint
    tox->>AnsLint: Run ansible-lint on collection
    AnsLint-->>tox: Lint results (pass/fail)
    tox-->>Matrix: Env result
  end
  Matrix-->>Job: Aggregated matrix results
  Job-->>GitHub: Job status
  GitHub-->>Developer: Report CI status on PR
Loading

Flow diagram for updated ansible-lint GitHub Actions job with matrix and tox-lsr

flowchart TD
  A["Workflow trigger (push or pull_request without [citest_skip])"] --> B["Start ansible-lint job"]
  B --> C["Define matrix versions: ansible_lint, ansible, python"]
  C --> D["Update pip and git"]
  D --> E["Install tox and tox-lsr 3.18.0 via pip"]
  E --> F["Set up Python using actions/setup-python@v6 with matrix python"]
  F --> G["Run tox with environments: collection, ansible-lint-collection"]
  G --> H["tox-lsr creates collection test env"]
  H --> I["tox-lsr runs ansible-lint-collection env"]
  I --> J["Install ansible-core==matrix.ansible"]
  J --> K["Install ansible-lint==matrix.ansible_lint"]
  K --> L["Execute ansible-lint on converted collection"]
  L --> M{"All matrix versions pass?"}
  M -->|Yes| N["Mark ansible-lint job successful"]
  M -->|No| O["Mark ansible-lint job failed"]
Loading

File-Level Changes

Change Details Files
Run ansible-lint via tox-lsr across a version matrix instead of using the ansible-lint GitHub Action directly.
  • Add a matrix strategy for ansible-lint to test multiple ansible-lint, ansible-core, and Python versions.
  • Upgrade tox-lsr installation to version 3.18.0 in the ansible-lint workflow.
  • Replace the previous collection-conversion plus ansible-lint GitHub Action usage with a single tox invocation that both converts the role to a collection and runs ansible-lint using environment variables to pin ansible-lint and ansible-core versions.
.github/workflows/ansible-lint.yml
Run ansible-test via tox-lsr across multiple ansible-core and Python versions instead of using the ansible-test GitHub Action.
  • Add a matrix strategy for ansible-test to cover multiple ansible-core streams (including milestone) and Python versions.
  • Upgrade tox-lsr installation to version 3.18.0 in the ansible-test workflow.
  • Replace the ansible-test GitHub Action with a tox-based flow that converts the role to a collection and runs version-specific ansible-test environments, configuring basepython dynamically from the matrix.
.github/workflows/ansible-test.yml
Standardize tox-lsr version across remaining workflows.
  • Upgrade tox-lsr installation to version 3.18.0 in the ansible-managed-var-comment workflow.
  • Upgrade tox-lsr installation to version 3.18.0 in the qemu-kvm-integration-tests workflow.
.github/workflows/ansible-managed-var-comment.yml
.github/workflows/qemu-kvm-integration-tests.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@richm richm merged commit e4a2f2a into main Apr 8, 2026
11 checks passed
@richm richm deleted the ci-ansible-lint-ansible-test-matrix branch April 8, 2026 22:17
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.

1 participant