Skip to content

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

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

ci: Comply with Ansible partner certification checking [citest_skip]#23
richm wants to merge 1 commit into
mainfrom
ci-ansible-lint-ansible-test-matrix

Conversation

@richm
Copy link
Copy Markdown
Collaborator

@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 and supporting files with Ansible partner certification requirements and updated role naming.

Enhancements:

  • Standardize role-related naming from trustee_attestation_client to trustee_client across configuration and test artifacts.

CI:

  • Run ansible-lint in CI across multiple ansible-core and Python versions using tox-lsr-managed collection environments instead of the ansible-lint GitHub Action.
  • Run ansible-test sanity in CI across a matrix of ansible-core and Python versions using tox-based test envs.
  • Upgrade tox-lsr to version 3.18.0 in all GitHub workflows and adjust Testing Farm tmt plan filters for the renamed role.

Documentation:

  • Update contributor, README, and CI plans documentation to reference the trustee_client repository and workflows instead of trustee_attestation_client.

Tests:

  • Add a reusable test task file to clear Ansible facts and run the linux-system-roles.trustee_client role with optional failure suppression.
  • Rename internal test variables for Red Hat–like distributions to match the trustee_client role name.

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 spetrosi 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

Refactors Ansible CI workflows to run partner-certification-compliant checks via tox across multiple Ansible/ansible-lint/ansible-test and Python versions, updates tox-lsr, aligns role/repo naming from trustee_attestation_client to trustee_client, and adds a helper test task file to clear facts and run the role flexibly in tests.

Flow diagram for new ansible-lint CI job using tox matrix

flowchart TD
  A[Workflow_triggered
  pull_request_or_push] --> B{Contains_citest_skip_marker}
  B -- yes --> C[Skip_ansible_lint_job]
  B -- no --> D[Update_pip_and_git]
  D --> E[Install_tox_and_tox_lsr_3_18_0]
  E --> F[Iterate_over_matrix_versions
  ansible_lint_ansible_python]
  F --> G[Set_up_Python_with_actions_setup_python
  python_version_from_matrix]
  G --> H[Run_tox_with_environments
  collection_and_ansible_lint_collection]
  H --> I[Pass_env_LSR_ANSIBLE_LINT_DEP
  ansible_lint_equals_matrix_version]
  I --> J[Pass_env_LSR_ANSIBLE_LINT_ANSIBLE_DEP
  ansible_core_equals_matrix_version]
  J --> K[Execute_collection_conversion_and
  ansible_lint_checks_inside_tox]
  K --> L[Report_status_for_each_matrix_entry]
Loading

File-Level Changes

Change Details Files
Refactor ansible-lint workflow to run ansible-lint via tox against multiple Ansible and Python versions instead of using the GitHub action directly.
  • Add a non-fail-fast matrix strategy specifying ansible-lint, ansible-core, and Python version combinations
  • Upgrade tox-lsr dependency and install it via pip
  • Introduce actions/setup-python to select the matrix Python version
  • Replace custom collection-conversion plus ansible-lint GitHub Action invocation with tox-based collection conversion and ansible-lint execution using environment variables to pin tool versions
.github/workflows/ansible-lint.yml
Refactor ansible-test workflow to run sanity tests through tox for multiple ansible-core and Python versions instead of the ansible-test GitHub Action.
  • Add a non-fail-fast matrix over ansible-core channels (including milestone) and Python versions
  • Upgrade tox-lsr dependency and install it via pip
  • Introduce actions/setup-python based on the matrix Python version
  • Replace separate collection conversion and ansible-test GitHub Action with a single tox invocation running collection conversion and ansible-test envs keyed by ansible-core version
.github/workflows/ansible-test.yml
Standardize role/repository naming from trustee_attestation_client to trustee_client across user-facing documentation and CI metadata.
  • Update contributing guide title, issue links, and repository links to trustee_client
  • Update Testing Farm plan README to reference the trustee_client repository and workflow URLs
  • Adjust Testing Farm GitHub workflow tmt_plan_filter tag to trustee_client
  • Update README badges to point to trustee_client workflows and repository paths
contributing.md
plans/README-plans.md
.github/workflows/tft.yml
README.md
Update internal variable names and test metadata to match the trustee_client role name and tagging.
  • Rename distribution-related test vars from _trustee_attestation_client* to _trustee_client*
  • Ensure conditions referencing these vars use the new names
tests/vars/rh_distros_vars.yml
Update tox-lsr version across CI workflows to the latest required version.
  • Bump tox-lsr from 3.17.1 to 3.18.0 in ansible-lint, ansible-test, ansible-managed-var-comment, and qemu-kvm-integration-tests workflows
.github/workflows/ansible-lint.yml
.github/workflows/ansible-test.yml
.github/workflows/ansible-managed-var-comment.yml
.github/workflows/qemu-kvm-integration-tests.yml
Add a reusable test helper task file to clear facts and run the trustee_client role with optional failure suppression.
  • Introduce run_role_with_clear_facts.yml that clears Ansible facts, then conditionally includes the linux-system-roles.trustee_client role
  • Support a __sr_failed_when flag to ignore failures when explicitly requested while still running a normal include_role path otherwise
  • Allow callers to control tasks_from and public behavior via _sr* variables
tests/tasks/run_role_with_clear_facts.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:

  • In README.md, the final status badge image for trustee_attestation_client still points to linux-system-roles/trustee_attestation_client/workflows/tox while the other badges were updated to trustee_client, which may cause that badge to break after the rename.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In README.md, the final status badge image for `trustee_attestation_client` still points to `linux-system-roles/trustee_attestation_client/workflows/tox` while the other badges were updated to `trustee_client`, which may cause that badge to break after the rename.

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 22:04
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