Add beta feature that uses Reprint for pulls - #4430
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new beta feature that lets the Agentic UI choose between the existing Jetpack-backup–based pull flow and the Reprint streaming pull-reprint flow when pulling a connected site via the CLI, while keeping other surfaces on the Jetpack engine. It also updates pull-reprint to accept --remote-site (URL or WordPress.com site ID), adds overall progress reporting for Reprint pulls, and fixes an engine-switch hang by ensuring the SQLite integration is installed before a Jetpack import on Reprint-pulled sites.
Changes:
- Add a
reprintPullbeta feature and route Agentic UI pulls through eitherpullorpull-reprintbased on that flag. - Update
pull-reprintto use--remote-site(URL or ID) and align source resolution with the shared identifier resolver. - Implement monotonic overall percentage reporting for Reprint pulls and ensure SQLite integration is installed to make engine switching reliable.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/common/types/sync.ts | Introduces the PullEngine type used to select between Jetpack and Reprint pull engines. |
| packages/common/sites/sync.ts | Adds engine selection to pullSite, switching CLI args between pull and pull-reprint. |
| packages/common/sites/sync.test.ts | Adds coverage for default (Jetpack) and Reprint-engine CLI invocation behavior. |
| docs/design-docs/cli.md | Updates CLI design docs to reflect pull-reprint --remote-site <url-or-id> behavior. |
| apps/studio/src/stores/beta-features-slice.ts | Adds reprintPull to the persisted beta-features Redux state defaults. |
| apps/studio/src/modules/sync/lib/ipc-handlers.ts | Routes Agentic UI pull IPC to pull vs pull-reprint based on the reprintPull beta feature. |
| apps/studio/src/modules/site-settings/tests/edit-site-details.test.tsx | Updates test preloaded beta-features state shape to include reprintPull. |
| apps/studio/src/lib/beta-features.ts | Defines the new reprintPull beta feature (label, description, default). |
| apps/studio/src/ipc-types.d.ts | Extends the BetaFeatures type to include reprintPull. |
| apps/studio/src/components/tests/remote-session-indicator.test.tsx | Updates beta-features hook mocks to include reprintPull. |
| apps/studio/src/components/tests/content-tab-settings.test.tsx | Updates test store beta-features state to include reprintPull. |
| apps/cli/lib/pull/pull-progress.ts | Adds Reprint overall-progress banding and (N%) token formatting helpers. |
| apps/cli/lib/pull/pull-progress.test.ts | Tests the overall-percent mapping and token formatting behavior. |
| apps/cli/lib/pull/migration-client.ts | Enhances progress reporting callbacks with per-step fractions (via snapshotFraction). |
| apps/cli/lib/pull/migration-client.test.ts | Adds unit tests for snapshotFraction derivation and fallback behavior. |
| apps/cli/index.ts | Registers pull-reprint unconditionally (removes the env-gate). |
| apps/cli/commands/tests/pull-reprint.test.ts | Updates tests for --remote-site and identifier-based source resolution. |
| apps/cli/commands/pull.ts | Ensures SQLite integration is installed for Reprint-imported sites before Jetpack import. |
| apps/cli/commands/pull-reprint.ts | Switches to --remote-site, uses shared identifier resolution, and emits overall pull percentages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…works on reprint-pulled sites
…print-command # Conflicts: # apps/cli/lib/import-export/import/importers/importer.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated no new comments.
Suppressed comments (1)
apps/cli/commands/pull-reprint.ts:1298
- The comment here says the helper throws when several sites share the hostname, but
findSyncSiteByIdentifiermatches onnormalizeHostname(...)(scheme stripped + trailing slash trimmed) and only throws on multiple matches of that normalized identifier. Updating the comment avoids misleading future changes (e.g. thinking it matches host-only).
// Throws when nothing matches, when several sites share the hostname,
// or when the match isn't syncable.
|
Thank you for working on this @gcsecsey. It works as expected in my testing, and I have one question. What happens if a |
sejas
left a comment
There was a problem hiding this comment.
@gcsecsey , the PR looks great. I tested it in the Agentic UI and worked well. Around 2 minutes to pull my remote site.
This change only affects when pulling from the desktop app right? If so, then we set that expectation in the beta feature description.
pull-with-reprint.mp4
There was a problem hiding this comment.
@gcsecsey , I don't have all the context about Reprint and I'm not sure if it's a known issue, but I found that pulling a site it makes the existing site to have symlinks to the folder ~/.studio/pulls/.....
I also found that mu-plugins/sqlite-database-integration is gone and the site cannot open phpMyAdmin, although the site runs correctly 🤔 .
Maybe this is same issue as STU-2056 or related to WordPress/reprint#334. |
Related issues
How AI was used in this PR
I used Opus 5 to investigate and implement the solution, and GPT 5.6 Sol to do an initial review.
Proposed Changes
Studio can now pull a live site with Reprint instead of Jetpack backups, via a new
Reprint pull enginebeta feature.Currently, only the Agentic UI pulls through the CLI. The Classic UI talks to the WordPress.com REST API straight from the renderer, so it and
apps/localstay on the Jetpack engine.Beyond wiring up the flag:
pull-reprintnow takes--remote-sitenow instead of--url, accepting a site ID as well as a URLpull-reprintrun that failed its preflight was exiting 0. Since the desktop resolves the pull on the child’s exit code alone, the Agentic UI showed “Pull complete” earlier. Failures now exit non-zero and display the reason.STUDIO_ENABLE_PULL_REPRINTenv gate is dropped, the beta feature replaces itpull-reprintis listed instudio --helpfor everyone, including npm installs, for the duration of the beta--options(a Jetpack Backups abstraction STU-1813 decided not to carry over) and--verboseremain unaligned on purpose.Testing Instructions
The point is that the engines stay interchangeable, so these steps pull the same site three times, switching the engine in between:
npm startIf a Reprint pull dies with
cURL error (23): Failed reading the chunked-encoded stream, re-run the same pull, Reprint should resume from its cursor.Here's how the two engines are reporting the status:
Pre-merge Checklist