Repository navigation
Conversation
commit: |
|
| mean | stddev | min | max | |
|---|---|---|---|---|
| PR | 260.6 ms | 4.4 ms | 255.9 ms | 272.2 ms |
| base | 262.3 ms | 4.1 ms | 257.0 ms | 270.1 ms |
Δ (PR vs base): ↓ -1.8 ms (-0.7%)
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.
|
🤖 I've done a thorough review of your PR. Adds a parallel MSW/Vitest snapshot suite that records request behavior for the generated and hand-written CLI command surface.
|
|
🤖 I've done a thorough review of your PR. Adds HTTP request regression snapshots across the CLI surface.
|
|
The workflow request guard has two gaps that let required hand-written API calls disappear when baselines are updated.
|
|
Review: 2 findings. 🤖 I've done a thorough review of your PR. Adds HTTP request regression snapshots and CI coverage.
Posted both fixes as GitHub suggestion comments. |
|
The workflow guard needs to check the expected HTTP method as well as the path. The preview snapshot records |
|
🤖 I've done a thorough review of your PR. Adds parallel MSW request snapshots and Linux CI coverage.
|
|
No new concerns since the last review |
There was a problem hiding this comment.
The suite claims alias coverage, but every included invocation uses canonical option names. In particular, cf containers images delete is exercised with --force but never its public -f alias, so a regression in that yargs alias or telemetry alias mapping can be accepted by updating this snapshot. Generate one equivalent case for each OptionMeta.alias (all alias forms are represented, and the current included surface has -f).
| const canonicalCases = [...cases]; | ||
| for (const alias of command.aliases ?? []) { | ||
| for (const scenario of canonicalCases) { | ||
| cases.push({ | ||
| name: `alias ${alias}: ${scenario.name}`, | ||
| args: scenario.args, | ||
| commandPath: [...command.fullPath.slice(0, -1), alias], | ||
| }); | ||
| } | ||
| } |
There was a problem hiding this comment.
| const canonicalCases = [...cases]; | |
| for (const alias of command.aliases ?? []) { | |
| for (const scenario of canonicalCases) { | |
| cases.push({ | |
| name: `alias ${alias}: ${scenario.name}`, | |
| args: scenario.args, | |
| commandPath: [...command.fullPath.slice(0, -1), alias], | |
| }); | |
| } | |
| } | |
| const canonicalCases = [...cases]; | |
| for (const option of options) { | |
| const aliases = | |
| typeof option.alias === "string" | |
| ? [option.alias] | |
| : (option.alias ?? []); | |
| for (const alias of aliases) { | |
| const args = withOptions(matrixBase, [option], source); | |
| const optionIndex = args.findIndex( | |
| (arg) => | |
| arg === `--${option.name}` || | |
| arg.startsWith(`--${option.name}=`) | |
| ); | |
| if (optionIndex >= 0) { | |
| const flag = alias.length === 1 ? `-${alias}` : `--${alias}`; | |
| args[optionIndex] = flag; | |
| cases.push({ name: `alias ${flag}`, args }); | |
| } | |
| } | |
| } | |
| for (const alias of command.aliases ?? []) { | |
| for (const scenario of canonicalCases) { | |
| cases.push({ | |
| name: `alias ${alias}: ${scenario.name}`, | |
| args: scenario.args, | |
| commandPath: [...command.fullPath.slice(0, -1), alias], | |
| }); | |
| } | |
| } |
|
🤖 I've done a thorough review of your PR. Adds HTTP request regression snapshots and CI coverage.
|
|
No new concerns since the last review |
|
LGTM |
Adds a dedicated Vitest + MSW regression suite that runs the real
cfCLI for every generated API command and compares every recorded HTTP request with persisted snapshots. It is intended to catch request changes during large CLI refactors.The suite covers 2,954 generated commands and 1,243 command groups. Each command runs with no arguments and with a large set of argument combinations: required values, individual flags, enum and boolean values, pairwise flag presence, positional alternates, aliases, global options, local mode, body inputs, and file uploads. Snapshots record the method, full URL, headers, JSON or binary body, and ordered multipart parts. Failures name the command, snapshot, changed case, and exact arguments alongside the request diff. Every command must also reach its declared method and endpoint.
Every command listed in
hand-written-commands.jsonis excluded, along with groups that only contain hand-written commands. Those commands orchestrate local projects, external tools such as Docker, SSH and cloudflared, and multi-request workflows, which would need fixtures and fakes outside the scope of this suite. Mock responses are empty success envelopes apart from the zone-name lookup used by--zone <domain>. Local mode keeps request rewriting real and routes Miniflare's requests through MSW.The command cases are split into 12 files balanced by case count. The new
HTTP regressionworkflow runs them as 12 Linux GitHub Actions matrix jobs, one file per job, using Vitest--shard. The small harness tests run with the normal CLI suite on Linux, macOS, and Windows.Generated snapshots make up almost all of the diff and are marked as generated in
.gitattributes.Validation:
pnpm checkpnpm --filter cf test:regression— 4,197 tests passed in 96.17s locallypnpm --filter cf test src/__tests__/regression/harness.test.ts