You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(lint): install the Galaxy roles in the ansible-lint test - #208
lint-test: ansible-lint passes on roles only passed when another .bats file had already installed the Galaxy roles. run-tests.sh passes the files in find order, which differs between runners, so the suite failed on Renovate PR #202 and on steward/lint-ci with The role 'geerlingguy.docker' was not found. The ansible-lint test now installs the roles from ansible/requirements.yml itself, after its tool check and before running ansible-lint, so it no longer depends on test order.
tests/bash/lint-test.bats: the ansible-lint test runs ansible-galaxy role install -r requirements.yml before ansible-lint, and fails with the galaxy output if the install fails. An earlier setup_file version was dropped after the Copilot review: on a machine without Ansible it ran before the "can be installed" test had installed it, so it never installed the roles.
Checklist
Linting passes locally (mise exec -- lefthook run pre-commit): not run. repo-steward works API-only without a clone, so CI (CI - Bats Tests, Lint) is the check.
Commit messages follow Conventional Commits (signed commits via steward commit-files)
Documentation updated (if applicable): the comment above the install explains why
lint-test.bats ran ansible-lint without installing the Galaxy roles that our
roles depend on (geerlingguy.docker). It only passed when docker-test.bats or
syntax-test.bats had run first and installed them. run-tests.sh passes the
.bats files in find order, which differs between runners, so the suite
failed whenever lint-test.bats came first:
syntax-check[specific]: The role 'geerlingguy.docker' was not found
A setup_file now installs the roles from ansible/requirements.yml once before
the file's tests, so the lint test no longer depends on test order.
No actionable comments were generated in the recent review.
Walkthrough
The Bats file now has a file-level setup that attempts to install Ansible Galaxy roles when ansible-galaxy is available. Installation failures produce a warning and do not fail setup.
Changes: Bats role setup
Layer / File(s)
Summary
Role installation setup tests/bash/lint-test.bats
The file-level setup checks for ansible-galaxy and attempts to install roles from ansible/requirements.yml. If installation fails, it prints a warning. If the command is unavailable, it skips installation.
The lint test now installs its required Ansible roles itself, so it no longer fails when it runs before the files that install them. This is a test-only change with no production impact. No concrete merge-blocking risk was found, and the author's CI run is the remaining check.
Pre-merge checks: 4
Check name
Status
Explanation
Linked Issues check
Issue #207 requires that lint-test: ansible-lint passes on roles pass regardless of .bats file order. The diff at the reviewed head (0ab9445) adds a setup_file to tests/bash/lint-test.bats. It…
Out of Scope Changes check
The whole-PR diff against merge base 7ec2323 changes only tests/bash/lint-test.bats (+14 lines). The added setup_file and its comment directly implement the objective of #207. No unrelated files o…
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: a test setup that installs the Galaxy roles so the ansible-lint test passes regardless of file execution order. The raw summary and objectives confirm this: a file-lev…
Full details: Linked Issues check
Explanation
Issue #207 requires that lint-test: ansible-lint passes on roles pass regardless of .bats file order. The diff at the reviewed head (0ab9445) adds a setup_file to tests/bash/lint-test.bats. It runs ansible-galaxy role install -r ansible/requirements.yml before this file's tests. Because ansible-lint runs offline, this installs the Galaxy roles (including geerlingguy.docker) that the lint test needs, so the test no longer depends on whether docker-test.bats or syntax-test.bats ran first. The change addresses the stated root cause. The change is test-only and adds no coding requirement beyond the issue. Not verified: that the roles installed by ansible-galaxy default location are the ones ansible-lint resolves, and that CI passes. No CI results were provided. The PR author also notes local lint was not run.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against merge base 7ec2323 changes only tests/bash/lint-test.bats (+14 lines). The added setup_file and its comment directly implement the objective of #207. No unrelated files or behavior changes are present. The existing tests are unchanged.
Full details: Title check
Explanation
The title names the main change: a test setup that installs the Galaxy roles so the ansible-lint test passes regardless of file execution order. The raw summary and objectives confirm this: a file-level Bats setup runs ansible-galaxy role install from ansible/requirements.yml before the lint tests. The title is specific and concise, and the test(lint) prefix matches the test-only change.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: a5bc4cae-2040-4641-8737-9b7aefce9f68
Commits
Reviewing files that changed from the base of the PR and between 7ec2323 and 0ab9445.
Files selected for processing: 1
tests/bash/lint-test.bats
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
On a fresh machine, role installation is skipped before Ansible is installed and never retried, causing offline lint to fail to resolve geerlingguy.docker when this test file runs first.
Copilot review on #208: on a machine without Ansible, setup_file skipped the
role install, and the later "ansible-lint is available or can be installed"
test installs Ansible without rerunning it. The lint test then still couldn't
resolve geerlingguy.docker when this file ran first.
Install the roles inside the ansible-lint test instead, after its tool check
and before ansible-lint runs, and fail with the galaxy output if that fails.
DevSecNinja
changed the title
test(lint): install the Galaxy roles in lint-test setup_file
test(lint): install the Galaxy roles in the ansible-lint test
Nov 18, 2026
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The lint test installs roles twice under different configuration contexts, causing clean repository-root runs to download roles into two separate directories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
lint-test: ansible-lint passes on rolesonly passed when another.batsfile had already installed the Galaxy roles.run-tests.shpasses the files infindorder, which differs between runners, so the suite failed on Renovate PR #202 and onsteward/lint-ciwithThe role 'geerlingguy.docker' was not found. The ansible-lint test now installs the roles fromansible/requirements.ymlitself, after its tool check and before running ansible-lint, so it no longer depends on test order.Closes #207
Changes
tests/bash/lint-test.bats: the ansible-lint test runsansible-galaxy role install -r requirements.ymlbeforeansible-lint, and fails with the galaxy output if the install fails. An earliersetup_fileversion was dropped after the Copilot review: on a machine without Ansible it ran before the "can be installed" test had installed it, so it never installed the roles.Checklist
mise exec -- lefthook run pre-commit): not run. repo-steward works API-only without a clone, so CI (CI - Bats Tests, Lint) is the check.steward commit-files)