Repository navigation
[Nitro CLI] Return proper not found error for mutation errors - #10111
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Nitro CLI command error handling so typed “not found” mutation errors are surfaced as a consistent “not found” failure (via NitroClientNotFoundException), producing the standard guidance message about entity absence/permissions and --cloud-url. The change is validated by converting many prior “unexpected mutation error” theory cases into dedicated snapshot tests that assert the new not-found output.
Changes:
- Map various typed GraphQL mutation “not found” errors to
NitroClientNotFoundExceptionacross multiple commands. - Update/expand CLI test coverage with new snapshot-based
[Fact]tests for the standardized not-found stderr output (and remove the old theory cases that asserted the previous behavior). - Remove a stale project reference from
Nitro.CommandLine.slnx.
Reviewed changes
Copilot reviewed 70 out of 70 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Nitro/CommandLine/test/CommandLine.Tests/GlobalOptionsTests.cs | Moves global-options CLI test into the fixture-based test base. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Stages/EditStagesCommandTests.cs | Adds dedicated not-found snapshot tests for stage edit. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Stages/DeleteStageCommandTests.cs | Adds dedicated not-found snapshot tests for stage delete. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Schemas/ValidateSchemaCommandTests.cs | Adds dedicated not-found snapshot tests for schema validation. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Schemas/UploadSchemaCommandTests.cs | Adds dedicated not-found snapshot test for schema upload. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Schemas/PublishSchemaCommandTests.cs | Adds dedicated not-found snapshot tests for schema publish. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/PersonalAccessTokens/RevokePersonalAccessTokenCommandTests.cs | Adds dedicated not-found snapshot test for PAT revoke. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/OpenApi/ValidateOpenApiCollectionCommandTests.cs | Adds dedicated not-found snapshot tests for OpenAPI validate. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/OpenApi/UploadOpenApiCollectionCommandTests.cs | Adds dedicated not-found snapshot test for OpenAPI upload. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/OpenApi/PublishOpenApiCollectionCommandTests.cs | Adds dedicated not-found snapshot tests for OpenAPI publish. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/OpenApi/DeleteOpenApiCollectionCommandTests.cs | Adds dedicated not-found snapshot test for OpenAPI delete. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/OpenApi/CreateOpenApiCollectionCommandTests.cs | Adds dedicated not-found snapshot test for OpenAPI create. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mocks/UpdateMockCommandTests.cs | Adds dedicated not-found snapshot test for mock update. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mocks/CreateMockCommandTests.cs | Adds dedicated not-found snapshot test for mock create. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/ValidateMcpFeatureCollectionCommandTests.cs | Adds dedicated not-found snapshot tests for MCP validate. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/UploadMcpFeatureCollectionCommandTests.cs | Adds dedicated not-found snapshot test for MCP upload. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/PublishMcpFeatureCollectionCommandTests.cs | Adds dedicated not-found snapshot tests for MCP publish. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/DeleteMcpFeatureCollectionCommandTests.cs | Adds dedicated not-found snapshot test for MCP delete. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Mcp/CreateMcpFeatureCollectionCommandTests.cs | Adds dedicated not-found snapshot test for MCP create. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/GlobalOptionsCommandTests.cs | Removes old standalone global-options test file (replaced by GlobalOptionsTests). |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionValidateCommandTests.cs | Adds dedicated not-found snapshot tests for fusion validate. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionUploadCommandTests.cs | Adds dedicated not-found snapshot test for fusion upload. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionPublishCommandTests.cs | Adds extensive dedicated not-found snapshot tests for fusion publish flows. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionConfigurationPublishValidateCommandTests.cs | Adds request-not-found snapshot test for publish validate. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionConfigurationPublishCommitCommandTests.cs | Adds request-not-found snapshot test for publish commit. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionConfigurationPublishCancelCommandTests.cs | Adds request-not-found snapshot test for publish cancel. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionConfigurationPublishBeginCommandTests.cs | Adds API/stage not-found snapshot tests for publish begin. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/ValidateClientCommandTests.cs | Adds dedicated not-found snapshot tests for client validate. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/UploadClientCommandTests.cs | Adds dedicated not-found snapshot test for client upload. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/UnpublishClientCommandTests.cs | Adds dedicated not-found snapshot tests for client unpublish. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/PublishClientCommandTests.cs | Adds dedicated not-found snapshot tests for client publish. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/DeleteClientCommandTests.cs | Updates not-found snapshot to include standardized guidance lines. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Clients/CreateClientCommandTests.cs | Adds dedicated API-not-found snapshot test for client create. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Apis/SetApiSettingsCommandTests.cs | Adds dedicated API-not-found snapshot test for set-settings. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Apis/DeleteApiCommandTests.cs | Removes ApiNotFound from mutation error theory cases (no direct replacement test added). |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/ApiKeys/DeleteApiKeyCommandTests.cs | Adds dedicated API-key-not-found snapshot test. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/ApiKeys/CreateApiKeyCommandTests.cs | Adds dedicated API/role-not-found snapshot tests. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Stages/EditStagesCommand.cs | Throws NitroClientNotFoundException for API/stage not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Stages/DeleteStageCommand.cs | Throws NitroClientNotFoundException for API/stage not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Schemas/UploadSchemaCommand.cs | Throws NitroClientNotFoundException for API not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Schemas/SchemaHelpers.cs | Throws NitroClientNotFoundException for API/stage/schema not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Schemas/PublishSchemaCommand.cs | Throws NitroClientNotFoundException for API/stage/schema not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/PersonalAccessTokens/RevokePersonalAccessTokenCommand.cs | Throws NitroClientNotFoundException for PAT not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/ValidateOpenApiCollectionCommand.cs | Throws NitroClientNotFoundException for stage/collection not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/UploadOpenApiCollectionCommand.cs | Throws NitroClientNotFoundException for collection not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/PublishOpenApiCollectionCommand.cs | Throws NitroClientNotFoundException for stage/collection/version not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/DeleteOpenApiCollectionCommand.cs | Throws NitroClientNotFoundException for collection not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/OpenApi/CreateOpenApiCollectionCommand.cs | Throws NitroClientNotFoundException for API not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Mocks/UpdateMockCommand.cs | Throws NitroClientNotFoundException for mock schema not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Mocks/CreateMockCommand.cs | Throws NitroClientNotFoundException for API not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/ValidateMcpFeatureCollectionCommand.cs | Throws NitroClientNotFoundException for stage/collection not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/UploadMcpFeatureCollectionCommand.cs | Throws NitroClientNotFoundException for collection not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/PublishMcpFeatureCollectionCommand.cs | Throws NitroClientNotFoundException for stage/collection/version not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/DeleteMcpFeatureCollectionCommand.cs | Throws NitroClientNotFoundException for collection not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Mcp/CreateMcpFeatureCollectionCommand.cs | Throws NitroClientNotFoundException for API not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishCancelCommand.cs | Throws NitroClientNotFoundException for request not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionUploadCommand.cs | Throws NitroClientNotFoundException for API not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishHelpers.cs | Throws NitroClientNotFoundException for API/stage/request not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs | Throws NitroClientNotFoundException for request not found typed errors in publish flow. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Clients/ValidateClientCommand.cs | Throws NitroClientNotFoundException for client/stage not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Clients/UploadClientCommand.cs | Throws NitroClientNotFoundException for client not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Clients/UnpublishClientCommand.cs | Throws NitroClientNotFoundException for stage/client/version not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Clients/PublishClientCommand.cs | Throws NitroClientNotFoundException for client/stage/version not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Clients/DeleteClientCommand.cs | Throws NitroClientNotFoundException for client not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Clients/CreateClientCommand.cs | Throws NitroClientNotFoundException for API not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Apis/SetApiSettingsCommand.cs | Throws NitroClientNotFoundException for API not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Apis/DeleteApiCommand.cs | Throws NitroClientNotFoundException for API not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/ApiKeys/DeleteApiKeyCommand.cs | Throws NitroClientNotFoundException for API key not found typed errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/ApiKeys/CreateApiKeyCommand.cs | Throws NitroClientNotFoundException for API/role not found typed errors. |
| src/Nitro/CommandLine/Nitro.CommandLine.slnx | Removes stale client project entry from the solution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
This was referenced Jul 23, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 1, 2026
This was referenced Aug 10, 2026
Closed
Closed
This was referenced Sep 1, 2026
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
This was referenced Oct 5, 2026
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.
No description provided.