[Nitro CLI] Add OpenAPI commands#8969
Conversation
865a104 to
63cae91
Compare
0214d69 to
6ed9b10
Compare
7dca78f to
570efdf
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8969 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive OpenAPI collection management functionality to the Nitro CLI tool. It introduces a new openapi command with subcommands for creating, deleting, listing, uploading, publishing, and validating OpenAPI collections.
Changes:
- Added six new OpenAPI collection management commands (create, delete, list, upload, publish, validate) with corresponding GraphQL queries and mutations
- Extended GraphQL schema with OpenAPI collection types, interfaces, and operations
- Implemented glob pattern matching for selecting multiple OpenAPI document files
- Fixed a typo in ListClientCommand changing "For which client" to "For which API"
Reviewed changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| schema.graphql | Added comprehensive OpenAPI collection types, interfaces, mutations, subscriptions, and error types to the GraphQL schema |
| operations.json | Updated persisted operations with new OpenAPI-related GraphQL queries, mutations, and subscriptions |
| fragments.graphql | Added OpenAPI collection validation fragments and fixed duplicate PersistedQueryValidationError fragment reference |
| ThrowHelper.cs | Added NoOpenApiCollectionSelected() helper method |
| ConsoleHelpers.cs | Added error printing methods for OpenAPI collection validation errors and archive errors |
| GlobMatcher.cs | New utility class for matching files using glob patterns, supporting both absolute and relative paths |
| OpenApiCollectionHelpers.cs | Helper class for building OpenAPI collection archives from document files |
| Create/Delete/List/Upload/Publish/ValidateOpenApiCollectionCommand.cs | Six new command implementations for managing OpenAPI collections |
| OpenApiCollectionIdOption.cs, OpenApiCollectionNameOption.cs, OpenApiCollectionFilePatternOption.cs | Command-line options for OpenAPI collection operations |
| SelectOpenApiCollectionPrompt.cs, OpenApiCollectionDetailPrompt.cs | UI components for selecting and displaying OpenAPI collections |
| OpenApiCommand.cs | Main command that aggregates all OpenAPI subcommands |
| NitroCloudCommandExtensions.cs | Registered the new OpenApiCommand |
| JsonSourceGenerationContext.cs | Added JSON serialization support for OpenAPI collection results |
| Nitro.CommandLine.csproj | Added project references to OpenAPI adapter packages |
| Directory.Packages.props | Added Microsoft.Extensions.FileSystemGlobbing package dependency |
| README.md | Added documentation for updating the schema.graphql file |
| ListClientCommand.cs | Fixed typo in user prompt message |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "The server received an invalid archive. " | ||
| + "This indicates a bug in the tooling. " | ||
| + "Please notify ChilliCream." | ||
| + "Error received: " + message); |
There was a problem hiding this comment.
Missing space after the period. The error message should read "Please notify ChilliCream. Error received:" with a space before "Error received:".
| + "Error received: " + message); | |
| + " Error received: " + message); |
| { | ||
| public PublishOpenApiCollectionCommand() : base("publish") | ||
| { | ||
| Description = "Publish an OpenAPI collection version to an stage"; |
There was a problem hiding this comment.
Grammar error: "to an stage" should be "to a stage". The article "an" is used before vowel sounds, but "stage" begins with a consonant sound.
| Description = "Publish an OpenAPI collection version to an stage"; | |
| Description = "Publish an OpenAPI collection version to a stage"; |
|
|
||
| private static async Task<int> ExecuteAsync( |
There was a problem hiding this comment.
Incorrect indentation: this method declaration is missing one space. It should have 4 spaces of indentation like other methods in the file, but it only has 3 spaces.
| private static async Task<int> ExecuteAsync( | |
| private static async Task<int> ExecuteAsync( |
|
|
||
| internal static class GlobMatcher | ||
| { | ||
| public static IEnumerable<string> Match(IEnumerable<string> patterns) { |
There was a problem hiding this comment.
Missing whitespace between the closing parenthesis and opening brace. According to C# formatting conventions, there should be a space before the opening brace.
| public static IEnumerable<string> Match(IEnumerable<string> patterns) { | |
| public static IEnumerable<string> Match(IEnumerable<string> patterns) { |
🚀 Fusion Gateway Performance ResultsSimple Composite QueryConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query fragment User on User {
id
username
name
}
fragment Review on Review {
id
body
}
fragment Product on Product {
inStock
name
price
shippingEstimate
upc
weight
}
query TestQuery {
topProducts(first: 5) {
...Product
reviews {
...Review
author {
...User
}
}
}
}Deep Recursion QueryConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query fragment User on User {
id
username
name
}
fragment Review on Review {
id
body
}
fragment Product on Product {
inStock
name
price
shippingEstimate
upc
weight
}
query TestQuery {
users {
...User
reviews {
...Review
product {
...Product
reviews {
...Review
author {
...User
reviews {
...Review
product {
...Product
}
}
}
}
}
}
}
topProducts(first: 5) {
...Product
reviews {
...Review
author {
...User
reviews {
...Review
product {
...Product
}
}
}
}
}
}Variable Batching ThroughputConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query query TestQuery_8f7a46ce_2(
$__fusion_1_upc: ID!
$__fusion_2_price: Long!
$__fusion_2_weight: Long!
) {
productByUpc(upc: $__fusion_1_upc) {
inStock
shippingEstimate(weight: $__fusion_2_weight, price: $__fusion_2_price)
}
}Variables (5 sets batched in single request) [
{ "__fusion_1_upc": "1", "__fusion_2_price": 899, "__fusion_2_weight": 100 },
{ "__fusion_1_upc": "2", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 },
{ "__fusion_1_upc": "3", "__fusion_2_price": 15, "__fusion_2_weight": 20 },
{ "__fusion_1_upc": "4", "__fusion_2_price": 499, "__fusion_2_weight": 100 },
{ "__fusion_1_upc": "5", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 }
]No baseline data available for comparison. Run 21522385764 • Commit 2854e22 • Fri, 30 Jan 2026 16:30:06 GMT |
No description provided.