Skip to content

Route the Agentic UI pull through pull-reprint behind a beta feature (STU-1815) - #4430

Draft
gcsecsey wants to merge 3 commits into
trunkfrom
gcsecsey/use-pull-reprint-command
Draft

Route the Agentic UI pull through pull-reprint behind a beta feature (STU-1815)#4430
gcsecsey wants to merge 3 commits into
trunkfrom
gcsecsey/use-pull-reprint-command

Conversation

@gcsecsey

@gcsecsey gcsecsey commented Aug 4, 2026

Copy link
Copy Markdown
Member

Related issues

How AI was used in this PR

Claude traced both pull paths, made the changes, and ran the tests. It also drove the CLI end-to-end against a real WordPress.com staging site to confirm the renamed option and numeric-ID resolution work outside of unit tests. I reviewed the changes and made the design calls.

Proposed Changes

🚧 Draft — this is the first slice of STU-1815. Studio-side routing and the beta feature come next.

For the Reprint beta, Studio needs to invoke either pull or pull-reprint for the same user action. That's awkward today because the two commands name the same concept differently: pull (and push) take --remote-site, while pull-reprint takes --url. This aligns them so the caller doesn't have to special-case the engine.

The rename turned out to be the smaller half. pull-reprint carried its own matcher, findMatchingWpComSite, whose docblock asserted that no existing Studio helper did the job — but findSyncSiteByIdentifier already did, and both pull and push use it. Switching over deletes the private matcher and makes the two options identical in shape rather than just in name: both now accept a site URL or a numeric WordPress.com site ID.

Two user-visible consequences, both bringing pull-reprint in line with pull:

  1. An unmatched source now reports No site found matching "…" instead of reprint-specific wording.
  2. An ambiguous hostname now errors with a prompt to use the site ID, rather than silently picking the first match. This is a real case — a WordPress.com account can hold both a production site and its staging sibling with confusingly similar URLs.

pull-reprint also no longer hides behind the STUDIO_ENABLE_PULL_REPRINT environment variable. The Studio beta feature will be the gate from here on, so the env var was redundant. Note this makes the command visible in studio --help for everyone, including npm installs, for the duration of the beta.

--options (a Jetpack Backups abstraction that STU-1813 decided not to carry over) and --verbose remain unaligned on purpose.

Testing Instructions

  1. npm run cli:build
  2. npm test -- apps/cli/commands/tests/pull-reprint.test.ts — 37 pass.
  3. npm run typecheck — clean.
  4. Confirm the option now matches across commands, with no env var set:
    node apps/cli/dist/cli/main.mjs pull --help
    node apps/cli/dist/cli/main.mjs pull-reprint --help
    
    Both should show --remote-site Remote site URL or ID [string], and pull-reprint should be listed in studio --help.
  5. Against a connected WordPress.com site, verify both identifier forms resolve:
    node apps/cli/dist/cli/main.mjs site create --path ~/Studio/reprint-id-test --name reprint-id-test --start=false
    node apps/cli/dist/cli/main.mjs pull-reprint --path ~/Studio/reprint-id-test --remote-site <numeric-site-id>
    
    Then start the site and confirm the source content arrived.

Note: the full apps/cli suite reports failures in commands/site/tests/*.e2e.test.ts under parallel load. Those are pre-existing — clean trunk fails the same files, and they pass when run individually.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@gcsecsey gcsecsey changed the title Align pull-reprint's remote source option with pull's --remote-site (STU-1815) Route the Agentic UI pull through pull-reprint behind a beta feature (STU-1815) Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant