ci: Comply with Ansible partner certification checking [citest_skip]#859
Merged
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 GitHub CI workflows to align with Ansible partner certification expectations by running ansible-lint and ansible-test through tox-lsr-driven collection environments across multiple Ansible/ansible-lint/Python versions, and bumps tox-lsr to 3.18.0 everywhere. Sequence diagram for matrix-based ansible-lint job executionsequenceDiagram
participant GitHubActions
participant Workflow_ansible_lint
participant Runner
participant tox_lsr_3_18_0
participant tox
participant ansible_lint
participant ansible_core
GitHubActions->>Workflow_ansible_lint: Trigger on push or pull_request
Workflow_ansible_lint->>Runner: Start ansible-lint job
Runner->>Runner: Checkout repository
Runner->>Runner: Update pip and git
Runner->>tox_lsr_3_18_0: pip install tox-lsr 3.18.0
loop For each matrix version
Runner->>Runner: Set up Python matrix.versions.python
Runner->>tox: Run tox -e collection
tox->>tox_lsr_3_18_0: Use tox-lsr environments
tox_lsr_3_18_0-->>tox: Provide collection env
Runner->>tox: Run tox -e ansible-lint-collection
Note over Runner, tox: LSR_ANSIBLE_LINT_DEP and\nLSR_ANSIBLE_LINT_ANSIBLE_DEP define\nansible-lint and ansible-core version
tox->>ansible_lint: Execute ansible-lint with specified version
tox->>ansible_core: Use ansible-core with specified version
ansible_lint-->>tox: Lint results
tox-->>Runner: Job status for this matrix version
end
Runner-->>Workflow_ansible_lint: Aggregate matrix results
Workflow_ansible_lint-->>GitHubActions: Report success or failure
Flow diagram for updated ansible-lint workflow job stepsflowchart TB
A[Start ansible-lint workflow] --> B{citest_skip in title or commit?}
B -- Yes --> C[Skip job]
B -- No --> D[Run on ubuntu-latest]
D --> E[Define matrix versions\nansible-lint 24.* / 26.*\nansible-core 2.16.* / 2.20.*\nPython 3.12 / 3.13]
E --> F[Checkout repository]
F --> G[Update pip and git]
G --> H[pip install tox-lsr 3.18.0]
H --> I{For each matrix version}
I --> J[Set up Python using actions/setup-python]
J --> K[Run tox -e collection]
K --> L[Run tox -e ansible-lint-collection\nwith LSR_ANSIBLE_LINT_DEP and\nLSR_ANSIBLE_LINT_ANSIBLE_DEP]
L --> M{Next matrix version?}
M -- Yes --> I
M -- No --> N[Aggregate matrix results]
N --> O[Finish workflow]
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 the tox-lsr version is now hard-coded in multiple workflows, consider centralizing it (e.g., via a reusable workflow or a shared action) to avoid repetitive edits and reduce the risk of version skew in future bumps.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since the tox-lsr version is now hard-coded in multiple workflows, consider centralizing it (e.g., via a reusable workflow or a shared action) to avoid repetitive edits and reduce the risk of version skew in future bumps.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
Align CI Ansible linting and testing workflows with Ansible partner certification requirements and update shared tooling versions.
Build:
CI: