[Automated] Update gcloud CLI Options#2578
Conversation
Not up to standards ⛔🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Code Review: Automated gcloud CLI Options Update
This is an automated PR generated by the OptionsGenerator tool. All files carry the // <auto-generated> header and [GeneratedCode] attribute, so no manual edits should be expected. My review focuses on the generator's output quality rather than asking for hand-edits, but flags issues worth fixing in the generator itself.
Naming Inconsistency: GcloudWorkloadidentity vs GcloudWorkloadIdentity
The newly added service classes use a lowercase-merged name (GcloudWorkloadidentity, GcloudWorkloadidentityServiceAgents), while the options records for the same gcloud command group use proper PascalCase (GcloudWorkloadIdentityOptions, GcloudWorkloadIdentityServiceAgentsGenerateOptions).
This is because gcloud workloadidentity is registered as a single unhyphenated token, which ToPascalCase in GeneratorUtils.cs converts to Workloadidentity (capitalizes only the first character, since there is no hyphen separator to split on). The options records are named after the [CliSubCommand("workload-identity", ...)] attribute value, which is correctly hyphenated and round-trips to WorkloadIdentity.
The result is two different naming conventions for the same API surface in the same assembly:
IGcloud.Workloadidentity(service property) vsGcloudWorkloadIdentityOptions(options record)GcloudWorkloadidentity.ServiceAgents.Generate(GcloudWorkloadIdentityServiceAgentsGenerateOptions)— both names appear in the same method signature
This is a generator bug worth fixing: the ToPascalCase call on the raw CLI command name (e.g. workloadidentity) should either use a dictionary of known compound-word gcloud command groups that need manual word-boundary hints, or the generator should derive the class name from the canonical [CliSubCommand] value (where the hyphenated form workload-identity is already available). The latter approach would make class names consistent by construction.
Missing <summary> on --regexp Properties
Several newly added List options classes emit a --regexp property without an XML doc comment:
GcloudComputeCompositeHealthChecksListOptions.RegexpGcloudComputeHealthAggregationPoliciesListOptions.RegexpGcloudComputeHealthSourcesListOptions.Regexp
This pattern also exists in pre-existing generated files (GcloudComputeForwardingRulesListOptions, GcloudPreviewComputeInstantSnapshotsListOptions, etc.), so this is a pre-existing generator gap rather than a regression in this PR. It would be worth tracking a generator issue to emit the gcloud help text for --regexp ("Regular expression to filter the names of the results") so IntelliSense surfaces something useful.
Missing Summaries on Several New Options Properties
In GcloudComputeHealthAggregationPoliciesCreateOptions, these three properties have no <summary>:
[CliOption("--healthy-percent-threshold", Format = OptionFormat.EqualsSeparated)]
public string? HealthyPercentThreshold { get; set; }
[CliOption("--min-healthy-threshold", Format = OptionFormat.EqualsSeparated)]
public string? MinHealthyThreshold { get; set; }
[CliOption("--policy-type", Format = OptionFormat.EqualsSeparated)]
public string? PolicyType { get; set; }The help text for these was likely not scraped (possibly because the gcloud alpha/beta command is new). This is consistent with how the generator behaves when help text is unavailable, but it degrades discoverability. Again, a generator-level issue to track rather than a manual fix here.
Potential Type Imprecision: string? for Numeric Thresholds
HealthyPercentThreshold and MinHealthyThreshold are typed as string?, where an int? or double? would be more appropriate. This matches the generator's conservative fallback when type detection cannot determine the exact type (no description to parse). Not a blocking issue, but worth noting as another generator-level improvement opportunity.
Positives
- The
GcloudConcurrencyModeenum is well-formed and correctly used inGcloudFirestoreDatabasesUpdateOptions.ConcurrencyMode, replacing a loose string with a type-safe enum. This is the correct approach. - The lazy-initialized sub-service properties (
_compositeHealthChecks ??= new ...) follow the existing established pattern throughoutGcloudCompute.Generated.csand are consistent. - The
GcloudWorkstationsClusters.UpdateandGcloudSccSources.Listadditions correctly useoptions ?? new TOptions()defaulting, matching the rest of the generated service layer. - Removal of the stale
--loggingoption fromGcloudBeyondcorpSecurityGatewaysCreateOptionsand cleanup of the--request-iddoc comment inGcloudBeyondcorpSecurityGatewaysUpdateOptionsare accurate reflections of the upstream CLI change.
Summary
The generated output is structurally correct and consistent with the existing patterns. The two items most worth tracking as generator improvements are:
- Fix the
ToPascalCase/ naming strategy so thatworkloadidentity(unhyphenated CLI name) producesWorkloadIdentityrather thanWorkloadidentity, aligning service class names with options class names. - Emit fallback summaries for
--regexpand other undocumented flags so IntelliSense is always populated.
Neither issue is introduced new by this PR (the workloadidentity inconsistency is new here, but it originates from a generator behavior that was latent), so this is safe to merge as-is given the automated nature of the changes.
Summary
This PR contains automatically generated updates to gcloud CLI options classes.
The generator scraped the latest CLI help output from the installed tool.
Changes
Verification
🤖 Generated with ModularPipelines.OptionsGenerator