Skip to content

fix: preserve arrays in generated query flags - #436

Merged
petebacondarwin merged 1 commit into
mainfrom
codex/fix-query-array-flags
Oct 28, 2026
Merged

petebacondarwin merged 1 commit into
mainfrom
codex/fix-query-array-flags

Conversation

@petebacondarwin

Copy link
Copy Markdown
Collaborator

Array query parameters were emitted as scalar string options, so --ids first second failed yargs validation and a single value parsed as a string. Preserve the array type during query argument derivation so the existing builder emits array: true.

  • Regenerate 183 commands, updating 1,279 query flags. Every generated change was checked against its query schema and contains no other semantic changes.
  • Add eight regression cases covering single values, grouped values, repeated flags, required flags, and repeated-key versus comma-separated query serialization.
  • Include a patch changeset and update the generator reference.

Validation: pnpm check and 122 focused generator/API tests pass. The regression tests fail before the fix for single and grouped values.

Addresses the generator issue identified in the review of #430. That OpenAPI update can regenerate its new command with this fix after it lands.

@petebacondarwin
petebacondarwin requested a review from a team as a code owner October 28, 2026 08:37
@pkg-pr-new

pkg-pr-new Bot commented Oct 28, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/cf@436

commit: 46f8238

@ask-bonk

ask-bonk Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@github-actions

Copy link
Copy Markdown
Contributor

cf --help startup

mean stddev min max
PR 223.4 ms 5.0 ms 214.1 ms 232.6 ms
base 219.8 ms 4.3 ms 213.8 ms 229.4 ms

Δ (PR vs base): ↑ +3.5 ms (+1.6%)

Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.

@clanky-the-clanker

Copy link
Copy Markdown

💬 Approved with comments — No issues found: the generator fix is small and covered by tests, and the regenerated output only adds array: true. One INFO note: most regenerated command files were checked by grouping their diff lines rather than read one by one.

Findings: 1 info

The decision is advisory: this comment never approves, blocks or requests changes on the pull request.


📋 Code Quality: 💬 1 info

No defects found; most regenerated files were not read one by one

Recommendation: 💬 Optional Nits

  • [INFO] Most of the ~180 regenerated files under packages/cli/src/commands/_generated/ were not read one by one for correctness. They were checked by grouping their diff lines, which shows only array: true additions and formatting rewraps.
View full review

The args.ts change is narrow and consistent: query params typed array now keep that type, so the builder emits array: true. Grouping the added and removed lines across every regenerated file shows only array: true, additions and Prettier rewrapping of options that grew too long; nothing else changed. The new query-array-flags.test.ts runs a real yargs parse and a real Client fetch. It covers single, grouped and repeated values, a required flag, and both repeated-key and comma-separated serialization.

Coverage: a sample of the regenerated files was read in full, including the generator change, d1/get.ts, magic-cloud-networking/resources/list.ts, security-insights/list.ts, zero-trust/devices/registrations/list.ts, radar/http/ases/get.ts and radar/bgp/ips/timeseries.ts. The other ~175 files under packages/cli/src/commands/_generated/ were checked only by grouping their diff lines.


✅ All other checks passed

🚀 Release: ✅ LGTM

Risk: Low. The patch changeset is appropriate for this fix.


🔒 Security: ✅ LGTM

The change only adds the array type to existing query options. Values still go through the existing request path. No new inputs, endpoints or secrets.


📖 AGENTS.md: ✅ LGTM

The change follows repository conventions: a generator plugin fix plus regenerated output with no hand edits, and a patch changeset for a user-facing fix.


⚡ Performance: ✅ LGTM

No performance concerns.


📝 Documentation: ✅ LGTM

The docs/architecture.md update matches the generator behaviour.


Reviewed commit: 46f8238d

@petebacondarwin
petebacondarwin added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit cc21ffb Oct 28, 2026
12 checks passed
@petebacondarwin
petebacondarwin deleted the codex/fix-query-array-flags branch October 28, 2026 11:45
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.

2 participants