Repository navigation
fix(pre-download): reject missing option value for tier in pre-download.sh - #6340
Closed
vaibhavsrv wants to merge 1 commit into
Closed
vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
Collaborator
|
Thanks for this contribution. |
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.
Why this matters
In
ods/scripts/pre-download.sh, the CLI option parser handles--tierby directly reading$2and performingshift 2without checking available argument count. When invoked with--tierat the end of the argument string or without a parameter (e.g.,./pre-download.sh --tier), the script trips underset -uwith$2: unbound variableor crashes duringshift 2. This leaves users with an unhandled shell error rather than a descriptive usage diagnostic.This change surgically adds argument count and non-empty validation (
if [[ $# -lt 2 || -z "${2:-}" ]]) prior to reading the tier value and shifting. The utility emitsOption --tier requires an argumentand exits cleanly with status 1 while preserving standard tier selections (nano,edge,pro,cluster).Validation
bash ods/scripts/pre-download.sh --tierfailed withline 381: $2: unbound variable.--tierwith missing values emits[ERROR] Option --tier requires an argumentand terminates with status 1.Overlap check
Recent PRs #6337 (environment variable diff in
migrate-config.sh), #6325 (option argument validation inods-backup.sh), and #5878 (download_model error trapping) address separate scripts or failure pathways. This PR isolates argument validation toods/scripts/pre-download.shwithout conflict.Risk / AI disclosure
AI-assisted investigation, implementation and CLI regressions. This strengthens a CLI check, not runtime admission. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.
Follow-up integration evidence
Composed with #6337 at 5ad1dd7 without conflicts. Production and test diffs passed together; pre-download and installer checks remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.