Preserve explicit Azure CLI Boolean values - #4008
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedNext included review available in 25 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR refines CLI help-text interpretation so Azure options requiring explicit Boolean values remain value-taking while ordinary flags retain presence-only behavior.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| tools/ModularPipelines.OptionsGenerator/src/ModularPipelines.OptionsGenerator/Scrapers/Cli/AzCliScraper.cs | Separates explicit scalar Boolean values, Boolean collections, and presence-only flags during Azure option parsing. |
| tools/ModularPipelines.OptionsGenerator/src/ModularPipelines.OptionsGenerator/Scrapers/Cli/CliScraperBase.cs | Expands explicit Boolean detection to recognize Azure-style allowed-value descriptions. |
| tools/ModularPipelines.OptionsGenerator/src/ModularPipelines.OptionsGenerator/Scrapers/Cli/WinGetCliScraper.cs | Uses parsed contextual choices to prevent value-taking WinGet options from being classified as flags. |
| tools/ModularPipelines.OptionsGenerator/src/ModularPipelines.OptionsGenerator/TypeDetection/DescriptionEnumValueParser.cs | Adds preference wording to contextual parenthesized enum detection. |
| tools/ModularPipelines.OptionsGenerator/src/ModularPipelines.OptionsGenerator.Tests/Scrapers/AzCliScraperTests.cs | Adds regression coverage for scalar, list, tri-state, and unrelated-repeatability Boolean descriptions. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Help[CLI help text] --> Scraper[CLI scraper]
Scraper --> Bool{Explicit Boolean values?}
Bool -->|Yes, scalar| NullableBool[Value-taking bool?]
Bool -->|Yes, repeatable| BoolCollection[Boolean value collection]
Bool -->|No| FlagCheck{Presence-only flag?}
FlagCheck -->|Yes| Flag[CliFlag]
FlagCheck -->|No| EnumParser[Description enum parser]
EnumParser --> Generated[Generated option type and attribute]
Reviews (9): Last reviewed commit: "fix(generator): preserve WinGet mode val..." | Re-trigger Greptile
Code reviewReviewed the fix for #3989 ( Suggestion: gate the explicit-Boolean promotion behind the existing type/list detection
if (isFlag || explicitBooleanValue)
{
return "bool?";
}
...
if (lowerDesc.Contains("space-separated") || lowerDesc.Contains("list of") || ...)
{
return "IEnumerable<string>?";
}
The result: once Azure options are regenerated, this property will require exactly one
This is a narrow edge case (appears to affect a couple of Az CLI options in the current dataset), and doesn't block the main fix — flagging it since it's a direct, real-data consequence of the changed condition in this diff. No other issues found; the rest of the change is a clean, minimal extension of the existing shared pattern. |
3d13823 to
8abe85a
Compare
|
Addressed the review's real-data edge case in |
Code reviewFollow-up on my previous review of this PR: the edge case I flagged (
I pulled the branch and ran the full One minor maintainability note (non-blocking)
No other issues found. The change is a clean, well-tested extension of the existing |
|
Addressed the non-blocking drift note in 4599e73. General list detection and Boolean-list detection now share HelpDeclaresSpaceSeparatedList; Boolean handling still deliberately excludes the broad multiple heuristic. Validation: OptionsGenerator tests 820/820; Release build 0 warnings/errors. |
|
Rebased onto current main (13fd094). Validation: Azure scraper tests 4/4; OptionsGenerator Release build succeeded with 0 warnings/errors. Combined run 32664459107 additionally exposed pre-existing generated API drift for AzAksCreateOptions.NodeCount (�ool? baseline vs correct live int?), to migrate with #3935 compatibility support. |
4599e73 to
cdee36f
Compare
Code reviewFollow-up on my previous review of this PR: the maintainability note from my second pass is addressed correctly in Reviewed against the current head ( 1.
|
|
Addressed both current-head review points in
Added Azure regressions for the tri-state and @claude review exact head |
|
Validated new head 5c7e864 after Boolean-hint bounding: AzCliScraperTests 6/6 and WinGetCliScraperTests 4/4 passed; OptionsGenerator Release build succeeded with 0 warnings/errors; commit diff check clean. |
Code reviewFollow-up review at the requested head I re-verified both points raised in my previous review and confirmed they're fixed:
I pulled the branch and ran One residual gap in the same "keep type inference aligned with shape validation" fix (non-blocking)The alignment in point 2 only covers the description-level signal. So a continuation line carrying repeatable wording ( This is the same class of bug the last two rounds caught (a heuristic used for typing drifting from the heuristic used for validation), just relocated from wording mismatch to text-capture-boundary mismatch. It doesn't reproduce against the current Az/Cobra/Nbgv corpus and none of the new tests happen to hit it, so it's not blocking. Worth noting separately: the new Two smaller, lower-priority notes (non-blocking, unlikely in practice)
Nothing here blocks merge — the core #3989 fix and its two prior review rounds' follow-ups are correctly and demonstrably fixed by tests. The residual gap I called out is the same kind of latent trap flagged (and accepted as non-blocking) in the last two rounds, now at a different layer of the same alignment problem. |
Treat Azure CLI options documented as Boolean values as value-taking bool options while retaining ordinary presence-only flags.`n`nFixes #3989
Keep space-separated true/false values as collections before promoting scalar Boolean options.
Recognize only exact two-value allowed-value lists as Boolean, and share repeatability detection when explicit Boolean values form a collection. Refs #3989.
5c7e864 to
47fba03
Compare
|
@claude Please re-review exact head 884b0e0. Added WinGet authentication-mode regression and shared contextual enum parsing for preference lists, preventing explicit mode choices from becoming boolean flags. Validation: WinGetCliScraperTests 5/5, DescriptionEnumValueParserTests 20/20, AzCliScraperTests 6/6. |
Code ReviewReviewed the changes to A few things worth considering before/after merge: 1. The new
|
Summary
bool?while preserving ordinary flagsaz eventhubs namespace createValidation
Fixes #3989
Part of #3996