Skip to content

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

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

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

Conversation

@richm
Copy link
Copy Markdown
Collaborator

@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 collection-based checks via tox across multiple supported Ansible and Python versions.

CI:

  • Run ansible-lint via tox against the collection across a matrix of ansible-lint, ansible-core, and Python versions instead of using the ansible-lint GitHub Action.
  • Run ansible-test via tox for multiple supported and milestone ansible-core versions and Python versions instead of using the ansible-test GitHub Action.
  • Upgrade tox-lsr to version 3.18.0 in all GitHub workflows that rely on it.

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
@richm richm requested review from rjeffman and spetrosi as code owners April 8, 2026 21:59
@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 via tox-lsr across multiple Ansible/Python versions, and by standardizing on tox-lsr 3.18.0.

Sequence diagram for multi-version ansible-lint CI job

sequenceDiagram
  actor Developer
  participant GitHub
  participant Workflow as ansible_lint_workflow
  participant Matrix as strategy_matrix
  participant Runner as gha_runner
  participant Pip as pip_and_tox_lsr
  participant Python as setup_python
  participant Tox as tox
  participant LintEnv as tox_env_ansible_lint_collection
  participant AnsibleLint as ansible_lint
  participant AnsibleCore as ansible_core

  Developer->>GitHub: push or pull_request
  GitHub->>Workflow: trigger ansible-lint workflow

  Workflow->>Matrix: expand versions matrix
  Matrix-->>Workflow: job instances per version

  loop for each matrix version
    Workflow->>Runner: start job with selected versions
    Runner->>Pip: install tox_lsr_3_18_0 via pip
    Runner->>Python: setup python_version from matrix
    Runner->>Tox: run tox with env collection and ansible_lint_collection
    Tox->>LintEnv: create env with ansible_lint and ansible_core from env vars
    LintEnv->>AnsibleCore: load specified ansible_core version
    LintEnv->>AnsibleLint: run ansible_lint on collection
    AnsibleLint-->>Workflow: report lint results for version
  end
Loading

File-Level Changes

Change Details Files
Run ansible-lint via tox in a version matrix instead of using the ansible-lint GitHub Action against a converted collection.
  • Add a GitHub Actions matrix strategy to run ansible-lint across two ansible-lint/ansible-core/python version combinations
  • Upgrade tox-lsr used in the lint workflow from 3.17.1 to 3.18.0
  • Introduce setup-python step keyed off the matrix Python version
  • Replace manual collection conversion plus ansible-lint GitHub Action invocation with a single tox call that both converts the role and runs ansible-lint, parameterized via LSR_ANSIBLE_LINT_DEP and LSR_ANSIBLE_LINT_ANSIBLE_DEP and overriding the testenv basepython
.github/workflows/ansible-lint.yml
Run ansible-test via tox with a broad matrix of ansible-core and Python versions instead of the ansible-test GitHub Action.
  • Add a GitHub Actions matrix strategy to cover multiple ansible-core tracks (2-14 through 2-20 plus milestone) and corresponding Python versions
  • Upgrade tox-lsr used in the ansible-test workflow from 3.17.1 to 3.18.0
  • Introduce setup-python step keyed off the matrix Python version
  • Replace the ansible-test GitHub Action with a tox invocation that runs the collection conversion and an ansible-test environment matching the matrix-selected ansible-core version, overriding basepython for each env
.github/workflows/ansible-test.yml
Standardize all CI workflows on tox-lsr 3.18.0.
  • Bump tox-lsr version from 3.17.1 to 3.18.0 in the ansible-managed-var-comment workflow
  • Bump tox-lsr version from 3.17.1 to 3.18.0 in the python-unit-test workflow
  • Bump tox-lsr version from 3.17.1 to 3.18.0 in the qemu-kvm-integration-tests workflow
.github/workflows/ansible-managed-var-comment.yml
.github/workflows/python-unit-test.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 8b30555 into main Apr 8, 2026
13 checks passed
@richm richm deleted the ci-ansible-lint-ansible-test-matrix branch April 8, 2026 22: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.

1 participant