Conversation
There was a problem hiding this comment.
Automated PR Review - Pulumi CLI Options Update
This PR is generated by the ModularPipelines.OptionsGenerator and adds the --otel-traces flag (OpenTelemetry traces export endpoint) across 100 Pulumi command options classes. The change is consistent and mechanically correct. A few architectural observations worth noting:
Primary Concern: Global Flag Duplication Instead of Inheritance
The most significant pattern to call out is that --otel-traces is being added individually to every single one of ~100 command-specific options classes, rather than to the PulumiOptions base class.
Looking at PulumiOptions.Generated.cs, the base class is currently empty:
[CliTool("pulumi")]
public abstract record PulumiOptions : CommandLineToolOptions
{
}Yet flags like --non-interactive, --profiling, --tracing, and now --otel-traces appear identically in every subcommand options class. These are Pulumi global flags (they appear in pulumi --help's Flags: / Global Flags: section and are inherited by all subcommands).
Why this matters architecturally:
- When Pulumi adds or modifies another global flag in a future release, the generator will again produce a diff touching 100+ files
- Consumers setting
OtelTraceson aPulumiUpOptionsinstance cannot do so via thePulumiOptionsbase type, reducing polymorphic usability - The generated code is harder to inspect — it's not clear which options are "global" vs command-specific without reading each file
Better approach: The generator's PulumiOptions (or the CobraCliScraper base class) should detect global flags at the root command level and emit them once on the base class, suppressing them from subcommand classes via deduplication during generation. The ParseOptions method in CobraCliScraper.cs already has a seenOptions deduplication set within a single command — the same logic could be extended cross-command for global flags identified from the root --help output.
Minor: OtelTraces Type Could Be More Descriptive
The property is typed as string?:
[CliOption("--otel-traces", Format = OptionFormat.EqualsSeparated)]
public string? OtelTraces { get; set; }The description says it accepts file:// paths or grpc:// endpoints. While string? is pragmatic and the generator cannot infer a richer type from CLI help text alone, this is a case where a future manual extension (the pattern already supported by the codebase for non-generated overrides) could provide a typed wrapper — e.g., a Uri-validated helper — for better discoverability.
What the PR Gets Right
- The change itself is mechanically correct: the
[CliOption]attribute,OptionFormat.EqualsSeparated, and the XML doc comment are all consistent with every other option in the generated files - The
AssemblyInfo.Generated.cstimestamp bump correctly signals regeneration - Auto-merge via squash is the right strategy for automated dependency PRs like this
- The generator's
CobraCliScraperapproach of parsing--helpoutput directly (rather than scraping web docs) is sound and ensures the generated options stay in sync with whatever version of pulumi is actually installed in CI
Summary: The PR is safe to merge as-is. The architectural note above about global flags in the base class is a generator-level improvement opportunity, not a blocker for this PR.
e243d80 to
5cbabe8
Compare
There was a problem hiding this comment.
Follow-up Review (2026-03-22 regeneration)
This PR has been regenerated since the previous review on 2026-03-15. The regeneration updated the AssemblyInfo.Generated.cs timestamp from 2026-03-08 to 2026-03-22.
Previous Concern: Still Open
The architectural note from the prior review remains unaddressed (expected, since it's a generator-level change, not something this PR can fix):
Global flag
--otel-tracesis duplicated across ~100 classes instead of being declared once on thePulumiOptionsbase class.
The PulumiOptions base is still empty, and flags like --non-interactive, --profiling, --tracing, and now --otel-traces continue to be repeated verbatim in every subcommand class. The recommendation stands: the generator should detect global flags from the root pulumi --help output and emit them to the base class, deduplicating them from subcommand classes.
This is not a blocker for this PR — it's a generator improvement that would reduce future PR noise.
Change Assessment
The regeneration itself is clean:
- No functional difference from the previous iteration; the content added (
OtelTraces/--otel-traces) is unchanged - Timestamp-only delta in
AssemblyInfo.Generated.csis expected and correct - Two files (
PulumiOrgSearchAiOptions.Generated.cs,PulumiOrgSearchOptions.Generated.cs) correctly show no changes, indicating the generator was idempotent for those commands
Safe to merge.
Summary
This PR contains automatically generated updates to pulumi CLI options classes.
The generator scraped the latest CLI help output from the installed tool.
Changes
Verification
🤖 Generated with ModularPipelines.OptionsGenerator