Skip to content

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

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

ci: Comply with Ansible partner certification checking [citest_skip]#608
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 test checks with partner certification requirements and broader version coverage.

CI:

  • Run ansible-lint via tox with a version matrix covering Automation Hub gating and latest Ansible/ansible-lint combinations.
  • Run ansible-test via tox across a matrix of supported Ansible core and Python versions, including milestone releases.
  • Standardize GitHub workflows to install tox-lsr from the main branch for all Ansible-related and Python test 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 <[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

Updates CI workflows to align with Ansible partner certification expectations by running ansible-lint and ansible-test across multiple Ansible/Python versions via tox-lsr, and standardizes on using the latest tox-lsr from main instead of a pinned version.

Flow diagram for updated ansible-lint GitHub Actions job

flowchart TD
  A["Start_ansible-lint_job"] --> B["Evaluate_citest_skip_condition"]
  B -->|Not_skipped| C["Create_matrix_over_versions"]
  B -->|Skipped| Z["End_job"]

  C --> D["Checkout_repository"]
  D --> E["Update_pip_and_git"]
  E --> F["Install_tox_and_tox-lsr_from_main"]
  F --> G["Set_up_Python_using_actions_setup-python_with_matrix_python"]

  G --> H["Run_tox_with_env_overrides"]

  subgraph ToxExecution["tox_execution"]
    H1["Set_LSR_ANSIBLE_LINT_DEP_from_matrix_ansible-lint"]
    H2["Set_LSR_ANSIBLE_LINT_ANSIBLE_DEP_from_matrix_ansible"]
    H3["Run_tox_with_testenv_ansible-lint-collection.basepython_set_to_matrix_python"]
    H4["Execute_env_collection_and_ansible-lint-collection"]
  end

  H --> H1 --> H2 --> H3 --> H4 --> I["ansible-lint_runs_against_collection"]

  I --> Z
Loading

File-Level Changes

Change Details Files
Run ansible-lint via tox across a version matrix instead of the ansible-lint GitHub Action on a single environment.
  • Added a matrix strategy to the ansible-lint workflow to exercise multiple ansible-lint, ansible-core, and Python versions, including Automation Hub gating and latest versions.
  • Switched ansible-lint execution from the ansible/ansible-lint GitHub Action to tox-driven collection and ansible-lint environments using LSR_ANSIBLE_LINT_DEP and LSR_ANSIBLE_LINT_ANSIBLE_DEP.
  • Removed custom shell logic for merging collection requirements and manually preparing the converted collection directory for the ansible-lint action, delegating that to tox-lsr testenvs instead.
  • Introduced actions/setup-python to select the matrix Python version before running tox.
.github/workflows/ansible-lint.yml
Run ansible-test via tox across a matrix of Ansible and Python versions instead of a single ansible-test GitHub Action invocation.
  • Added a matrix strategy to the ansible-test workflow to test multiple ansible-core versions (including milestone) across corresponding Python versions.
  • Replaced the ansible-community/ansible-test-gh-action usage with a tox invocation that runs the collection conversion and versioned ansible-test environments driven by tox-lsr.
  • Introduced actions/setup-python to ensure each matrix job uses the appropriate Python version before running tox.
.github/workflows/ansible-test.yml
Standardize on installing tox-lsr from the main branch across CI workflows instead of a pinned 3.17.1 version.
  • Updated all GitHub workflows that install tox-lsr to use the main branch of the tox-lsr repository via pip instead of a specific tagged version.
.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 found 1 issue, and left some high level feedback:

  • Installing tox-lsr from the main branch (git+https://github.com/linux-system-roles/tox-lsr@main) makes CI behavior dependent on unreleased upstream changes; consider pinning to a tagged version or commit SHA to keep the workflows reproducible.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Installing tox-lsr from the main branch (`git+https://github.com/linux-system-roles/tox-lsr@main`) makes CI behavior dependent on unreleased upstream changes; consider pinning to a tagged version or commit SHA to keep the workflows reproducible.

## Individual Comments

### Comment 1
<location path=".github/workflows/ansible-lint.yml" line_range="33" />
<code_context>
+        # https://github.com/ansible-collections/partner-certification-checker/blob/main/.github/workflows/certification-reusable.yml#L108
+        versions:
+          - { ansible-lint: "24.*", ansible: "2.16.*", python: "3.12" }
+          - { ansible-lint: "26.*", ansible: "2.20.*", python: "3.14" }
     steps:
       - name: Update pip, git
</code_context>
<issue_to_address>
**issue (bug_risk):** Using Python 3.14 in the matrix may break the workflow until that version is actually supported by setup-python and the toolchain

`actions/setup-python` and the current Python ecosystem don’t yet support 3.14, so this job will fail once it runs (`Version 3.14 not found`). Consider either gating this entry with a condition, using the latest stable (e.g. 3.12/3.13) for now, or commenting it out until 3.14 is officially supported by `actions/setup-python` and the ansible/ansible-lint versions you depend on.
</issue_to_address>

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.

# https://github.com/ansible-collections/partner-certification-checker/blob/main/.github/workflows/certification-reusable.yml#L108
versions:
- { ansible-lint: "24.*", ansible: "2.16.*", python: "3.12" }
- { ansible-lint: "26.*", ansible: "2.20.*", python: "3.14" }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Using Python 3.14 in the matrix may break the workflow until that version is actually supported by setup-python and the toolchain

actions/setup-python and the current Python ecosystem don’t yet support 3.14, so this job will fail once it runs (Version 3.14 not found). Consider either gating this entry with a condition, using the latest stable (e.g. 3.12/3.13) for now, or commenting it out until 3.14 is officially supported by actions/setup-python and the ansible/ansible-lint versions you depend on.

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