Skip to content

chore(coreapi): refresh OpenAPI spec and regenerate client#1518

Open
toothbrush wants to merge 18 commits into
mainfrom
chore/refresh-openapi-spec
Open

chore(coreapi): refresh OpenAPI spec and regenerate client#1518
toothbrush wants to merge 18 commits into
mainfrom
chore/refresh-openapi-spec

Conversation

@toothbrush

@toothbrush toothbrush commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

https://entire.io/gh/entireio/cli/trails/659

Re-pulled the upstream Core API spec and regenerated the ogen client (no hand edits). Only API change: mirror schema gains a status field (processing/ready/failed/suspended); rest is mechanical regen.

🤖 Generated with Claude Code


Note

Low Risk
Generated client and optional API field only; no server or auth logic changes in this diff.

Overview
Refreshes the Core API OpenAPI spec and ogen-generated client so Mirror responses can include an optional status field describing clone lifecycle: processing, ready, failed, or suspended.

The change adds MirrorStatus, OptMirrorStatus, JSON encode/decode, and schema validation on Mirror (and per-item validation in ListMirrorsOutputBody). One list/get mirror response path now runs Validate() after decode. Aside from the new status property in the spec, the rest is mechanical regeneration.

Reviewed by Cursor Bugbot for commit a6e8035. Configure here.

Re-pull upstream spec and regenerate. Adds mirror `status` field
(processing/ready/failed/suspended). Generated changes only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: d160d74ef29b
Copilot AI review requested due to automatic review settings June 25, 2026 02:03
@toothbrush toothbrush requested a review from a team as a code owner June 25, 2026 02:03

Copilot AI left a comment

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.

Pull request overview

Refreshes the upstream Core API OpenAPI specification and regenerates the ogen-based Go client to reflect a single API surface change: Mirror responses can now include an optional status field describing clone lifecycle.

Changes:

  • Updated Core API OpenAPI spec + derived JSON schema to add Mirror.status (processing/ready/failed/suspended).
  • Regenerated ogen client types/JSON codec to include MirrorStatus + OptMirrorStatus and encode/decode support.
  • Regenerated validators/decoders so mirror list/get responses validate status values when present.

Reviewed changes

Copilot reviewed 1 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/coreapi/spec/core.openapi.json Upstream OpenAPI refresh; Mirror schema gains optional status enum.
internal/coreapi/spec/core.gen.json Generated JSON schema updated to include Mirror.status.
internal/coreapi/oas_validators_gen.go Adds MirrorStatus validation and validates Mirror items within ListMirrorsOutputBody.
internal/coreapi/oas_schemas_gen.go Adds MirrorStatus/OptMirrorStatus types and the new Mirror.Status field.
internal/coreapi/oas_response_decoders_gen.go Ensures getMirror response is validated after decode (consistent with other validated responses).
internal/coreapi/oas_json_gen.go Adds JSON encode/decode support for Mirror.status and the new enum/optional types.
Files not reviewed (4)
  • internal/coreapi/oas_json_gen.go: Generated file
  • internal/coreapi/oas_response_decoders_gen.go: Generated file
  • internal/coreapi/oas_schemas_gen.go: Generated file
  • internal/coreapi/oas_validators_gen.go: Generated file

toothbrush and others added 12 commits June 25, 2026 11:38
Run `entire repo mirror create` with no args to onboard repos interactively:
verifies auth, multi-select repos to mirror, multi-select regions, then creates
every (repo, region) mirror in parallel and prints the clone URLs. The
positional `create <github-url> [cluster-host]` form is unchanged.

Regions come from entire-core's GET /api/v1/clusters (ListClusters). The
endpoint isn't deployed yet, so the /clusters spec fragment is hand-authored
into core.openapi.json and the ogen client regenerated; a real spec refresh is
idempotent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: ee0c83e58bfc
Display "Fetching available repos" and "Fetching regions" spinners before each
picker so the network pause isn't a blank screen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: d5dc5f40492b
Switch both `repo mirror create <url>` and the onboarding wizard onto one shared
createAndAwaitMirror path that polls GetMirror for the new Mirror.status
(processing/ready/failed/suspended) instead of the smart-HTTP info/refs probe.
This drops the repo-scoped token dance and data-plane round trip; suspension and
clone failure now surface directly from the control plane.

Removes the now-dead info/refs probe machinery (waitForMirrorClone,
mirrorAdvertisesHead, checkProbeRedirect, the probe HTTP client and token
source) and their tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 94e331061b08
`entire repo mirror create github.com/octocat/hello-world` (no cluster-host) now
resolves the target from GET /api/v1/clusters — the is_default cluster (or the
sole one) — instead of the hardcoded constant, matching the wizard. Prints the
chosen cluster; errors asking for an explicit [cluster-host] when the catalog is
empty or has no clear default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: cfcf2050076d
Prints the active control-plane bearer to stdout so curl/scripts can auth
without digging the JWT out of the keychain:

  curl -H "Authorization: Bearer $(entire auth token)" "$CORE/api/v1/clusters"

