Skip to content

fix(generator): keep "is a list of one or more" descriptions scalar - #4720

Open
thomhurst wants to merge 1 commit into
mainfrom
issue-4718-list-of-one-or-more
Open

fix(generator): keep "is a list of one or more" descriptions scalar#4720
thomhurst wants to merge 1 commit into
mainfrom
issue-4718-list-of-one-or-more

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

CliScraperBase.RepeatableValueRegex treats (specifications?|lists?) of (one|zero) or more <noun> as a repeatable-option signal. #4543 added it for Docker's --external-ca external-ca Specifications of one or more certificate signing endpoints. It also matches gcloud's --filter=FILTER prose, "Expression is a list of one or more restrictions combined via logical operators 'AND' and 'OR'", which describes the grammar of one expression string. The latest gcloud regeneration (#4665) therefore flipped GcloudSccAssetsGroupOptions.Filter and GcloudSccFindingsGroupOptions.Filter to IEnumerable<string>?, and the review blocked it.

Change

  • The list of / specification of alternative no longer matches when it is the predicate of an article-led sentence about one value (is|are|as|be|being + a|an|the). Docker's phrasing has no article and keeps matching.
  • Tests: the Docker phrase joins the positive repeatability cases; both gcloud phrasings are covered by a new scalar case.

CliScraperTraversalTests (61) and the full Scrapers namespace (665) pass locally.

Follow-up

#4665 is regenerated from main via the generation workflow once this merges (automated PRs are never rebased).

Closes #4718

https://claude.ai/code/session_01PkLNTUfwGXjqXZrYrHaDGC

The repeatable-option heuristic accepted any "list of / specification of
<one or more> <noun>" phrase. That was added for Docker's "Specifications of
one or more certificate signing endpoints", where the prose is the option's
values, but it also matched gcloud's "Expression is a list of one or more
restrictions", which describes the grammar of a single --filter string, and
the latest gcloud regeneration flipped two Filter properties to
IEnumerable<string>.

An article-led predicate ("is a list of", "are the specifications of") now
keeps the alternative from matching; the Docker phrasing is unchanged.

Closes #4718

Claude-Session: https://claude.ai/code/session_01PkLNTUfwGXjqXZrYrHaDGC
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T08:05:55.654577Z 5445563 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 4a5ff832-5f5f-4427-b9cf-08d7ab3d60f3

📥 Commits

Reviewing files that changed from the base of the PR and between 47325d2 and 5445563.

📒 Files selected for processing (2)
  • tools/ModularPipelines.OptionsGenerator/src/ModularPipelines.OptionsGenerator.Tests/Scrapers/Cli/CliScraperTraversalTests.cs
  • tools/ModularPipelines.OptionsGenerator/src/ModularPipelines.OptionsGenerator/Scrapers/Cli/CliScraperBase.cs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Review

This is a small, well-targeted fix to CliScraperBase.RepeatableValueRegex.

Change: the (specifications?|lists?) of (one|zero) or more <noun> repeatability alternative now has a negative lookbehind, (?<!\b(?:is|are|as|be|being)\s+(?:an?|the)\s+), so it no longer fires when preceded by an article-led predicate (is a list of..., are the specifications of...). That matches gcloud's --filter prose ("Expression is a list of one or more restrictions...") that was incorrectly flipping a scalar option to IEnumerable<string>?. Docker's phrasing ("Specifications of one or more certificate signing endpoints"), which has no leading article/verb, is untouched and still matches.

Verified:

  • The regex reasoning holds up manually: is a list, are the lists, as a specifications all fall within the lookbehind and are excluded, while accepts a list of one or more X still matches via the separate accepts?|... alternative, since that phrasing genuinely describes repeatable acceptance.
  • .NET's Regex lookbehind supports variable width (unlike some engines), so the \s+ and article alternation (an?|the) inside the lookbehind are not a validity problem, and the alternation has no nested quantifiers, so there is no realistic ReDoS concern from this addition.
  • Test coverage is appropriately bidirectional: the Docker phrase was added to the existing positive-repeatability parametrized test, and a new test covers both gcloud phrasings (with and without a leading "The"), asserting AcceptsMultipleValues == false and CSharpType == "string?".
  • This is a generic fix in the shared scraper regex rather than gcloud-specific special-casing, consistent with this repo's stated preference for generic generator/scraper fixes over per-tool patches.
  • No prior review threads on this PR raised concerns to address (Codex found nothing; CodeRabbit hit its review-rate limit before commenting).

Note (non-blocking): the heuristic is inherently fuzzy — a hypothetical phrasing like "the value accepted is a list of one or more comma-separated regions, each provided via a separate flag" would now be misclassified as scalar. Given this is prose-heuristic scraping over arbitrary third-party --help text, that trade-off is reasonable and matches how this pattern is already maintained (fixed reactively as real-world false positives surface, as this PR itself does for #4543/#4665). No action needed now.

No blocking issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeatable heuristic misreads "is a list of one or more restrictions" as a repeatable option (gcloud --filter)

1 participant