Skip to content

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

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]#79
richm merged 1 commit into
mainfrom
ci-ansible-lint-ansible-test-matrix

Conversation

@richm

@richm richm commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

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 run Ansible linting and testing across multiple supported Ansible and Python versions using tox-based checkers aligned with partner certification requirements.

CI:

  • Extend ansible-lint workflow to run via tox against multiple ansible-lint, ansible-core, and Python version combinations instead of the ansible-lint GitHub Action.
  • Extend ansible-test workflow to run ansible-test via tox across a matrix of Ansible and Python versions, replacing the ansible-test GitHub Action.
  • Upgrade tox-lsr to version 3.18.0 across CI workflows, including linting, managed-var comment checks, 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
@richm
richm requested a review from spetrosi as a code owner April 8, 2026 21:59
@sourcery-ai

sourcery-ai Bot commented Apr 8, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates CI workflows to align with Ansible Partner Certification requirements by running ansible-lint and ansible-test through tox-lsr across multiple Ansible and Python versions, and by upgrading tox-lsr to 3.18.0 everywhere it is used.

Sequence diagram for ansible-lint CI job with multi-version matrix

sequenceDiagram
  actor Developer
  participant GitHub as GitHub_Actions
  participant Workflow as Workflow_ansible_lint
  participant Runner as GitHub_Runner
  participant tox_lsr as tox_lsr_3_18_0
  participant tox as tox
  participant LintEnv as tox_env_ansible_lint_collection
  participant AnsibleLint as ansible_lint
  participant AnsibleCore as ansible_core

  Developer->>GitHub: Push_commit_or_open_PR
  GitHub->>Workflow: Trigger_workflow_if_not_citest_skip

  Workflow->>Runner: Start_job_with_matrix_versions
  loop For_each_matrix_version
    Runner->>Runner: Update_pip_and_git
    Runner->>Runner: Checkout_repository
    Runner->>Runner: Install_tox_lsr_3_18_0
    Runner->>Runner: Setup_python(matrix_python_version)

    Runner->>tox_lsr: Invoke_tox_with_env_vars\nLSR_ANSIBLE_LINT_DEP\nLSR_ANSIBLE_LINT_ANSIBLE_DEP
    tox_lsr->>tox: Configure_and_run_tox_environment
    tox->>LintEnv: Create_and_activate_environment

    LintEnv->>AnsibleCore: Install_ansible_core(matrix_ansible_version)
    LintEnv->>AnsibleLint: Install_ansible_lint(matrix_lint_version)

    LintEnv->>AnsibleLint: Run_ansible_lint_on_collection
    AnsibleLint-->>LintEnv: Lint_results
    LintEnv-->>Runner: Job_status_for_matrix_version
  end

  Runner-->>GitHub: Report_overall_job_status
  GitHub-->>Developer: CI_status_checks_updated
Loading

Flow diagram for updated ansible-lint workflow matrix and tox-lsr usage

flowchart TD
  start["Workflow_start (push_or_pull_request)"]
  check_skip{"Title_or_commit_contains_citest_skip"}
  exit["Skip_jobs"]
  run_job["Run_ansible_lint_job"]

  matrix["Create_matrix_versions\n- ansible_lint_24_x / ansible_core_2_16_x / python_3_12\n- ansible_lint_26_x / ansible_core_2_20_x / python_3_13"]

  step_update["Step: Update_pip_and_git"]
  step_checkout["Step: actions_checkout"]
  step_install_toxlsr["Step: pip_install_tox_lsr_3_18_0"]
  step_setup_python["Step: actions_setup_python\npython_version = matrix.versions.python"]

  step_run_tox["Step: Run_tox_with_envs\nLSR_ANSIBLE_LINT_DEP = ansible_lint==matrix.versions.ansible_lint\nLSR_ANSIBLE_LINT_ANSIBLE_DEP = ansible_core==matrix.versions.ansible\nCommand: tox -x testenv:ansible-lint-collection.basepython=python{matrix.versions.python} -e collection,ansible-lint-collection"]

  end_job["Job_complete_for_matrix_entry"]
  end_all["All_matrix_entries_complete"]

  start --> check_skip
  check_skip -->|Yes| exit
  check_skip -->|No| run_job

  run_job --> matrix
  matrix --> step_update
  step_update --> step_checkout
  step_checkout --> step_install_toxlsr
  step_install_toxlsr --> step_setup_python
  step_setup_python --> step_run_tox
  step_run_tox --> end_job
  end_job --> end_all
Loading

File-Level Changes

Change Details Files
Run ansible-lint via tox-lsr against multiple Ansible and Python versions instead of using the ansible-lint GitHub Action on a pre-converted collection tree.
  • Add a matrix strategy over ansible-lint, ansible-core, and Python versions to the ansible-lint workflow job
  • Upgrade tox-lsr dependency to version 3.18.0 in the ansible-lint workflow
  • Replace bespoke collection conversion plus ansible-lint GitHub Action usage with a single tox invocation that converts the role to a collection and runs ansible-lint with version pins via environment variables
.github/workflows/ansible-lint.yml
Run ansible-test via tox-lsr across a matrix of supported/milestone Ansible and Python versions instead of the ansible-test GitHub Action with a single ansible-core version.
  • Add a matrix strategy over ansible-core channels and Python versions to the ansible-test workflow job
  • Upgrade tox-lsr dependency to version 3.18.0 in the ansible-test workflow
  • Replace collection conversion plus ansible-test GitHub Action with a tox-based flow that converts the role to a collection and runs ansible-test envs matching the matrix entries
.github/workflows/ansible-test.yml
Standardize tox-lsr version used across other workflows to 3.18.0.
  • Update tox-lsr pip installation version from 3.17.1 to 3.18.0 in the ansible-managed-var-comment workflow
  • Update tox-lsr pip installation version from 3.17.1 to 3.18.0 in the qemu-kvm-integration-tests workflow
.github/workflows/ansible-managed-var-comment.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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

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 (3.18.0) is hardcoded in multiple workflows; consider defining it once via a shared reusable workflow or workflow-level env variable to avoid divergence on future upgrades.
  • The custom tox invocations that override testenv:...basepython with python${{ matrix.versions.python }} are non-obvious; adding a brief inline comment explaining why the basepython override is required would make the CI setup easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The tox-lsr version (`3.18.0`) is hardcoded in multiple workflows; consider defining it once via a shared reusable workflow or workflow-level `env` variable to avoid divergence on future upgrades.
- The custom `tox` invocations that override `testenv:...basepython` with `python${{ matrix.versions.python }}` are non-obvious; adding a brief inline comment explaining why the basepython override is required would make the CI setup easier to maintain.

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