Skip to content

Preserve not-found exit code for missing print items - #288

Merged
Mike Krüger (mkrueger) merged 2 commits into
mainfrom
dev/mkrueger/fix/279-print-not-found-exit-code
Nov 5, 2026
Merged

Mike Krüger (mkrueger) merged 2 commits into
mainfrom
dev/mkrueger/fix/279-print-not-found-exit-code

Conversation

@mkrueger

Copy link
Copy Markdown
Collaborator

Fixes #279.

Summary

  • Preserve HTTP 404 in the exception chain when print receives a missing-item stream response, so the existing exit-code classifier returns 5 instead of 1.
  • Keep the friendly item/partition-key diagnostic and request-charge accounting unchanged.
  • Add an offline regression test and changelog entry.

Validation

  • Application and test projects build without warnings.
  • Focused print and exit-code tests: 87 passed.
  • Offline suite: 5,070 passed, 6 skipped on rerun. The first run encountered an unrelated temporary-file race in the dir JSON contract test.
Retain HTTP 404 in the friendly print error's exception chain so missing items map to exit code 5. Add regression coverage for status, message, and request charge.

Fixes #279

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change preserving HTTP 404 classification for missing print items.

No open issues 🎉

What changed in this PR

Fixes #279 by preserving HTTP 404 in the exception chain for missing print items, allowing the existing exit-code classifier to return 5 instead of 1.

Changes:

  • Retains the friendly missing-item diagnostic while preserving the HTTP status.
  • Adds an offline regression test covering the diagnostic, status, exit code, and request-charge accounting.
  • Documents the corrected behavior in the changelog.
File Description
CosmosDBShell/​Azure.Data.Cosmos.Shell.Commands/​PrintCommand.cs Adds a status-bearing inner exception for missing items.
CosmosDBShell.Tests/​CommandTests/​PrintCommandTests.cs Tests missing-item classification and preserved accounting.
CHANGELOG.md Records the corrected not-found exit code.

Review effort: Balanced

@github-code-quality

github-code-quality Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: C#

C# / code-coverage/dotnet

main 4f49e5a dev/mkrueger/fix/279... b829c01 +/-
74% 74% 0%
View coverage of the 6 most impacted files.
File main 4f49e5a dev/mkrueger/fix/279... b829c01 +/-
D:\a\CosmosDBSh...akeDbCommand.cs 97% 91% -6%
D:\a\CosmosDBSh...hargeContext.cs 96% 93% -3%
D:\a\CosmosDBSh...ceOperations.cs 51% 51% 0%
D:\a\CosmosDBSh...urceProvider.cs 65% 65% 0%
D:\a\CosmosDBSh...s\PwdCommand.cs 100% 100% 0%
D:\a\CosmosDBSh...PrintCommand.cs 75% 86% +11%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 05, 2026 10:01 UTC

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 5, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the change preserving HTTP 404 classification for missing print items.

No open issues 🎉

Review effort: Balanced

@mkrueger
Mike Krüger (mkrueger) merged commit 9b8ce37 into main Nov 5, 2026
13 checks passed
@mkrueger
Mike Krüger (mkrueger) deleted the dev/mkrueger/fix/279-print-not-found-exit-code branch November 5, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants