Skip to content

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

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]#343
richm merged 1 commit into
mainfrom
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 align ansible-lint and ansible-test checks with Ansible partner certification requirements.

CI:

  • Run ansible-lint in CI via tox against multiple ansible-lint/ansible-core/python version combinations instead of the GitHub Action.
  • Run ansible-test sanity checks via tox across a matrix of supported and milestone ansible-core/python versions instead of the dedicated GitHub Action.
  • Upgrade tox-lsr to version 3.18.0 across all GitHub workflows, including linting, ansible-managed variable checks, 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

Updates 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 by upgrading tox-lsr to 3.18.0 everywhere.

Sequence diagram for updated ansible-lint CI job using tox-lsr matrix

sequenceDiagram
  participant GitHub as GitHub_Actions
  participant Job as ansible-lint_job
  participant Matrix as lint_matrix_entry
  participant Py as setup-python_action
  participant ToxLSR as tox-lsr_3_18_0
  participant Tox as tox
  participant Lint as ansible-lint
  participant Core as ansible-core

  GitHub->>Job: trigger_on_PR_or_push
  Job->>Job: expand_matrix_versions
  Job->>Matrix: select_versions(ansible_lint_version, ansible_core_version, python_version)

  Job->>ToxLSR: pip_install(tox-lsr_3_18_0)
  Job->>Py: setup_python(python_version)

  Job->>Tox: run_tox(env=collection,ansible-lint-collection,LSR_ANSIBLE_LINT_DEP,LSR_ANSIBLE_LINT_ANSIBLE_DEP,ansible-lint-collection.basepython)

  Tox->>Core: install(ansible-core==matrix.ansible_core_version)
  Tox->>Lint: install(ansible-lint==matrix.ansible_lint_version)

  Tox->>Lint: execute_ansible-lint_on_collection
  Lint-->>Tox: lint_results
  Tox-->>Job: tox_exit_status
  Job-->>GitHub: report_check_status
Loading

File-Level Changes

Change Details Files
Run ansible-lint via tox-lsr across a version matrix instead of the GitHub Action, and parameterize Ansible/ansible-lint/Python versions.
  • Add a matrix strategy with two ansible-lint/ansible-core/python version combinations and disable fail-fast for the ansible-lint job.
  • Upgrade tox-lsr used in the workflow from version 3.17.1 to 3.18.0.
  • Replace the separate collection-conversion and ansible-lint GitHub Action steps with a single tox invocation that converts to a collection and runs ansible-lint using LSR_ANSIBLE_LINT_DEP and LSR_ANSIBLE_LINT_ANSIBLE_DEP along with a per-matrix basepython override.
.github/workflows/ansible-lint.yml
Run ansible-test via tox-lsr for multiple Ansible versions and Python versions instead of the ansible-test GitHub Action.
  • Add a matrix strategy listing multiple ansible-test environments (including milestone) mapped to specific Python versions and disable fail-fast for the ansible-test job.
  • Upgrade tox-lsr used in the workflow from version 3.17.1 to 3.18.0.
  • Replace the separate collection-conversion step and the ansible-test GitHub Action with a single tox command that runs collection conversion and versioned ansible-test environments, using per-matrix basepython overrides.
.github/workflows/ansible-test.yml
Align remaining workflows with the new tox-lsr baseline version.
  • Upgrade tox-lsr to version 3.18.0 in the ansible-managed-var-comment workflow.
  • Upgrade tox-lsr 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 left some high level feedback:

  • The previous ansible-lint workflow merged meta/collection-requirements.yml and tests/collection-requirements.yml; if both files are still expected to be honored, consider replicating that merge behavior inside the tox/lsr pipeline to avoid silently dropping dependencies.
  • The git+https://github.com/linux-system-roles/tox-lsr@3.18.0 reference is duplicated across several workflows; consider centralizing this (e.g., via a reusable workflow or shared action) so future version bumps only need to be made in one place.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The previous ansible-lint workflow merged `meta/collection-requirements.yml` and `tests/collection-requirements.yml`; if both files are still expected to be honored, consider replicating that merge behavior inside the tox/lsr pipeline to avoid silently dropping dependencies.
- The `git+https://github.com/linux-system-roles/tox-lsr@3.18.0` reference is duplicated across several workflows; consider centralizing this (e.g., via a reusable workflow or shared action) so future version bumps only need to be made in one place.

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