Skip to content

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

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]#497
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

Update CI workflows to run Ansible partner certification-style checks across multiple supported Ansible and Python versions using tox-lsr.

CI:

  • Expand ansible-lint workflow to run collection linting via tox across a matrix of ansible-lint, ansible-core, and Python versions aligned with Automation Hub gating and latest releases.
  • Expand ansible-test workflow to run collection tests via tox across multiple supported ansible-core and Python combinations, including the current milestone release.
  • Standardize CI Python setup using actions/setup-python in Ansible-related workflows.
  • Bump 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
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 8, 2026

Reviewer's Guide

Updates CI workflows to align with Ansible partner certification expectations by running ansible-lint and ansible-test via tox across a matrix of supported Ansible and Python versions, while upgrading tox-lsr and removing direct GitHub actions integrations for lint/test.

Sequence diagram for ansible-lint job execution via tox matrix

sequenceDiagram
  actor Dev
  participant GitHub
  participant Workflow as ansible_lint_workflow
  participant Matrix as Matrix_scheduler
  participant Runner as GHA_runner
  participant Pip as pip_tox_lsr
  participant PySetup as setup_python
  participant Tox as tox
  participant Lint as ansible_lint

  Dev->>GitHub: Push or open PR
  GitHub->>Workflow: Trigger ansible-lint.yml
  Workflow->>Workflow: Check [citest_skip]
  alt not skipped
    Workflow->>Matrix: Define matrix (ansible_lint, ansible, python)
    Matrix->>Runner: Start job per matrix entry

    Runner->>Pip: Install tox-lsr 3.18.0
    Pip-->>Runner: tox-lsr installed

    Runner->>PySetup: Set up Python matrix version
    PySetup-->>Runner: Python ready

    Runner->>Tox: Run -e collection,ansible-lint-collection
    Tox->>Tox: Read LSR_ANSIBLE_LINT_DEP
    Tox->>Tox: Read LSR_ANSIBLE_LINT_ANSIBLE_DEP
    Tox->>Lint: Install and invoke ansible-lint
    Lint-->>Tox: Lint results
    Tox-->>Runner: Job status for matrix entry
    Runner-->>Workflow: Matrix status aggregated
  else skipped
    Workflow-->>GitHub: ansible-lint job skipped
  end

  Workflow-->>GitHub: Report CI status to PR
Loading

File-Level Changes

Change Details Files
Run ansible-lint via tox across multiple Ansible/ansible-lint/Python versions instead of using the ansible-lint GitHub Action against a pre-converted collection.
  • Add a matrix strategy to the ansible-lint workflow with two ansible-lint/ansible-core/Python version combinations to mirror Automation Hub gating and latest versions.
  • Upgrade tox-lsr used in the ansible-lint workflow from 3.17.1 to 3.18.0.
  • Introduce a setup-python step that uses the matrix Python version.
  • Replace the bespoke collection conversion + requirements merge + ansible-lint GitHub Action invocation with a single shell step that sets LSR_ANSIBLE_LINT_* env vars and runs tox for the collection and ansible-lint-collection environments, with basepython overridden from the matrix.
.github/workflows/ansible-lint.yml
Run ansible-test via tox for a matrix of Ansible versions (including milestone) and Python versions instead of using the ansible-test GitHub Action with a single Ansible version.
  • Add a matrix strategy to the ansible-test workflow covering multiple ansible-test targets (2-14 through 2-20 and milestone) and associated Python versions.
  • Upgrade tox-lsr used in the ansible-test workflow from 3.17.1 to 3.18.0.
  • Introduce a setup-python step that uses the matrix Python version.
  • Replace the separate collection conversion step and ansible-test GitHub Action with a single tox invocation that runs the collection and ansible-test- environments, overriding basepython from the matrix.
.github/workflows/ansible-test.yml
Align remaining workflows with the newer tox-lsr version used for certification-aligned checks.
  • Upgrade tox-lsr from 3.17.1 to 3.18.0 in the ansible-managed-var-comment workflow.
  • Upgrade tox-lsr from 3.17.1 to 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 left some high level feedback:

  • The ansible/ansible-lint/Python version tuples are now hard-coded in multiple workflow matrices; consider centralizing them via a reusable workflow or a single strategy definition to avoid version skew during future updates.
  • The tox environment names are constructed dynamically from matrix.versions.ansible (e.g., ansible-test-2-14, milestone); it may be safer to constrain matrix.versions.ansible to a small set of constants that directly match known tox env names to reduce the chance of silent CI breakage when editing these values.
  • Given the expanded matrices, you may want to add a pip/~/.cache/pip cache (or a tox cache) in these workflows to avoid repeatedly reinstalling the same dependencies across matrix jobs and speed up CI.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The ansible/ansible-lint/Python version tuples are now hard-coded in multiple workflow matrices; consider centralizing them via a reusable workflow or a single strategy definition to avoid version skew during future updates.
- The tox environment names are constructed dynamically from `matrix.versions.ansible` (e.g., `ansible-test-2-14`, `milestone`); it may be safer to constrain `matrix.versions.ansible` to a small set of constants that directly match known tox env names to reduce the chance of silent CI breakage when editing these values.
- Given the expanded matrices, you may want to add a `pip`/`~/.cache/pip` cache (or a tox cache) in these workflows to avoid repeatedly reinstalling the same dependencies across matrix jobs and speed up CI.

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