ci: Comply with Ansible partner certification checking [citest_skip]#497
Merged
ci: Comply with Ansible partner certification checking [citest_skip]#497
Conversation
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>
Reviewer's GuideUpdates CI workflows to align with Ansible partner certification expectations by running ansible-lint and ansible-test via tox across a matrix of supported Ansible and Python versions, while upgrading tox-lsr and removing direct GitHub actions integrations for lint/test. Sequence diagram for ansible-lint job execution via tox matrixsequenceDiagram
actor Dev
participant GitHub
participant Workflow as ansible_lint_workflow
participant Matrix as Matrix_scheduler
participant Runner as GHA_runner
participant Pip as pip_tox_lsr
participant PySetup as setup_python
participant Tox as tox
participant Lint as ansible_lint
Dev->>GitHub: Push or open PR
GitHub->>Workflow: Trigger ansible-lint.yml
Workflow->>Workflow: Check [citest_skip]
alt not skipped
Workflow->>Matrix: Define matrix (ansible_lint, ansible, python)
Matrix->>Runner: Start job per matrix entry
Runner->>Pip: Install tox-lsr 3.18.0
Pip-->>Runner: tox-lsr installed
Runner->>PySetup: Set up Python matrix version
PySetup-->>Runner: Python ready
Runner->>Tox: Run -e collection,ansible-lint-collection
Tox->>Tox: Read LSR_ANSIBLE_LINT_DEP
Tox->>Tox: Read LSR_ANSIBLE_LINT_ANSIBLE_DEP
Tox->>Lint: Install and invoke ansible-lint
Lint-->>Tox: Lint results
Tox-->>Runner: Job status for matrix entry
Runner-->>Workflow: Matrix status aggregated
else skipped
Workflow-->>GitHub: ansible-lint job skipped
end
Workflow-->>GitHub: Report CI status to PR
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/ansible-lint/Python version tuples are now hard-coded in multiple workflow matrices; consider centralizing them via a reusable workflow or a single strategy definition to avoid version skew during future updates.
- The tox environment names are constructed dynamically from
matrix.versions.ansible(e.g.,ansible-test-2-14,milestone); it may be safer to constrainmatrix.versions.ansibleto a small set of constants that directly match known tox env names to reduce the chance of silent CI breakage when editing these values. - Given the expanded matrices, you may want to add a
pip/~/.cache/pipcache (or a tox cache) in these workflows to avoid repeatedly reinstalling the same dependencies across matrix jobs and speed up CI.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The ansible/ansible-lint/Python version tuples are now hard-coded in multiple workflow matrices; consider centralizing them via a reusable workflow or a single strategy definition to avoid version skew during future updates.
- The tox environment names are constructed dynamically from `matrix.versions.ansible` (e.g., `ansible-test-2-14`, `milestone`); it may be safer to constrain `matrix.versions.ansible` to a small set of constants that directly match known tox env names to reduce the chance of silent CI breakage when editing these values.
- Given the expanded matrices, you may want to add a `pip`/`~/.cache/pip` cache (or a tox cache) in these workflows to avoid repeatedly reinstalling the same dependencies across matrix jobs and speed up CI.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.
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:
This requires the latest version of tox-lsr
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Update CI workflows to run Ansible partner certification-style checks across multiple supported Ansible and Python versions using tox-lsr.
CI: