ci: support running multiple versions of ansible-lint and ansible-test#237
Merged
richm merged 1 commit intolinux-system-roles:mainfrom Apr 1, 2026
Merged
Conversation
Reviewer's GuideAdds configurability for ansible-lint (including its matching ansible-core/python versions) and introduces a dedicated tox environment for running milestone ansible-test, to support Automation Hub / partner certification workflows. Flow diagram for configurable ansible-lint tox environmentflowchart TD
A["Start: Developer runs tox"] --> B["Command: tox -e ansible-lint"]
B --> C{"LSR_ANSIBLE_LINT_DEP set?"}
C -->|Yes| D["Use LSR_ANSIBLE_LINT_DEP as ansible-lint dependency"]
C -->|No| E["Use default ansible-lint (latest)"]
D --> F{"LSR_ANSIBLE_LINT_ANSIBLE_DEP set?"}
E --> F
F -->|Yes| G["Use LSR_ANSIBLE_LINT_ANSIBLE_DEP as ansible-core dependency"]
F -->|No| H["Use default ansible-core dependency"]
G --> I["Create testenv:ansible-lint with basepython=python3"]
H --> I
I --> J["Run ansible-lint-helper.sh pre"]
J --> K["Run ansible-lint in configured environment"]
K --> L["Run ansible-lint-helper.sh post"]
L --> M["End"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The ansible-lint and ansible-lint-collection testenvs now duplicate the same basepython/deps configuration; consider extracting the common bits into a shared factor or section to avoid drift between them in future changes.
- In the ansible-test-milestone env, hardcoding both basepython=python3.14 and LSR_COLLECTION_VERSION=2.20.0 may require frequent manual updates; consider driving these via environment variables or a single version constant so they can be adjusted in one place.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The ansible-lint and ansible-lint-collection testenvs now duplicate the same basepython/deps configuration; consider extracting the common bits into a shared factor or section to avoid drift between them in future changes.
- In the ansible-test-milestone env, hardcoding both basepython=python3.14 and LSR_COLLECTION_VERSION=2.20.0 may require frequent manual updates; consider driving these via environment variables or a single version constant so they can be adjusted in one place.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This is for Ansible partner certification checking https://github.com/ansible-collections/partner-certification-checker/blob/main/README.md We must be able to test with the versions used by Automation Hub gating as well as the latest versions. Create separate testenvs for different versions of ansible-test so that we can easily test with that version and ensure all of the dependencies are correct. Note that the milestone version number is the next one after the current stable version number, for the sanity ignore files. By default, `tox -e ansible-lint` will use the latest version of ansible-lint, and the latest versions of ansible-core and python that ansible-lint requires. If you want to use a different version of ansible-lint, you must also specify the ansible-core and python versions required by that version of ansible-lint. For example: ``` LSR_ANSIBLE_LINT_DEP=ansible-lint==24.12.* LSR_ANSIBLE_LINT_ANSIBLE_DEP=ansible-core==2.16.* \ tox -x testenv:ansible-lint.basepython=python3.12 -e ansible-lint ``` If we have to support 3 or more versions of ansible-lint, we may want to move to the way we did that for ansible-test-X-Y versions. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
0a23311 to
6f9f2ba
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is for Ansible partner certification checking
https://github.com/ansible-collections/partner-certification-checker/blob/main/README.md
We must be able to test with the versions used by Automation Hub gating as well as the
latest versions.
Create separate testenvs for different versions of ansible-test so that we can easily
test with that version and ensure all of the dependencies are correct. Note that
the milestone version number is the next one after the current stable version number,
for the sanity ignore files.
By default,
tox -e ansible-lintwill use the latest version of ansible-lint, and thelatest versions of ansible-core and python that ansible-lint requires.
If you want to use a different version of ansible-lint, you must also specify the ansible-core
and python versions required by that version of ansible-lint. For example:
If we have to support 3 or more versions of ansible-lint, we may want to move to the way
we did that for ansible-test-X-Y versions.
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Allow testing against multiple versions of ansible-lint and ansible-test via configurable tox environments.
Build:
Tests: