[bug-bash] Invalid command arguments return general-failure exit 1 instead of documented usage exit 2
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reading docs/ci.md and docs/navigation.md to confirm the exit-code contract, then trace how command argument validation errors are mapped to exit codes; the issue points to ArgumentException, JsonException, CommandNotFoundException, and plain CommandException paths. Reproduce the three commands in PowerShell without a database connection. Done when missing or invalid arguments return 2 while runtime failures retain their documented classification.
索引モデルが issue の本文から書いたものです。
説明
Environment
Windows x64, CosmosDBShell 1.1.291-preview (db49321323).
No database connection is required.
Repro (PowerShell)
$package = "$env:USERPROFILE\.dotnet\tools\.store\cosmosdbshell\1.1.291-preview"
$shell = Join-Path $package 'cosmosdbshell.win-x64\1.1.291-preview\tools\net10.0\win-x64\CosmosDBShell.exe'
& $shell --version
$work = Join-Path ([IO.Path]::GetTempPath()) ("cosmos-usage-" + [guid]::NewGuid().ToString("N"))
New-Item -ItemType Directory -Path $work | Out-Null
Set-Location $work
& $shell --output json -c 'echo [1] | filter'
"Exit code: $LASTEXITCODE"
Actual stderr:
{"status":"error","error":"Missing required parameter: ExpressionText"}
Actual exit code: 1.
Another example:
'[{"id":"a","pk":"a"}]' | Set-Content .\sample.json
& $shell --output json -c 'import sample.json --dry-run --concurrency 0'
"Exit code: $LASTEXITCODE"
Actual stderr:
{"status":"error","error":"Concurrency must be a positive integer."}
Actual exit code: 1.
Third exact command:
& $shell --output json -c 'echo [{"id":"a"}] | ftab --format invalid'
"Exit code: $LASTEXITCODE"
Actual stderr:
{"status":"error","error":"The -format option must be one of: default, markdown, html."}
Actual exit code: 1.
Expected
The documented exit-code contract in docs/ci.md
and docs/navigation.md assigns
code 2 to usage errors, invalid/bad arguments, and unknown options. Code 1 is
for failures that do not fit a more specific category. A missing required
parameter and an invalid concurrency argument should therefore classify as 2.
Working control
An unknown command or unknown app-level option correctly returns exit code 2.
Impact
CI wrappers cannot consistently distinguish incorrect invocation from a runtime
failure using the published exit-code contract.
Investigation lead
The current source maps ArgumentException, JsonException, and
CommandNotFoundException to usage errors. Several argument-validation paths
instead create a plain CommandException without a classified inner exception,
which falls through to general failure. This is a candidate root cause,
not a verified fix.
Reproduced against the installed release.
- 主要言語
- C#
- スター
- 4
- フォーク
- 7
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure/CosmosDBShell のほかの issue
-
[bug-bash] print maps a missing item's HTTP 404 to exit 1 instead of documented not-found exit 5オープンbug bug-bash
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Azure/CosmosDBShell#279 ·
メンテナーはふだん 1 日以内に返信
-
bug bug-bash
難易度 3/5 1〜2日 初心者へのやさしさ 75/100
Azure/CosmosDBShell#281 ·
メンテナーはふだん 1 日以内に返信
-
[bug-bash] edit and theme failures silently return exit 1 without a machine-readable stderr errorオープンbug bug-bash
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
Azure/CosmosDBShell#278 ·
メンテナーはふだん 1 日以内に返信
-
bug bug-bash
難易度 3/5 1〜2日 初心者へのやさしさ 75/100
Azure/CosmosDBShell#277 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Azure/CosmosDBShell#274 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
Azure/CosmosDBShell の issue をすべて見る
似ている issue
-
needs-area-label
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 2 日以内に返信
-
bug github_actions
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
endercodezz/BYDLO#336 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
SubtitleEdit/subtitleedit#16638 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
sebastienros/jint#4449 ·
メンテナーはふだん 1 日以内に返信