ci: ansible-lint requires dependencies to be installed [citest_skip]#180
Merged
ci: ansible-lint requires dependencies to be installed [citest_skip]#180
Conversation
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>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates CI workflows to use tox-lsr 3.18.1 and refactors ansible lint/test jobs to run collection conversion and testing as separate tox environments, aligning with new dependency-handling behavior. Sequence diagram for updated ansible-lint GitHub Actions workflowsequenceDiagram
actor Developer
participant GitHubActionsRunner as GitHubActionsRunner
participant Pip as Pip
participant Tox as Tox
participant ToxLsr as ToxLsr
Developer->>GitHubActionsRunner: Push or PR triggers ansible-lint workflow
GitHubActionsRunner->>Pip: Install tox-lsr 3.18.1
Pip-->>GitHubActionsRunner: tox-lsr 3.18.1 installed
GitHubActionsRunner->>GitHubActionsRunner: Set up Python with matrix.versions.python
GitHubActionsRunner->>Tox: Run environment collection
Tox->>ToxLsr: Use tox-lsr 3.18.1 to convert role to collection
ToxLsr-->>Tox: Collection layout and dependencies prepared
Tox-->>GitHubActionsRunner: collection environment completed
GitHubActionsRunner->>Tox: Run environment ansible-lint-collection
GitHubActionsRunner->>Tox: Export LSR_ANSIBLE_LINT_DEP and LSR_ANSIBLE_LINT_ANSIBLE_DEP
Tox->>ToxLsr: Use prepared collection and installed dependencies
ToxLsr-->>GitHubActionsRunner: ansible-lint results
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:
- Since
actions/setup-pythonruns after thepip3 installof tox-lsr, consider moving the install step belowsetup-pythonso tox-lsr is installed into the configured Python environment rather than the runner’s default Python. - Now that
tox -e collectionruns in its own step in both workflows, it might be worth clarifying in the tox config (e.g., via dependencies or comments) thatansible-lint-collectionandansible-test-*environments assume the collection environment has already been executed.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since `actions/setup-python` runs after the `pip3 install` of tox-lsr, consider moving the install step below `setup-python` so tox-lsr is installed into the configured Python environment rather than the runner’s default Python.
- Now that `tox -e collection` runs in its own step in both workflows, it might be worth clarifying in the tox config (e.g., via dependencies or comments) that `ansible-lint-collection` and `ansible-test-*` environments assume the collection environment has already been executed.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
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 use tox-lsr 3.18.1 and separate Ansible collection conversion from lint and test execution.
CI: