Skip to content

ci: ansible-lint requires dependencies to be installed [citest_skip]#10

Closed
richm wants to merge 1 commit into
mainfrom
ci-ansible-lint-install-deps
Closed

ci: ansible-lint requires dependencies to be installed [citest_skip]#10
richm wants to merge 1 commit into
mainfrom
ci-ansible-lint-install-deps

Conversation

@richm

@richm richm commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

ansible-lint requires the dependencies in meta/collection-requirements.yml
and tests/collection-requirements.yml to be installed. tox-lsr 3.18.1
will ensure they are installed.

Refactor the tests somewhat so that the collection and test steps are separate.

Signed-off-by: Rich Megginson rmeggins@redhat.com

Summary by Sourcery

Update CI workflows to run ansible-lint and ansible-test via tox-lsr with explicit version matrices and align role naming and references from trustee_attestation_server to trustee_server across docs and tests.

Bug Fixes:

  • Fix incorrect role and repository name references from trustee_attestation_server to trustee_server in documentation, plans, and test variables.

Enhancements:

  • Refactor ansible-lint and ansible-test GitHub workflows to use tox-driven collection/test steps with matrix testing over multiple ansible-core, ansible-lint, and Python versions.
  • Introduce a reusable task file to clear facts and run the linux-system-roles.trustee_server role with optional failure suppression in tests.

CI:

  • Bump tox-lsr version to 3.18.1 across GitHub workflows.
  • Replace direct ansible-lint and ansible-test GitHub Actions with tox environments for ansible-lint-collection and ansible-test across supported versions.
  • Configure ansible-lint and ansible-test workflows to use matrix strategies for multiple ansible-core and Python versions.

Documentation:

  • Update README badges, contributing guide, and CI plans documentation to point to the trustee_server repository and workflows instead of trustee_attestation_server.

Tests:

  • Add a helper task file to clear facts and run the trustee_server role in tests with optional error ignoring.
  • Update test vars to use new trustee_server-prefixed internal variable names for RHEL/Fedora distro detection.

Chores:

  • Adjust Testing Farm tmt plan filter tags from trustee_attestation_server to trustee_server.

ansible-lint requires the dependencies in meta/collection-requirements.yml
and tests/collection-requirements.yml to be installed.  tox-lsr 3.18.1
will ensure they are installed.

Refactor the tests somewhat so that the collection and test steps are separate.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm richm self-assigned this Apr 9, 2026
@richm richm requested a review from spetrosi as a code owner April 9, 2026 23:01
@sourcery-ai

sourcery-ai Bot commented Apr 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates CI workflows to rely on tox-lsr 3.18.1 and tox-managed environments for ansible-lint and ansible-test, adding version matrices for ansible-core/ansible-lint/python, while also renaming remaining trustee_attestation_server references to trustee_server and adding a reusable test task file for running the role with cleared facts.

File-Level Changes

Change Details Files
Refactor ansible-lint GitHub workflow to use tox-lsr-managed ansible-lint collection environment with version matrix for ansible-lint, ansible-core, and Python.
  • Add a fail-fast=false matrix strategy covering two ansible-lint/ansible-core/python version combinations.
  • Upgrade tox-lsr installation from 3.17.1 to 3.18.1.
  • Replace custom collection conversion and merged requirements-file generation shell script with a simple tox -e collection call.
  • Replace ansible/ansible-lint GitHub Action usage with tox -e ansible-lint-collection, passing ansible-lint and ansible-core versions through LSR_ANSIBLE_LINT_* env vars and overriding basepython via tox -x.
.github/workflows/ansible-lint.yml
Refactor ansible-test GitHub workflow to run ansible-test via tox-managed environments across a matrix of ansible-core and Python versions.
  • Add a fail-fast=false matrix strategy covering multiple ansible-core tracks (2-14 through 2-20 and milestone) and corresponding Python versions.
  • Upgrade tox-lsr installation from 3.17.1 to 3.18.1.
  • Replace manual TOXENV=collection lsr_ci_runtox invocation with tox -e collection for collection conversion.
  • Replace ansible-test GitHub Action with direct tox -e ansible-test-<ansible version> execution, overriding basepython via tox -x for each matrix entry.
.github/workflows/ansible-test.yml
Align documentation, badges, and tmt plan filters with the trustee_server repository/name instead of trustee_attestation_server.
  • Update contributing guide headings and GitHub URLs to trustee_server.
  • Update CI badges and workflow links in README to point to trustee_server paths.
  • Update tmt-related documentation and tft.yml tmt_plan_filter tag to trustee_server.
  • Adjust Testing Farm example git-url in plans README to trustee_server.
contributing.md
README.md
plans/README-plans.md
.github/workflows/tft.yml
Rename Red Hat distro helper variables in tests to match trustee_server naming convention.
  • Change __trustee_attestation_server_rh_distros and related helper vars to __trustee_server_* equivalents.
  • Update expressions referencing the old variable names in the distro facts logic.
tests/vars/rh_distros_vars.yml
Update remaining CI workflows to use tox-lsr 3.18.1.
  • Bump tox-lsr from 3.17.1 to 3.18.1 in ansible-managed-var-comment workflow.
  • Bump tox-lsr from 3.17.1 to 3.18.1 in qemu-kvm-integration-tests workflow.
.github/workflows/ansible-managed-var-comment.yml
.github/workflows/qemu-kvm-integration-tests.yml
Add reusable Ansible task file to clear facts and run linux-system-roles.trustee_server with optional failure suppression.
  • Introduce tests/tasks/run_role_with_clear_facts.yml managed by linux-system-roles/.github.
  • Implement a meta: clear_facts step followed by an include_role call to linux-system-roles.trustee_server.
  • Support parameters __sr_tasks_from, __sr_public, and __sr_failed_when to control which tasks to run, whether vars are public, and whether to ignore role failures.
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

@richm richm closed this Apr 9, 2026
@richm richm deleted the ci-ansible-lint-install-deps branch April 9, 2026 23:03

@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:

  • In both ansible-lint.yml and ansible-test.yml, consider moving the actions/setup-python step before the pip3 install of tox/tox-lsr so those tools are installed into the matrix-selected Python interpreter rather than the default system Python.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In both ansible-lint.yml and ansible-test.yml, consider moving the `actions/setup-python` step before the `pip3 install` of tox/tox-lsr so those tools are installed into the matrix-selected Python interpreter rather than the default system Python.

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.

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