Honors ENTIRE_TOKEN verbatim, else resolves and refreshes the active context's
login JWT (same bearer the API client uses). Hidden; errors and the
not-logged-in hint go to stderr so stdout stays clean for command substitution.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: c9e38d421945
is_default is per-jurisdiction (each of au/eu/us has its own default), so the
single hardcoded "first default" was wrong. Resolve the caller's jurisdiction
from /me and:

- one-shot `repo mirror create <url>` (no cluster-host): pick the is_default
  cluster for that jurisdiction;
- wizard: still list every cluster (so you can mirror into any), but pre-select
  only your jurisdiction's default instead of all three.

Errors asking for an explicit [cluster-host] when the jurisdiction is unknown or
has no default. Surfaces the jurisdiction in the wizard's "Signed in as" line.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: a03b61382aa9
Revert the one-shot `repo mirror create <url>` to the fixed defaultClusterHost
when [cluster-host] is omitted; catalog/jurisdiction-based cluster guessing is
now confined to the no-args interactive wizard, so non-interactive invocations
(and scripts) keep stable, predictable defaults. remove/collaborators were
already on the fixed default and are unchanged.

Drops the one-shot-only resolveDefaultClusterHost/callerJurisdiction/
pickDefaultRegionHost helpers; the wizard keeps its jurisdiction-aware region
pre-selection.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: a03599d356ff
The region multi-select already lists every cluster, but on a short terminal
huh's scrollable viewport shows only the top rows — so the pre-checked default
(the caller's jurisdiction) could sit below the fold, making it look like one
unrelated option. List the caller's-jurisdiction clusters first so the visible
top row is the relevant, pre-selected default; trim the description to reclaim a
row. Other jurisdictions remain selectable by scrolling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 27ad338c331d
huh sizes an unset multi-select height to (rendered option lines − title/
description rows), so a short list (3 regions) collapsed to ~1 visible row while
a long repo list looked fine. Set an explicit Height = option count + header
slack on both pickers so every option is visible (still scrolls past the
terminal). Region picker is no longer stuck showing one option at a time.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 6e993f6cd3aa
Replace the single "Creating N mirror(s)…" spinner with one live line per
(repo, region), each updating independently as its CreateMirror + clone poll
advance (processing → ready), then the existing summary table. Lines read
"owner/repo @ <cluster-host>  <spinner|✓|✗> <status>". A per-poll status
callback now flows through awaitMirrorReady/createAndAwaitMirror (one-shot
passes nil and keeps its single spinner). Non-TTY degrades to one printed line
per mirror as it finalizes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 18dbd0a73461
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 4477af226732
toothbrush and others added 5 commits June 25, 2026 13:40
- Wizard: gate on an interactive terminal with a clear pointer at the
  non-interactive form; run the pickers via RunWithContext so Ctrl+C/ctx
  cancellation is handled cleanly (Cursor).
- Wizard: a cancelled run no longer reports in-flight mirrors as failures —
  exit quietly (Cursor).
- createAndAwaitMirror: restore the suspension check for an existing empty
  placement (one GetMirror) so suspended empties surface resume guidance
  instead of a benign "nothing to clone" (Cursor).
- Wizard: suspended/failed results now carry the mirror id + resume command in
  the failure summary, matching the one-shot (Copilot).
- auth token: enforce HTTPS on the core URL unless --insecure-http-auth, like
  auth status (Copilot).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: e2c7535c9951
- handleFormCancellation: also treat a cancelled/expired context as a clean
  cancel, so a RunWithContext form whose context is cancelled exits quietly
  instead of "prompt failed: huh: context canceled" (Cursor).
- Drop internal terminology from suspended/failed user messages: the wizard now
  says "the mirror is suspended; contact support" / "the initial clone failed;
  contact support", and explainSuspendedMirror points at support instead of the
  internal `entire-core admin mirrors resume` command (Cursor).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 9ea51e10ee42
awaitMirrorReady previously aborted the whole wait on any GetMirror error, so a
brief network/API glitch during a long initial clone failed mirror create even
though the clone was still progressing. Retry on the poll interval, giving up
only after maxConsecutivePollErrors consecutive failures (resets on success) or
when the context ends — a persistent error (deleted mirror, revoked auth) still
surfaces instead of spinning to the deadline. (Cursor)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 5d285b69feaf
hostFromPublicURL rejected any non-empty path, so a catalog entry like
https://aws-us-east-2.entire.io/ (Path == "/") was dropped in clustersToRegions
— silently removing clusters and risking "no regions available to mirror into"
if the control plane emits trailing slashes. publicUrl is a trusted catalog
field, so accept a bare "/" path; real paths/queries/fragments/userinfo are
still refused. (Trail review)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 32af87a69f30
…arding-flow

Smooth mirror onboarding: `entire repo mirror create` wizard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants