Skip to content

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

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]#859
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 and update shared tooling versions.

Build:

  • Update tox-lsr dependency to version 3.18.0 across all GitHub workflows that use it.

CI:

  • Run ansible-lint via tox with a matrix of ansible-lint, ansible-core, and Python versions to cover Automation Hub gating and latest releases.
  • Run ansible-test via tox with a matrix of supported ansible-core and Python versions, including milestone builds, instead of the GitHub ansible-test action.

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 GitHub CI workflows to align with Ansible partner certification expectations by running ansible-lint and ansible-test through tox-lsr-driven collection environments across multiple Ansible/ansible-lint/Python versions, and bumps tox-lsr to 3.18.0 everywhere.

Sequence diagram for matrix-based ansible-lint job execution

sequenceDiagram
  participant GitHubActions
  participant Workflow_ansible_lint
  participant Runner
  participant tox_lsr_3_18_0
  participant tox
  participant ansible_lint
  participant ansible_core

  GitHubActions->>Workflow_ansible_lint: Trigger on push or pull_request
  Workflow_ansible_lint->>Runner: Start ansible-lint job
  Runner->>Runner: Checkout repository
  Runner->>Runner: Update pip and git
  Runner->>tox_lsr_3_18_0: pip install tox-lsr 3.18.0

  loop For each matrix version
    Runner->>Runner: Set up Python matrix.versions.python
    Runner->>tox: Run tox -e collection
    tox->>tox_lsr_3_18_0: Use tox-lsr environments
    tox_lsr_3_18_0-->>tox: Provide collection env

    Runner->>tox: Run tox -e ansible-lint-collection
    Note over Runner, tox: LSR_ANSIBLE_LINT_DEP and\nLSR_ANSIBLE_LINT_ANSIBLE_DEP define\nansible-lint and ansible-core version
    tox->>ansible_lint: Execute ansible-lint with specified version
    tox->>ansible_core: Use ansible-core with specified version
    ansible_lint-->>tox: Lint results
    tox-->>Runner: Job status for this matrix version
  end

  Runner-->>Workflow_ansible_lint: Aggregate matrix results
  Workflow_ansible_lint-->>GitHubActions: Report success or failure
Loading

Flow diagram for updated ansible-lint workflow job steps

flowchart TB
  A[Start ansible-lint workflow] --> B{citest_skip in title or commit?}
  B -- Yes --> C[Skip job]
  B -- No --> D[Run on ubuntu-latest]
  D --> E[Define matrix versions\nansible-lint 24.* / 26.*\nansible-core 2.16.* / 2.20.*\nPython 3.12 / 3.13]
  E --> F[Checkout repository]
  F --> G[Update pip and git]
  G --> H[pip install tox-lsr 3.18.0]
  H --> I{For each matrix version}
  I --> J[Set up Python using actions/setup-python]
  J --> K[Run tox -e collection]
  K --> L[Run tox -e ansible-lint-collection\nwith LSR_ANSIBLE_LINT_DEP and\nLSR_ANSIBLE_LINT_ANSIBLE_DEP]
  L --> M{Next matrix version?}
  M -- Yes --> I
  M -- No --> N[Aggregate matrix results]
  N --> O[Finish workflow]
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 GitHub Actions matrix over ansible-lint, ansible-core, and Python versions with fail-fast disabled.
  • Upgrade tox-lsr to version 3.18.0 for the ansible-lint workflow.
  • Replace the explicit collection conversion plus ansible-lint GitHub Action with a single tox invocation that converts the role to a collection and runs ansible-lint using matrix-defined dependency versions and Python base interpreter.
.github/workflows/ansible-lint.yml
Run ansible-test via tox-lsr across multiple supported Ansible and Python versions instead of using the ansible-test GitHub Action.
  • Add a GitHub Actions matrix over multiple ansible-test targets (2-14 through 2-20 plus milestone) and corresponding Python versions with fail-fast disabled.
  • Upgrade tox-lsr to version 3.18.0 for the ansible-test workflow.
  • Replace the ansible-test GitHub Action with a tox-based step that converts the role to a collection and runs ansible-test against the matrix-defined Ansible versions and Python interpreters.
.github/workflows/ansible-test.yml
Align remaining 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 python-unit-test 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/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 left some high level feedback:

  • Since the tox-lsr version is now hard-coded in multiple workflows, consider centralizing it (e.g., via a reusable workflow or a shared action) to avoid repetitive edits and reduce the risk of version skew in future bumps.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since the tox-lsr version is now hard-coded in multiple workflows, consider centralizing it (e.g., via a reusable workflow or a shared action) to avoid repetitive edits and reduce the risk of version skew in future bumps.

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