Skip to content

WC-6122 Prepare Preview group for generated API commands - #142

Draft
GregBrimble wants to merge 2 commits into
mainfrom
WC-6122-previews-delete
Draft

GregBrimble wants to merge 2 commits into
mainfrom
WC-6122-previews-delete

Conversation

@GregBrimble

@GregBrimble GregBrimble commented Sep 30, 2026 •

Copy link
Copy Markdown

Move cf previews deploy into a generated command group that the local registry creates when OpenAPI does not provide it. Future schema updates can add Preview API leaves to that same group without a root collision.

This is prerequisite work only: the schema pin is unchanged and the generated group currently contains only deploy. Merge this before publishing the schema change, so an independent pin bump is safe for group registration; DELETE output and invocation tests belong to that later bump.

Validation: normal generation/build with the existing pin, typecheck, lint, formatting, and 60 focused tests passed. A separate proposed-schema generation check produced exactly delete + deploy without changing checked-in output.

Precedence tests cover schema-root preservation, fallback creation, added-leaf collisions and coexistence, explicit hand-written leaf overrides, and parent description/visibility overrides.

import type { SdkQuery, SdkRequest } from "#sdk";
/**
* delete command
* @generated from apis/overlays/previews.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated Preview tree cannot survive the repository's canonical generation yet. generate.ts still pins Forge OpenAPI b7b98182e1e2a02a7e350ec6010a61a7af68cbef, while this PR supplies neither its Forge/OpenAPI update nor a generator source change; generation calls finalize(..., { clean: true }), so it replaces this hand-staged previews/ output. Update the published Forge/OpenAPI pin (and matching SDK when required), then run the normal generation before merging so the command, metadata, and tests remain present after CI regenerates the tree.

@ask-bonk

ask-bonk Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Review: 1 findings.

🤖 I've done a thorough review of your PR.
Adds generated Preview deletion and moves Preview deployment beneath that root.

  1. Blocking: 1 inline finding posted.

github run

Comment thread .changeset/previews-delete.md Outdated
"cf": minor
---

Add `cf previews delete <name> --worker <worker>` to delete a Worker Preview through the generated API command tree. Use `--force` to skip confirmation and `--force-delete` to delete a Preview that is still referenced.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release note still advertises --force-delete, but the generated command exposes --delete-with-references (and the follow-up test/metadata were renamed accordingly). Publishing this would direct users to an unknown option.

Suggested change
Add `cf previews delete <name> --worker <worker>` to delete a Worker Preview through the generated API command tree. Use `--force` to skip confirmation and `--force-delete` to delete a Preview that is still referenced.
Add `cf previews delete <name> --worker <worker>` to delete a Worker Preview through the generated API command tree. Use `--force` to skip confirmation and `--delete-with-references` to delete a Preview that is still referenced.

@ask-bonk

ask-bonk Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

🤖 I've done a thorough review of your PR.

Adds generated Preview deletion and moves deployment beneath the generated root.

  1. Release note documents obsolete --force-delete; inline suggestion posted to use --delete-with-references.

github run

@GregBrimble
GregBrimble force-pushed the WC-6122-previews-delete branch from 26f0933 to 3555080 Compare October 2, 2026 12:39
@GregBrimble GregBrimble changed the title WC-6122 Add generated Preview deletion command WC-6122 Prepare Preview group for generated API commands Oct 2, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 2, 2026 •

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

commit: 70159e0

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

cf --help startup

mean stddev min max
PR 330.4 ms 6.0 ms 323.8 ms 350.0 ms
base 332.3 ms 7.9 ms 321.3 ms 348.9 ms

Δ (PR vs base): ↓ -1.8 ms (-0.5%)

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.


builder: (yargs) => {
return yargs
.command($deploy)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This root only imports and registers the hand-written deploy leaf, so the advertised cf previews delete <name> --worker <worker> command is not present in this PR. Restore the published Forge CLI annotations in the pinned OpenAPI revision and regenerate the SDK/CLI so this index, metadata, and tests contain the generated deletion leaf; otherwise the change ships only a regrouped deployment workflow.

@ask-bonk

ask-bonk Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🤖 I've done a thorough review of your PR.

Adds a synthetic generated previews root and moves Preview deployment beneath it.

  1. Blocking: The advertised cf previews delete command is not generated or registered. Posted an inline review comment.

github run

@ask-bonk

ask-bonk Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

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.

1 participant