Point CLI Reprint provisioning at the v1/v2-aware export endpoints (STU-1929) - #4375
Merged
Merged
Conversation
gcsecsey
requested review from
Copilot and
epeicher
and removed request for
Copilot
July 29, 2026 10:45
gcsecsey
marked this pull request as ready for review
July 29, 2026 11:07
epeicher
approved these changes
Jul 29, 2026
epeicher
left a comment
Contributor
There was a problem hiding this comment.
Thanks for adding functionality for the new endpoints @gcsecsey! I have tested with the new endpoints by using a Pressable site wth the Jetpack changes Automattic/jetpack#50369, and testing existing endpoints by using an existing Atomic site. Both pulls have worked as expected by using the current production reprint.phar. Changes also LGTM!
| Pressable wp-admin | Pressable site | Local pulled wp-admin | Local pulled site | CLI command output | Existing Atomic sit CLI output |
|---|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Collaborator
📊 Performance Test ResultsComparing 23c4e8a vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Related issues
How AI was used in this PR
I used Claude to investigate the issue, trace the pull-reprint provisioning flow, mirror the reference PHP client, and implement the changes and write the tests. I reviewed and validated the messaging and the logic myself.
Proposed Changes
In Automattic/jetpack#50369 we added new Jetpack-hosted export endpoints, which Reprint clients must probe for, and use these or fall back to the wpcomsh v1 endpoints.
This PR adds support for this:
enable-exportendpoint once and falls back to v1 on a 404. The detected surface is decided in one place and drives both the secret rotation route and the importer query var (?reprint-api-jetpackfor v2,?reprint-apifor v1), which is why the probe had to move ahead of URL construction and secret rotation.Testing Instructions
Automated:
npm test -- apps/cli/lib/tests/api.test.ts apps/cli/commands/tests/pull-reprint.test.tsand confirm all pass. New cases cover the v2 probe succeeding, the v2 404 falling back to v1 (via an inner rest_no_route body and a direct 404), and both secret shapes.npm run typecheckand confirm it is clean.v2 end-to-end (needs Automattic/jetpack#50369 on the source site):
Build, then pull the v2 source into a fresh throwaway local site:
Then confirm:
[enableReprintExporter] Site <id> supports v2 export (enable-export returned 200), and the reprint command line streams from...?reprint-api-jetpack.node apps/cli/dist/cli/main.mjs site start --path ~/Studio/reprint-v2-testand browse it to verify the source content arrived.I tested with a staging Pressable site: