Skip to content

[DNM] [multiple] Comprehensive shellcheck warning cleanup across scripts#3817

Draft
amartyasinha wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
amartyasinha:remove_warnings
Draft

[DNM] [multiple] Comprehensive shellcheck warning cleanup across scripts#3817
amartyasinha wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
amartyasinha:remove_warnings

Conversation

@amartyasinha
Copy link
Copy Markdown
Contributor

This commit addresses multiple categories of shellcheck warnings to significantly reduce noise in pre-commit logs, making it easier for developers to identify actual failuers in pre-commit job.

Changes include:

  1. Variable quoting fixes (SC2086):

    • Add quotes in nat64_appliance, update role, and all scripts
    • Prevents globbing and word splitting issues
  2. Shell syntax improvements:

    • Fix getopts patterns (remove invalid + syntax)
    • Use ((...)) instead of 'let' expressions
    • Add -r flag to read commands
    • Fix variable assignment patterns to avoid masking return values
  3. Shellcheck disables for legitimate cases with explanations:

    • OS release files: Don't exist in CI/dev environments
    • NAT64 config files: Generated at runtime in target environment
    • Python venv activate: Created dynamically by venv command
  4. Remove unused variables (SC2034):

    • collection_path in run_ansible_test (never used)
    • RHT_PKG_MGR in setup_env (script uses dnf directly)

All changes maintain functionality while making pre-commit output much cleaner and more actionable for developers.

This commit addresses multiple categories of shellcheck warnings to
significantly reduce noise in pre-commit logs, making it easier for
developers to identify actual failuers in pre-commit job.

Changes include:

1. Variable quoting fixes (SC2086):
   - Add quotes in nat64_appliance, update role, and all scripts
   - Prevents globbing and word splitting issues

2. Shell syntax improvements:
   - Fix getopts patterns (remove invalid + syntax)
   - Use ((...)) instead of 'let' expressions
   - Add -r flag to read commands
   - Fix variable assignment patterns to avoid masking return values

3. Shellcheck disables for legitimate cases with explanations:
   - OS release files: Don't exist in CI/dev environments
   - NAT64 config files: Generated at runtime in target environment
   - Python venv activate: Created dynamically by venv command

4. Remove unused variables (SC2034):
   - collection_path in run_ansible_test (never used)
   - RHT_PKG_MGR in setup_env (script uses dnf directly)

All changes maintain functionality while making pre-commit output
much cleaner and more actionable for developers.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>

Signed-off-by: Amartya Sinha <amsinha@redhat.com>
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 31, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 31, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign eshulman2 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@softwarefactory-project-zuul
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/57beb47cc0a1406d9b39b257844814b5

openstack-k8s-operators-content-provider RETRY_LIMIT in 2m 32s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal-minor-update SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
cifmw-pod-zuul-files FAILURE in 4m 08s
✔️ noop SUCCESS in 0s
cifmw-pod-ansible-test FAILURE in 4m 18s
cifmw-pod-pre-commit FAILURE in 4m 19s
cifmw-molecule-devscripts RETRY_LIMIT in 1m 55s
cifmw-molecule-nat64_appliance RETRY_LIMIT in 1m 57s
cifmw-molecule-openshift_provisioner_node RETRY_LIMIT in 1m 51s
cifmw-molecule-update RETRY_LIMIT in 1m 53s

@amartyasinha
Copy link
Copy Markdown
Contributor Author

recheck

@softwarefactory-project-zuul
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/1d1640118bdf43ffabca7cef7783565e

openstack-k8s-operators-content-provider RETRY_LIMIT in 2m 27s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal-minor-update SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
cifmw-pod-zuul-files FAILURE in 4m 16s
✔️ noop SUCCESS in 0s
cifmw-pod-ansible-test FAILURE in 4m 20s
cifmw-pod-pre-commit FAILURE in 4m 19s
cifmw-molecule-devscripts RETRY_LIMIT in 1m 51s
cifmw-molecule-nat64_appliance RETRY_LIMIT in 1m 52s
cifmw-molecule-openshift_provisioner_node RETRY_LIMIT in 1m 51s
cifmw-molecule-update RETRY_LIMIT in 1m 57s

@amartyasinha amartyasinha changed the title [multiple] Comprehensive shellcheck warning cleanup across scripts [DNM] [multiple] Comprehensive shellcheck warning cleanup across scripts Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant