Fix yargs reserved word conflict for --version option #23
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
The Rust CI/CD pipeline was failing during the "Auto Release" phase because the
create-github-release.mjsscript could not parse the--versioncommand-line argument correctly.Root Cause
"version"is a reserved word in yargs (v17.2.0+), the CLI argument parsing library used bylino-arguments. When a custom--versionoption is defined without disabling the built-in handling, yargs interprets it as a built-in version display command and returnsfalseinstead of the actual argument value.This caused the script to fail with "Missing required arguments" even though the version was correctly passed.
Solution
Add
.version(false)before defining the customversionoption to disable yargs' built-in--versionhandling:Changes
Fixed Scripts (3 files)
rust/scripts/create-github-release.mjs- Primary failure pointrust/scripts/collect-changelog.mjs- Same issue potentialcsharp/scripts/create-github-release.mjs- Same issue potentialDocumentation (Case Study)
docs/case-studies/issue-22/README.md- Detailed case study with root cause analysisdocs/case-studies/issue-22/ci-run-20828012412.txt- Full CI logs from the failed runExperiment Scripts
experiments/test-lino-arguments.mjs- Demonstrates the bugexperiments/test-lino-arguments-fixed.mjs- Demonstrates the fixTesting
Verified locally that the fix works:
References
Test Plan
Fixes #22
This PR was created automatically by the AI issue solver