Skip to content

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

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

Align CI Ansible linting and testing workflows with Ansible partner certification requirements by running tox-based checks across multiple supported Ansible and Python versions.

CI:

  • Run ansible-lint in CI via tox against a matrix of supported ansible-lint, ansible-core, and Python versions instead of the ansible-lint GitHub Action.
  • Run ansible-test sanity checks in CI via tox across a matrix of Ansible core and Python versions, including milestone releases, instead of the ansible-test GitHub Action.
  • Update all GitHub workflows using tox-lsr to the latest 3.18.0 release to support the new certification-oriented CI jobs.

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 requested a review from ptoscano as a code owner April 8, 2026 22:00
@richm richm self-assigned this Apr 8, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 8, 2026

Reviewer's Guide

Align CI with Ansible partner certification requirements by running ansible-lint and ansible-test via tox-lsr across multiple Ansible/Python versions, and by updating tox-lsr to 3.18.0 in all relevant workflows.

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

sequenceDiagram
  actor Developer
  participant GitHubActions as GitHub_Actions
  participant AnsibleLintWorkflow as ansible_lint_workflow
  participant Runner as ubuntu_latest_runner
  participant Tox as tox_lsr
  participant AnsibleLint as ansible_lint
  participant AnsibleCore as ansible_core

  Developer->>GitHubActions: push_or_pull_request
  GitHubActions->>AnsibleLintWorkflow: trigger_ansible_lint_job
  AnsibleLintWorkflow->>Runner: start_job_with_matrix_versions

  loop for_each_matrix_entry
    Runner->>Runner: setup_python(matrix.versions.python)
    Runner->>Runner: pip_install_tox_lsr_3_18_0
    Runner->>Tox: run_tox_envs(collection,ansible_lint_collection)
    Tox->>AnsibleCore: install_ansible_core(matrix.versions.ansible)
    Tox->>AnsibleLint: install_ansible_lint(matrix.versions.ansible_lint)
    Tox->>AnsibleLint: run_ansible_lint_on_collection
    AnsibleLint-->>Tox: lint_results
    Tox-->>Runner: exit_code_per_matrix_entry
  end

  Runner-->>AnsibleLintWorkflow: combined_matrix_status
  AnsibleLintWorkflow-->>GitHubActions: job_status
  GitHubActions-->>Developer: report_check_results
Loading

File-Level Changes

Change Details Files
Run ansible-lint via tox-lsr against multiple Ansible/ansible-lint/Python versions instead of using the ansible-lint GitHub Action on a single converted collection.
  • Add a GitHub Actions matrix strategy defining two target combinations of ansible-lint, ansible-core, and Python versions.
  • Upgrade tox-lsr used in the ansible-lint workflow from 3.17.1 to 3.18.0.
  • Replace the separate collection conversion and ansible-lint GitHub Action steps with a single shell step that converts the role to a collection and runs the ansible-lint-collection tox environments parameterized by matrix variables.
  • Remove the custom YAML merging logic for collection requirements and the dependence on ANSIBLE_COLLECTIONS_PATH and ansible-lint action inputs.
.github/workflows/ansible-lint.yml
Run ansible-test via tox-lsr across a matrix of Ansible and Python versions instead of using the ansible-test GitHub Action with a single version.
  • Add a GitHub Actions matrix strategy defining multiple ansible-core release lines (including milestone) and corresponding Python versions.
  • Upgrade tox-lsr used in the ansible-test workflow from 3.17.1 to 3.18.0.
  • Introduce an explicit setup-python step that selects the Python version from the matrix.
  • Replace the ansible-test GitHub Action invocation with a tox command that runs collection conversion and versioned ansible-test environments keyed by matrix ansible version.
.github/workflows/ansible-test.yml
Standardize on tox-lsr 3.18.0 across remaining CI workflows.
  • Update tox-lsr installation in the ansible-managed-var-comment workflow to 3.18.0.
  • Update tox-lsr installation in the qemu-kvm-integration-tests workflow to 3.18.0.
.github/workflows/ansible-managed-var-comment.yml
.github/workflows/qemu-kvm-integration-tests.yml
Prepare for new linting configuration by adding or modifying the .ansible-lint configuration file (content not shown in diff).
  • Introduce or adjust the .ansible-lint configuration file to align with the new ansible-lint execution model via tox-lsr.
.ansible-lint

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