Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Jan 8, 2026

Summary

The Rust CI/CD pipeline was failing during the "Auto Release" phase because the create-github-release.mjs script could not parse the --version command-line argument correctly.

Root Cause

"version" is a reserved word in yargs (v17.2.0+), the CLI argument parsing library used by lino-arguments. When a custom --version option is defined without disabling the built-in handling, yargs interprets it as a built-in version display command and returns false instead 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 custom version option to disable yargs' built-in --version handling:

const config = makeConfig({
  yargs: ({ yargs, getenv }) =>
    yargs
      .version(false) // Disable yargs built-in --version handling
      .option('version', {
        type: 'string',
        default: getenv('VERSION', ''),
        describe: 'Version number',
      })
      // ... other options
});

Changes

Fixed Scripts (3 files)

  • rust/scripts/create-github-release.mjs - Primary failure point
  • rust/scripts/collect-changelog.mjs - Same issue potential
  • csharp/scripts/create-github-release.mjs - Same issue potential

Documentation (Case Study)

  • docs/case-studies/issue-22/README.md - Detailed case study with root cause analysis
  • docs/case-studies/issue-22/ci-run-20828012412.txt - Full CI logs from the failed run

Experiment Scripts

  • experiments/test-lino-arguments.mjs - Demonstrates the bug
  • experiments/test-lino-arguments-fixed.mjs - Demonstrates the fix

Testing

Verified locally that the fix works:

# Before (returns false)
node test-lino-arguments.mjs --version "0.2.0"
# version: false

# After (returns correct value)
node test-lino-arguments-fixed.mjs --version "0.2.0"
# version: 0.2.0

References

Test Plan

  • Verified fix works locally with test scripts
  • All 3 affected scripts updated
  • CI passes on this PR
  • Rust release workflow succeeds

Fixes #22


This PR was created automatically by the AI issue solver

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #22
@konard konard self-assigned this Jan 8, 2026
The CI was failing in the "Create GitHub Release" step with "Missing
required arguments" even though the version argument was being passed.

Root cause: "version" is a reserved word in yargs (v17.2.0+). When a
custom "version" option is defined without disabling the built-in
handling, yargs returns `false` instead of the actual argument value.

Solution: Add `.version(false)` before defining the custom `version`
option to disable yargs' built-in --version handling.

Fixes:
- rust/scripts/create-github-release.mjs (primary failure)
- rust/scripts/collect-changelog.mjs
- csharp/scripts/create-github-release.mjs

Also includes:
- Case study documentation in docs/case-studies/issue-22/
- Experiment scripts demonstrating the issue and fix

References:
- yargs/yargs#2064
- https://yargs.js.org/docs/#api-reference-version

Fixes #22

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@konard konard changed the title [WIP] Fix Rust CI/CD Fix yargs reserved word conflict for --version option Jan 8, 2026
@konard konard marked this pull request as ready for review January 8, 2026 19:02
@konard
Copy link
Member Author

konard commented Jan 8, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $4.363783 USD
  • Calculated by Anthropic: $3.205403 USD
  • Difference: $-1.158380 (-26.55%)
    📎 Log file uploaded as GitHub Gist (524KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Rust CI/CD

2 participants