Skip to content

ci: Comply with Ansible partner certification checking#607

Closed
richm wants to merge 1 commit intomainfrom
ci-ansible-lint-ansible-test-matrix
Closed

ci: Comply with Ansible partner certification checking#607
richm wants to merge 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 [email protected]

Summary by Sourcery

Update CI workflows to align ansible-lint and ansible-test checks with Ansible partner certification requirements using tox-lsr-driven collection testing.

Enhancements:

  • Switch tox-lsr usage across workflows to track the latest code from the main branch instead of a pinned release.

CI:

  • Extend ansible-lint workflow to run against a matrix of ansible-lint, ansible-core, and Python versions matching Automation Hub gating and latest releases.
  • Replace direct GitHub Action invocations for ansible-lint and ansible-test with tox-based collection jobs, including a matrix of ansible-test runs across supported and milestone Ansible versions.
  • Update managed var comment, Python unit test, and QEMU/KVM integration workflows to install tox-lsr from the main branch for consistency with new CI checks.

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 <[email protected]>
@richm richm self-assigned this Apr 8, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 8, 2026

Reviewer's Guide

This PR updates the CI workflows to align with Ansible partner certification expectations by running ansible-lint and ansible-test via tox-lsr across multiple Ansible/ansible-lint versions, and by standardizing all workflows to use the latest tox-lsr from the main branch instead of a pinned release.

Sequence diagram for multi-version ansible-lint CI execution

sequenceDiagram
  actor Developer
  participant GitHubActions
  participant Job_ansible_lint
  participant tox_lsr
  participant ansible_lint
  participant ansible_core

  Developer->>GitHubActions: Push or pull_request
  GitHubActions->>Job_ansible_lint: Start workflow ansible-lint.yml
  GitHubActions->>Job_ansible_lint: Expand matrix versions

  loop for each matrix_version
    Job_ansible_lint->>Job_ansible_lint: Update pip and git
    Job_ansible_lint->>Job_ansible_lint: Checkout repository
    Job_ansible_lint->>Job_ansible_lint: pip install tox-lsr@main

    Job_ansible_lint->>tox_lsr: Run tox -e collection,ansible-lint-collection
    Note over Job_ansible_lint, tox_lsr: LSR_ANSIBLE_LINT_DEP, LSR_ANSIBLE_LINT_ANSIBLE_DEP,<br>python base set from matrix version

    tox_lsr->>ansible_core: Install specified ansible-core version
    tox_lsr->>ansible_lint: Install specified ansible-lint version
    tox_lsr->>ansible_lint: Run ansible-lint against converted collection
    ansible_lint-->>tox_lsr: Lint results
    tox_lsr-->>Job_ansible_lint: tox exit status
  end

  Job_ansible_lint-->>GitHubActions: Matrix job status
  GitHubActions-->>Developer: Report CI status
Loading

File-Level Changes

Change Details Files
Run ansible-lint for multiple Ansible/ansible-lint/Python combinations using tox instead of the ansible-lint GitHub Action.
  • Add a job matrix defining two ansible-lint/ansible-core/python version tuples matching Automation Hub gating and latest versions.
  • Replace the previous collection-conversion-plus-ansible-lint-action flow with a single tox invocation that both converts the role to a collection and runs ansible-lint.
  • Inject ansible-lint and ansible-core versions into tox via LSR_ANSIBLE_LINT_DEP and LSR_ANSIBLE_LINT_ANSIBLE_DEP environment variables and override the ansible-lint-collection basepython from the matrix.
.github/workflows/ansible-lint.yml
Run ansible-test through tox across a matrix of supported Ansible versions instead of a single ansible-test GitHub Action invocation.
  • Add a strategy matrix over ansible_version covering 2-14 through 2-20 and milestone.
  • Replace the standalone ansible-test GitHub Action with a tox command that first converts the role to a collection and then runs ansible-test for the selected version-specific environment.
  • Keep the sanity testing intent but delegate all orchestration to tox-lsr-managed tox environments.
.github/workflows/ansible-test.yml
Standardize on the latest tox-lsr from the main branch across all CI workflows.
  • Update ansible-lint workflow to install tox-lsr from the main branch via pip instead of a pinned 3.17.1 version.
  • Update ansible-test workflow to install tox-lsr from the main branch.
  • Update ansible-managed-var-comment workflow to install tox-lsr from the main branch.
  • Update python-unit-test workflow to install tox-lsr from the main branch alongside tox and virtualenv.
  • Update qemu-kvm-integration-tests workflow to install tox-lsr from the main branch in the integration test setup.
.github/workflows/ansible-lint.yml
.github/workflows/ansible-test.yml
.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:

  • Consider pinning tox-lsr to a released tag or commit SHA instead of @main in all workflows to keep CI runs reproducible and avoid unexpected breakages from upstream changes.
  • The ansible-lint matrix uses python: "3.14", which is not yet available on ubuntu-latest; you may want to target a currently supported version (e.g. 3.12/3.13) or verify that the runner image actually provides 3.14 to prevent job failures.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider pinning `tox-lsr` to a released tag or commit SHA instead of `@main` in all workflows to keep CI runs reproducible and avoid unexpected breakages from upstream changes.
- The ansible-lint matrix uses `python: "3.14"`, which is not yet available on `ubuntu-latest`; you may want to target a currently supported version (e.g. 3.12/3.13) or verify that the runner image actually provides 3.14 to prevent job failures.

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 closed this Apr 8, 2026
@richm richm deleted the ci-ansible-lint-ansible-test-matrix branch April 8, 2026 14:24
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