Reject unknown release arguments - #102
Merged
NghiaTranUIT merged 1 commit intoSep 2, 2026
Merged
Conversation
rksharma-owg
marked this pull request as ready for review
September 1, 2026 14:07
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.
Summary
--flag=valueinputs so accidental values are not copied into diagnosticsProblem
Both release argument parsers silently ignored unknown options. A misspelled release flag could therefore change the requested behavior without a clear error; for example, a typo in
--bump-homebrewduring a non-interactive run would be discarded and the Homebrew update would be skipped.Root cause
Each parser handled recognized arguments but had no final rejection branch. Unmatched arguments fell through the loop.
Fix
Fail immediately when an argument does not match the supported option set. For options written as
--name=value, the error includes--namebut omits the value. Valid release options and defaults are unchanged.Security considerations
Release commands run with signing, publishing, and repository credentials. Failing before configuration loading and external operations keeps malformed invocations on a side-effect-free path. Redacting the value portion of unknown options avoids reflecting a potentially sensitive accidental value into logs.
Validation
node --test tests/release-args.test.mjs(3 passed)npm test(24 passed)npm --prefix scripts/nodejs test(passed)node --check scripts/release.mjs(passed)node --check tests/release-args.test.mjs(passed)git diff --check upstream/main...HEAD(passed)The macOS application build and Xcode test suites were not run because this change only affects the Node release entry points and their tests.
Compatibility
Recognized command-line options retain their existing behavior. Previously ignored invalid options now exit with status 1 and an actionable error. There are no application, SDK, capture-format, or persisted-state changes.
AI assistance
OpenAI Codex assisted with repository inspection, implementation, and test preparation. I reviewed the diff and test results and take responsibility for the change.