refactor: comply with Ansible partner certification checks#121
Merged
richm merged 1 commit intolinux-system-roles:mainfrom Apr 7, 2026
Merged
Conversation
https://github.com/ansible-collections/partner-certification-checker/blob/main/README.md Ensure that our code complies with these policies/checks and prepare for improved ansible-lint and ansible-test checks. The shell script jinja templates have been renamed to be `.sh.j2`. Older versions of ansible-test use an old version of shellcheck which does not support `shellcheck disable=all`, which causes ansible-test to error. I tried adding an ignore-2.14.txt to do `shellcheck!skip` for these files, but then ansible-lint complained that `shellcheck` is unskippable. In other roles e.g. nbde_client, we use the `.sh.j2` suffix for shell script templates. The `.collection/` sub-dir causes problems for ansible-lint. The `which` command is not built-in - use `command -v` instead. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR updates the role to comply with Ansible partner certification and lint/test rules by renaming shell script templates to use a .sh.j2 suffix, updating the Ansible task references accordingly, fixing a shell portability issue, and adjusting ansible-lint configuration to avoid .collection-related problems. Flow diagram for Jinja2 shell script template rendering with .sh.j2 suffixflowchart TD
A[Ansible role task
template module
src: sku/*.sh.j2] --> B[Ansible Jinja2 engine
render template]
B --> C[Rendered shell script file
dest: setup_sku_customisations.sh]
B --> D[Rendered shell script file
dest: remove_sku_customisations.sh]
B --> E[Rendered shell script file
dest: test-sku-setup.sh]
C --> F[hpc_azure_resource_dir/bin
setup_sku_customisations.sh]
D --> G[hpc_azure_resource_dir/bin
remove_sku_customisations.sh]
E --> H[hpc_azure_tests_dir
test-sku-setup.sh]
F --> I[Executed during SKU setup]
G --> J[Executed during SKU removal]
H --> K[Executed as SKU tests]
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:
- In
test-cuda-gpu.sh, consider quoting thecommand -vexpansion (e.g.verbose_log "nvcc location: $(command -v nvcc)"or assigning it to a variable and quoting that) to avoid potential word-splitting issues if the binary path ever contains spaces.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `test-cuda-gpu.sh`, consider quoting the `command -v` expansion (e.g. `verbose_log "nvcc location: $(command -v nvcc)"` or assigning it to a variable and quoting that) to avoid potential word-splitting issues if the binary path ever contains spaces.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
|
[citest] |
Collaborator
|
Changes look fine to me. |
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
Ensure that our code complies with these policies/checks and prepare for
improved ansible-lint and ansible-test checks.
The shell script jinja templates have been renamed to be
.sh.j2. Older versions of ansible-testuse an old version of shellcheck which does not support
shellcheck disable=all, whichcauses ansible-test to error. I tried adding an ignore-2.14.txt to do
shellcheck!skipfor these files, but then ansible-lint complained that
shellcheckis unskippable.In other roles e.g. nbde_client, we use the
.sh.j2suffix for shell script templates.The
.collection/sub-dir causes problems for ansible-lint.The
whichcommand is not built-in - usecommand -vinstead.Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Refactor shell script templates and lint configuration to comply with Ansible partner certification checks and improve compatibility with ansible-lint and ansible-test.
Enhancements:
CI: