fix(capability): enforce valid output path before shifting profiler options - #6795
Open
vaibhavsrv wants to merge 1 commit into
Open
vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
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/build-capability-profile.sh, the--outputoption reads$2and executesshift 2underset -euo pipefailwithout checking if an argument was provided. Passing--outputas the trailing argument crashes the script with an unhandled exit code 1 and an empty standard error, providing operators and automated wrappers with no diagnostic information. Furthermore, passing--outputimmediately before--env(i.e.,build-capability-profile.sh --output --env) causes the parser to swallow--envintoOUTPUT_FILE, suppressing--envmode and attempting to write profile output to a file named--env.This change introduces pre-shift validation for
--output. If the argument is missing, empty, or starts with a hyphen indicating an option flag, the script outputs a clear diagnostic (ERROR: --output requires an argument) to standard error and exits with usage status 1. Valid output path specifications and hardware classification profiling contracts remain untouched.Validation
bash ods/scripts/build-capability-profile.sh --outputhalted abruptly with unhandled exit 1 and empty stderr; passing--output --envswallowed--envintoOUTPUT_FILE.python3 ods/tests/test_build_capability_profile_options.pyconfirms that missing, empty, and option-hijacked invocations fail with exit code 1 and output theERROR: --output requires an argumentdiagnostic, while unknown options reject cleanly.Overlap check
install-core.sh,ods-backup.sh,pre-download.sh, andods-test.sh; did not touchbuild-capability-profile.sh.prune-hermes-slash-workers.sh; completely separate script.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 #6794 at 1001730 without conflicts. Production and test diffs passed together; worker pruning 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.