Skip to content

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

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]#269
richm merged 1 commit intomainfrom
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

Update CI workflows to align with Ansible partner certification requirements by running ansible-lint and ansible-test across multiple supported Ansible and Python versions using tox-lsr.

CI:

  • Run ansible-lint in CI via tox in collection format across a matrix of ansible-lint, ansible-core, and Python versions instead of using the ansible-lint GitHub Action.
  • Run ansible-test in CI via tox across a matrix of supported and milestone Ansible core versions and Python versions instead of a single ansible-test GitHub Action invocation.
  • Upgrade tox-lsr to version 3.18.0 across all relevant GitHub workflows, including lint, ansible-managed-var comment, and qemu-kvm integration tests.

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 CI workflows to use tox-lsr 3.18.0 and run ansible-lint and ansible-test via tox across multiple Ansible/ansible-lint/Python versions, aligning with Ansible partner certification requirements while removing direct GitHub Action invocations and custom requirement merging logic.

File-Level Changes

Change Details Files
Run ansible-lint via tox across a matrix of ansible-lint/ansible-core/Python versions instead of using the ansible-lint GitHub Action and custom collection requirements merging.
  • Add a job strategy matrix defining ansible-lint, ansible-core, and Python version combinations to cover Automation Hub gating and latest versions.
  • Upgrade tox-lsr dependency from 3.17.1 to 3.18.0 in the ansible-lint workflow.
  • Introduce actions/setup-python to select the matrix Python version for each job run.
  • Replace the separate collection-conversion and ansible-lint GitHub Action steps with a single tox invocation that converts to collection format and runs ansible-lint using LSR_ANSIBLE_LINT_DEP and LSR_ANSIBLE_LINT_ANSIBLE_DEP environment variables and overrides the basepython for the ansible-lint tox environment.
  • Remove custom logic that merged meta and tests collection requirements and passed them into the ansible-lint Action.
.github/workflows/ansible-lint.yml
Run ansible-test across a matrix of Ansible core and Python versions using tox instead of the ansible-test GitHub Action.
  • Add a job strategy matrix to cover multiple ansible-core branches (2-14 through 2-20 plus milestone) with corresponding Python versions.
  • Upgrade tox-lsr dependency from 3.17.1 to 3.18.0 in the ansible-test workflow.
  • Introduce actions/setup-python to configure the matrix Python version before running tests.
  • Replace the ansible-test GitHub Action invocation with a tox call that performs collection conversion and runs the appropriate ansible-test tox environment with per-matrix basepython overrides.
.github/workflows/ansible-test.yml
Align other CI workflows with tox-lsr 3.18.0.
  • Bump tox-lsr from 3.17.1 to 3.18.0 in the ansible-managed-var-comment workflow.
  • Bump 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:

  • In the ansible-lint workflow matrix, the ansible_lint values use wildcard specs like "24.*" but are installed with ansible-lint==…, which will fail; either drop the wildcard or switch to a compatible operator (e.g. ~=) or explicit version numbers.
  • In both the ansible-lint and ansible-test workflows, consider moving the pip3 install ... tox-lsr step to after actions/setup-python so tox/tox-lsr are installed into (and run with) the matrix Python version rather than whichever Python happens to be default on the runner.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the ansible-lint workflow matrix, the `ansible_lint` values use wildcard specs like `"24.*"` but are installed with `ansible-lint==…`, which will fail; either drop the wildcard or switch to a compatible operator (e.g. `~=`) or explicit version numbers.
- In both the ansible-lint and ansible-test workflows, consider moving the `pip3 install ... tox-lsr` step to after `actions/setup-python` so tox/tox-lsr are installed into (and run with) the matrix Python version rather than whichever Python happens to be default on the runner.

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