Skip to content

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

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]#252
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 ansible-lint and ansible-test checks with Ansible partner certification requirements by testing multiple supported versions via tox-lsr.

CI:

  • Expand ansible-lint workflow to run ansible-lint and ansible-core across a matrix of versions using tox-based collection conversion instead of the ansible-lint GitHub Action.
  • Expand ansible-test workflow to run ansible-test sanity checks across a matrix of ansible-core and Python versions using tox-managed environments rather than the ansible-test GitHub Action.
  • Upgrade tox-lsr to version 3.18.0 in all GitHub workflows, including ansible-lint, ansible-test, managed var comment, python unit tests, 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

Align CI with Ansible partner certification expectations by running ansible-lint and ansible-test via tox-lsr across multiple Ansible/Python versions and updating tox-lsr to 3.18.0 in all workflows, replacing the previous GitHub Actions-based lint/test invocations and custom collection-conversion logic.

Sequence diagram for updated ansible-lint CI workflow

sequenceDiagram
    actor Developer
    participant GitHub as GitHub
    participant Workflow_ansible_lint as Workflow_ansible_lint
    participant Matrix as Matrix_versions
    participant Tox as tox_lsr
    participant AnsibleLint as ansible_lint

    Developer->>GitHub: push_or_pull_request
    GitHub->>Workflow_ansible_lint: trigger_if_not_citest_skip
    Workflow_ansible_lint->>Matrix: expand_versions_matrix
    loop for_each_matrix_entry
        Matrix->>Workflow_ansible_lint: provide_ansible_lint_ansible_python_versions
        Workflow_ansible_lint->>Workflow_ansible_lint: update_pip_and_git
        Workflow_ansible_lint->>Workflow_ansible_lint: install_tox_lsr_3_18_0
        Workflow_ansible_lint->>Workflow_ansible_lint: setup_python_for_matrix_version
        Workflow_ansible_lint->>Tox: run_collection_and_ansible_lint_environments
        Tox->>AnsibleLint: execute_ansible_lint_with_specified_versions
        AnsibleLint-->>Tox: lint_results
        Tox-->>Workflow_ansible_lint: job_status
    end
    Workflow_ansible_lint-->>GitHub: report_combined_matrix_status
    GitHub-->>Developer: ci_status_on_commit_or_pr
Loading

Flow diagram for multi-version ansible-lint job execution

flowchart TD
    TRIG["CI trigger (push or pull_request without [citest_skip])"] --> JOB["Start ansible_lint job"]
    JOB --> STRAT["Define strategy matrix with ansible_lint, ansible_core, python versions"]
    STRAT --> LOOP["For each matrix entry"]

    LOOP --> SETUP_PY["Set up Python for matrix python version"]
    SETUP_PY --> INST_ToxLSR["Install tox_lsr 3.18.0 via pip"]
    INST_ToxLSR --> SET_ENV["Set LSR_ANSIBLE_LINT_DEP and LSR_ANSIBLE_LINT_ANSIBLE_DEP from matrix"]
    SET_ENV --> RUN_TOX["Run tox with environments collection and ansible_lint_collection
(testenv:ansible_lint_collection.basepython set to matrix python)"]
    RUN_TOX --> LINT_RES["ansible_lint results for this version set"]

    LINT_RES --> DECIDE{More matrix entries?}
    DECIDE -->|Yes| LOOP
    DECIDE -->|No| REPORT["Report combined status back to GitHub"]
    REPORT --> END["ansible_lint job completed"]
Loading

File-Level Changes

Change Details Files
Refactor ansible-lint workflow to run collection conversion and ansible-lint via tox-lsr across a matrix of Ansible/ansible-lint/Python versions instead of using the ansible-lint GitHub Action and custom requirement merging.
  • Add a matrix strategy with fail-fast disabled to test two ansible-lint/ansible-core/python version combinations matching Automation Hub gating and latest releases.
  • Upgrade tox-lsr used in the workflow from version 3.17.1 to 3.18.0.
  • Introduce actions/setup-python to select the matrix-defined Python version before running tests.
  • Replace custom role-to-collection conversion, requirements merging, and ansible-lint GitHub Action usage with a single tox invocation that both converts to a collection and runs ansible-lint using LSR_ANSIBLE_LINT_* env vars to pin ansible-lint and ansible-core versions.
.github/workflows/ansible-lint.yml
Refactor ansible-test workflow to run collection conversion and ansible-test via tox-lsr with a matrix of Ansible/Python versions instead of using the ansible-test GitHub Action.
  • Add a matrix strategy over multiple ansible-core channels (2-14 through 2-20 plus milestone) and corresponding Python versions with fail-fast disabled to collect all failures.
  • Upgrade tox-lsr from version 3.17.1 to 3.18.0.
  • Introduce actions/setup-python to use the matrix Python version.
  • Replace direct ansible-test GitHub Action usage and separate collection conversion step with a tox invocation that converts to a collection and runs the appropriate ansible-test environment per matrix entry.
.github/workflows/ansible-test.yml
Standardize tox-lsr version to 3.18.0 in remaining CI workflows.
  • 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 while preserving existing tox/virtualenv handling.
  • 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:

  • The tox-lsr version pin is duplicated across multiple workflows; consider centralizing this (e.g., via a reusable workflow, composite action, or shared workflow variable) 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 tox-lsr version pin is duplicated across multiple workflows; consider centralizing this (e.g., via a reusable workflow, composite action, or shared workflow variable) 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 6ea2575 into main Apr 8, 2026
14 checks passed
@richm richm deleted the ci-ansible-lint-ansible-test-matrix branch April 8, 2026 22:14
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