Skip to content

Enable async mirror creation by default - #2246

Merged
pfleidi merged 4 commits into
mainfrom
pfleidi/cor-1430-cli-enable-async-mirror-creation-by-default
Sep 3, 2026
Merged

Enable async mirror creation by default#2246
pfleidi merged 4 commits into
mainfrom
pfleidi/cor-1430-cli-enable-async-mirror-creation-by-default

Conversation

@pfleidi

@pfleidi pfleidi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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

Why

COR-1185 (CLI: submit mirror creates through the async mirror-request routes) added asynchronous mirror creation behind a default-off layered setting. This draft prepares the separate default flip so normal CLI mirror creation uses that route once the production merge gates are complete.

What changed

Merged settings now default async_mirror_requests to true, while an explicit false in either settings layer still selects the synchronous route. Command help describes the default, opt-out, and the existing mode-specific --wait-timeout behavior.

Usage examples

entire repo mirror create github.com/example/repository

The command uses the asynchronous request route by default. To opt out in a settings layer:

{
  "async_mirror_requests": false
}

Decisions made during development

  • The synchronous route and layered opt-out remain available in this change.
  • Timeout behavior stays mode-specific: asynchronous mode uses one deadline across submission, placement, and clone readiness; synchronous mode applies the timeout only to clone-readiness polling.

Technical tradeoffs

The layered value is tri-state: an absent value uses the asynchronous route by default, while explicit true and false values remain serializable overrides. This keeps unrelated settings writes from materializing an override or erasing a synchronous opt-out.

Reviewer notes

This PR must remain a draft and must not merge until both dependencies are complete:

Recording the released CLI version and updating the changelog are release-time work and intentionally remain outside this PR.


Note

Medium Risk
Changes default mirror-creation API behavior for all users without an explicit sync opt-out; incorrect defaults could route production traffic to async endpoints before backend gates are ready (per PR merge dependencies).

Overview
entire repo mirror create now uses the asynchronous mirror-request API by default. Layered settings can still opt out with "async_mirror_requests": false; unset or true keeps async behavior.

The async_mirror_requests setting is tri-state (*bool): missing keys no longer imply sync, and save/merge preserves whether the key was explicitly set so unrelated writes do not clobber overrides. IsAsyncMirrorRequestsEnabled() encodes the default-on rule.

Help and --wait-timeout usage document the default route and that async mode applies one deadline across submission, placement, and clone readiness (sync mode only to clone polling).

Tests cover async when settings fail to load, explicit sync opt-out, layered load/save, and flag help text.

Reviewed by Cursor Bugbot for commit 551735f. Configure here.

Default merged settings to the asynchronous request route while preserving explicit false overrides for the synchronous path.

Document the route default and the mode-specific wait timeout semantics in command help.

Entire-Checkpoint: 01M1FSQK3B70FDR8PNTVG8NRV8
Copilot AI lite review requested due to automatic review settings September 2, 2026 21:11
@pfleidi

pfleidi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot run

@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 d6990ae. Configure here.

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.

🔵 Needs a closer look

It changes the default control-plane route used for mirror creation and is explicitly gated on external production validation/dependencies.

Pull request overview

This PR flips entire repo mirror create to use the async mirror-request API route by default (while preserving an explicit layered opt-out via async_mirror_requests: false), and updates command/help text plus tests to match.

Changes:

  • Default async_mirror_requests to true at merged settings load time (not per-file parsing) while still honoring explicit false in either settings layer.
  • Document the new default and clarify --wait-timeout semantics for async vs synchronous mode.
  • Add/adjust unit tests to cover async-by-default and synchronous opt-out behavior.
File summaries
File Description
cmd/entire/cli/settings/settings.go Defaults AsyncMirrorRequests to true when merging layers via a new loadFromFileWithDefaults helper.
cmd/entire/cli/settings/settings_test.go Updates layered-settings tests to assert async is true when unset and false when explicitly disabled.
cmd/entire/cli/repo_mirror.go Updates mirror create help text and expands --wait-timeout usage to describe mode-specific behavior.
cmd/entire/cli/repo_mirror_test.go Adds a test that validates the updated --wait-timeout help text.
cmd/entire/cli/repo_mirror_request_test.go Renames/updates tests to cover async-by-default and adds a synchronous opt-out test.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Represent the layered setting as an optional boolean so an absent value can resolve to async without losing an explicit false during settings rewrites.\n\nRoute mirror creation through a default-resolving accessor and cover all three serialized states.

Entire-Checkpoint: 01M1J2T50K1SZ7J7MGTEZDXSVS
@pfleidi
pfleidi requested a lite review from Copilot September 2, 2026 22:22
@pfleidi

pfleidi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot run

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.

🟡 Changes recommended

Mirror creation can still default to the synchronous route when settings fail to load because mirrorCreateOptions.async is initialized as false.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread cmd/entire/cli/repo_mirror.go

@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 ec294a2. Configure here.

Initialize mirror creation with the shipped asynchronous default before applying a successfully loaded setting. This prevents malformed settings from silently selecting the synchronous route while preserving explicit opt-out behavior.

Entire-Checkpoint: 01M1J4N2NYA0KCD7TSFQHJNWS5
@pfleidi

pfleidi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot run

@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 551735f. Configure here.

@pfleidi
pfleidi marked this pull request as ready for review September 2, 2026 23:10
@pfleidi
pfleidi requested a review from a team as a code owner September 2, 2026 23:10
@pfleidi
pfleidi merged commit eba4829 into main Sep 3, 2026
14 checks passed
@pfleidi
pfleidi deleted the pfleidi/cor-1430-cli-enable-async-mirror-creation-by-default branch September 3, 2026 17:52
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