ci: Comply with Ansible partner certification checking [citest_skip] - #79
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 CI workflows to align with Ansible Partner Certification requirements by running ansible-lint and ansible-test through tox-lsr across multiple Ansible and Python versions, and by upgrading tox-lsr to 3.18.0 everywhere it is used. Sequence diagram for ansible-lint CI job with multi-version matrixsequenceDiagram
actor Developer
participant GitHub as GitHub_Actions
participant Workflow as Workflow_ansible_lint
participant Runner as GitHub_Runner
participant tox_lsr as tox_lsr_3_18_0
participant tox as tox
participant LintEnv as tox_env_ansible_lint_collection
participant AnsibleLint as ansible_lint
participant AnsibleCore as ansible_core
Developer->>GitHub: Push_commit_or_open_PR
GitHub->>Workflow: Trigger_workflow_if_not_citest_skip
Workflow->>Runner: Start_job_with_matrix_versions
loop For_each_matrix_version
Runner->>Runner: Update_pip_and_git
Runner->>Runner: Checkout_repository
Runner->>Runner: Install_tox_lsr_3_18_0
Runner->>Runner: Setup_python(matrix_python_version)
Runner->>tox_lsr: Invoke_tox_with_env_vars\nLSR_ANSIBLE_LINT_DEP\nLSR_ANSIBLE_LINT_ANSIBLE_DEP
tox_lsr->>tox: Configure_and_run_tox_environment
tox->>LintEnv: Create_and_activate_environment
LintEnv->>AnsibleCore: Install_ansible_core(matrix_ansible_version)
LintEnv->>AnsibleLint: Install_ansible_lint(matrix_lint_version)
LintEnv->>AnsibleLint: Run_ansible_lint_on_collection
AnsibleLint-->>LintEnv: Lint_results
LintEnv-->>Runner: Job_status_for_matrix_version
end
Runner-->>GitHub: Report_overall_job_status
GitHub-->>Developer: CI_status_checks_updated
Flow diagram for updated ansible-lint workflow matrix and tox-lsr usageflowchart TD
start["Workflow_start (push_or_pull_request)"]
check_skip{"Title_or_commit_contains_citest_skip"}
exit["Skip_jobs"]
run_job["Run_ansible_lint_job"]
matrix["Create_matrix_versions\n- ansible_lint_24_x / ansible_core_2_16_x / python_3_12\n- ansible_lint_26_x / ansible_core_2_20_x / python_3_13"]
step_update["Step: Update_pip_and_git"]
step_checkout["Step: actions_checkout"]
step_install_toxlsr["Step: pip_install_tox_lsr_3_18_0"]
step_setup_python["Step: actions_setup_python\npython_version = matrix.versions.python"]
step_run_tox["Step: Run_tox_with_envs\nLSR_ANSIBLE_LINT_DEP = ansible_lint==matrix.versions.ansible_lint\nLSR_ANSIBLE_LINT_ANSIBLE_DEP = ansible_core==matrix.versions.ansible\nCommand: tox -x testenv:ansible-lint-collection.basepython=python{matrix.versions.python} -e collection,ansible-lint-collection"]
end_job["Job_complete_for_matrix_entry"]
end_all["All_matrix_entries_complete"]
start --> check_skip
check_skip -->|Yes| exit
check_skip -->|No| run_job
run_job --> matrix
matrix --> step_update
step_update --> step_checkout
step_checkout --> step_install_toxlsr
step_install_toxlsr --> step_setup_python
step_setup_python --> step_run_tox
step_run_tox --> end_job
end_job --> end_all
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 tox-lsr version (
3.18.0) is hardcoded in multiple workflows; consider defining it once via a shared reusable workflow or workflow-levelenvvariable to avoid divergence on future upgrades. - The custom
toxinvocations that overridetestenv:...basepythonwithpython${{ matrix.versions.python }}are non-obvious; adding a brief inline comment explaining why the basepython override is required would make the CI setup easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The tox-lsr version (`3.18.0`) is hardcoded in multiple workflows; consider defining it once via a shared reusable workflow or workflow-level `env` variable to avoid divergence on future upgrades.
- The custom `tox` invocations that override `testenv:...basepython` with `python${{ matrix.versions.python }}` are non-obvious; adding a brief inline comment explaining why the basepython override is required would make the CI setup easier to maintain.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 linting and testing across multiple supported Ansible and Python versions using tox-based checkers aligned with partner certification requirements.
CI: