Skip to content

feat(mirror): cluster picker for interactive one-shot mirror create#1645

Merged
toothbrush merged 2 commits into
mainfrom
feat/mirror-create-one-shot-cluster-picker
Jul 6, 2026
Merged

feat(mirror): cluster picker for interactive one-shot mirror create#1645
toothbrush merged 2 commits into
mainfrom
feat/mirror-create-one-shot-cluster-picker

Conversation

@toothbrush

@toothbrush toothbrush commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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

entire repo mirror create owner/repo on a terminal now offers the available clusters as a picker when [cluster-host] is omitted — pre-selecting your jurisdiction's default, and skipping the prompt when only one cluster exists (same shape as entire repo clone).

Non-interactive runs are unchanged: fixed default aws-us-east-2.entire.io, no network lookup, so scripts stay stable.

Restores the interactive half of what #1519 walked back, without reintroducing catalog guessing for scripts.

🤖 Generated with Claude Code


Note

Low Risk
CLI UX and cluster selection only; explicit cluster args and non-interactive defaults are preserved, with no auth or mirror API behavior changes.

Overview
When entire repo mirror create <github-url> runs without [cluster-host], an interactive terminal now loads clusters from the control plane and picks one (single-select, jurisdiction default pre-selected, prompt skipped if only one cluster)—aligned with entire repo clone.

Non-interactive use is unchanged: aws-us-east-2.entire.io with no catalog fetch. Explicit [cluster-host] still wins. resolveOneShotClusterHost / pickOneCluster handle fetch, auto-pick, and cancel guards; a test locks the script path.

Reviewed by Cursor Bugbot for commit cbffb79. Configure here.

When `repo mirror create <github-url>` is run on a terminal without a
[cluster-host], fetch the control plane's cluster catalog and offer it as a
single-select — pre-selecting the caller's jurisdiction default, and skipping
the prompt entirely when only one cluster exists (the same
prompt-only-when-there-is-a-choice shape as `repo clone`). Non-interactive
invocations keep the fixed defaultClusterHost so scripts stay stable and
offline-resolvable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Entire-Checkpoint: 573bbdeb391d
@toothbrush toothbrush requested a review from a team as a code owner July 6, 2026 04:08
Copilot AI review requested due to automatic review settings July 6, 2026 04:08

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

This PR restores interactive cluster selection for the one-shot entire repo mirror create <github-url> flow when [cluster-host] is omitted, matching the “prompt only when there’s a choice” behavior used elsewhere (while preserving the stable non-interactive default for scripts).

Changes:

  • Added resolveOneShotClusterHost / pickOneCluster to prompt for a cluster in interactive terminals (auto-selecting when only one cluster exists).
  • Updated repo mirror create help text and argument handling to use the new interactive cluster resolution when appropriate.
  • Added a unit test to lock in the non-interactive behavior (no catalog lookup; fixed defaultClusterHost).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cmd/entire/cli/repo_mirror.go Routes one-shot create’s omitted [cluster-host] through interactive cluster resolution; updates help text.
cmd/entire/cli/repo_mirror_test.go Adds a regression test ensuring non-interactive runs keep the fixed default cluster host without dialing the control plane.
cmd/entire/cli/repo_mirror_create_wizard.go Implements interactive one-shot cluster resolution via catalog lookup + single-select picker.

Comment thread cmd/entire/cli/repo_mirror_create_wizard.go
Match repo clone's picker: an off-list or zero-value selection now exits as a
clean cancel instead of surfacing a misleading "invalid [cluster-host]" error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Entire-Checkpoint: 0a9d965f7a2a
@toothbrush

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit cbffb79. Configure here.

@toothbrush toothbrush merged commit 111649e into main Jul 6, 2026
11 checks passed
@toothbrush toothbrush deleted the feat/mirror-create-one-shot-cluster-picker branch July 6, 2026 05:02
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