scaffold generated CLI integration point in main.rs#656
Merged
MintsInc merged 1 commit intoJul 20, 2026
Conversation
openapi-transformer will regenerate pup CLI command modules from the OpenAPI spec into src/generated.rs (see #651, the pilot run for this pipeline). Land the wiring ahead of that so main.rs never needs touching again on future regenerations: mod generated, flatten GeneratedCommand into the Commands enum so generated subcommands appear as top-level peers, and route the arm through main_inner() following the existing per-domain pattern. src/generated.rs here is a placeholder with an empty GeneratedCommand enum, not #651's actual generated output - #651 hand-writes a top-level downtime command (list/get/create/cancel) that collides on the subcommand name with the generated Downtime variant it introduces (clap panics at runtime: "command name `downtime` is duplicated"). That collision needs a product decision - retire/merge the hand-written downtime command, or pick a different pilot operation upstream - before any generated variants land. This PR only establishes the scaffold; #651 becomes a pure additive diff to generated.rs (and new sibling modules) once that decision is made.
MintsInc
marked this pull request as ready for review
July 20, 2026 08:07
nogates
approved these changes
Jul 20, 2026
MintsInc
deleted the
ulysse.mavrocordatos/AAWF-1384/wire-generated-cli-v2
branch
July 20, 2026 08:41
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.
Context
openapi-transformer will regenerate pup CLI command modules from the OpenAPI spec into src/generated.rs — #651 is the pilot run for this pipeline. This PR lands the main.rs wiring ahead of that so the integration point is stable: every future openapi-transformer regeneration only adds variants to GeneratedCommand (and sibling modules) inside generated.rs, and main.rs never needs to change again.
Changes
Added mod generated alongside the other top-level module declarations, and flattened GeneratedCommand into the Commands enum with #[command(flatten)] rather than nesting it under a pup generated subcommand — generated subcommands will appear as top-level peers (e.g. pup downtime get ...), matching how every other domain is exposed today. Routed the new arm through main_inner() following the existing per-domain pattern (cfg.validate_auth() then dispatch).
src/generated.rs here is a placeholder with an empty GeneratedCommand enum, not #651's actual generated output. #651 introduces a generated Downtime variant that collides on the subcommand name with pup's existing hand-written top-level downtime command (list/get/create/cancel): clap panics at runtime with "command name
downtimeis duplicated" on any invocation that builds the full Command tree. That collision needs a product decision — retire/merge the hand-written downtime command, or pick a different pilot operation upstream in datadog-api-spec — before any generated variants can land. This PR only establishes the scaffold; once that decision is made, #651 becomes a pure additive diff to generated.rs and its sibling modules, with no main.rs changes required.Tests