Skip to content

Conversation

@fredrikekelund
Copy link
Contributor

Related issues

N/A

Proposed Changes

We've been using dev/studio-cli-i2 as a base branch for the Studio CLI i2 project since ~Dec 8. This PR merges all changes from that branch to trunk.

Testing Instructions

All PRs have been tested individually. We simply expect CI to pass for this PR.

Pre-merge Checklist

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

fredrikekelund and others added 20 commits December 8, 2025 09:11
…2210)

* Resolve and untildify `--blueprint` option for `studio site create`

* Support fetching blueprints over HTTP
* Don't support `--version` option on commands

* Update version
* WIP: `studio wp` command

* Pass all options to WP-CLI

* WIP

* New strategy: use Playground CLI to run WP-CLI

* Cleanup

* Working legacy solution

* Playground again

* Don't assign port

* Improve argv parsing

* Finally, a working command

* Simplify

* Run with configured PHP version

* Pass command to existing instance if server is running

* Comments

* Tweaks

* No `shell` support

* Remove unused function

* Remove browser-globals polyfills and patch

* Address review comments

* Minimize impact on argv
* Implement `studio site set-wp-version` command

* process.exit

* Use `ValidationError`

* Set `isWpAutoUpdating` and not `wpVersion`

* Fix test
* WIP: Support reading resources in blueprints

* Tie it all together

* Add todo comment
* refactor studio to use cli for wp cli

* wp cli

* Refactor theme details to use WP-CLI command via mu-plugin

* Refactor WP-CLI output capture to read directly from stdout/stderr

* Address PR review feedback

* build cli postinstall

* Revert "build cli postinstall"

This reverts commit 75830fd.

* Wait for start operation to resolve before executing WP-CLI

* Streaming output and additional safety

* Disable child process execution altogether

---------

Co-authored-by: Fredrik Rombach Ekelund <[email protected]>
@fredrikekelund fredrikekelund requested review from a team, bcotrim and nightnei December 16, 2025 09:03
@fredrikekelund fredrikekelund self-assigned this Dec 16, 2025
@fredrikekelund
Copy link
Contributor Author

I'm working on fixing the E2E tests before we merge this PR

@fredrikekelund
Copy link
Contributor Author

The E2E tests should pass now, so this PR is good to review. cc @bcotrim @nightnei

@fredrikekelund
Copy link
Contributor Author

I've modified .buildkite/commands/run-e2e-tests.sh to run only a single test, to help us narrow down why the E2E tests are still failing.

@fredrikekelund
Copy link
Contributor Author

@nightnei and I have concluded that the tests get stuck on this screen:

image

This is the NoStudioSites component, but we expected the site to render Onboarding. This is the relevant source code:

{ needsOnboarding ? <Onboarding /> : <NoStudioSites /> }

Now we just need to determine why needsOnboarding has an unexpected value when CI runs the E2E tests.

@bcotrim
Copy link
Contributor

bcotrim commented Dec 16, 2025

@nightnei and I have concluded that the tests get stuck on this screen:
image

This is the NoStudioSites component, but we expected the site to render Onboarding. This is the relevant source code:

{ needsOnboarding ? <Onboarding /> : <NoStudioSites /> }

Now we just need to determine why needsOnboarding has an unexpected value when CI runs the E2E tests.

My guess is that the initial site creation failed and as we cleanup the site from appdata it gets back to this step.

@nightnei
Copy link
Contributor

nightnei commented Dec 16, 2025

@fredrikekelund I was reading codebase and here are my observations - we run expect(site-content)... always only after completeOnboarding, what means that the flow definitely already went through:
1.1. Skip → - so needsOnboarding can't be the culprit
1.2. Also we had modal.siteNameInput.fill( customSiteName ) and other steps, but as we see the test is stuck on the screen to choose button "Create a site". So I tested the flow with:

diff --git a/src/hooks/use-site-details.tsx b/src/hooks/use-site-details.tsx
index cb2ab8ad..73bd7417 100644
--- a/src/hooks/use-site-details.tsx
+++ b/src/hooks/use-site-details.tsx
@@ -291,6 +291,7 @@ export function SiteDetailsProvider( { children }: SiteDetailsProviderProps ) {
 
                        let newSite: SiteDetails;
                        try {
+                               qqq+www;
                                newSite = await getIpcApi().createSite( path, {
                                        siteName,
                                        wpVersion,

I as a result I got error and got the screen with chosing "Create a site" and other buttons.
So my assumption is - maybe we need to install some package or do other configurations for CI? Probably the issue is around pm2 or some tool/configuration.

@nightnei
Copy link
Contributor

nightnei commented Dec 16, 2025

@bcotrim yeah, you are compleytelly right, I just wrote the summary of my investagation above :)
I think that the best next step would be if you take a look at CLI command to create a site and think - what we missed to install/configure for CI? And also - why teh error is muted and we didn't get it in logs of tests. Maybe it was muted in this try/catch (src/hooks/use-site-details.tsx), since we don't throw teh error to teh upper level, however we do console inside the catch...

dependabot bot and others added 6 commits December 17, 2025 11:07
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ing (#2257)

* Improve update dialogs with clearer messaging and safer ESC key handling

* Adjust wording and formatting
@fredrikekelund
Copy link
Contributor Author

After much hair-tearing, we finally narrowed down the problem to the fact that Studio and the CLI resolved the server-files directory differently in the E2E context. I've fixed the issue and confirmed that the E2E tests should pass now.

Copy link
Contributor

@nightnei nightnei left a comment

Choose a reason for hiding this comment

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

❤️

@fredrikekelund
Copy link
Contributor Author

The E2E tests have passed on macOS, so I'll go ahead and merge this

@fredrikekelund fredrikekelund merged commit 80f46b7 into trunk Dec 17, 2025
7 of 9 checks passed
@fredrikekelund fredrikekelund deleted the dev/studio-cli-i2 branch December 17, 2025 10:28
@fredrikekelund fredrikekelund restored the dev/studio-cli-i2 branch December 18, 2025 14:27
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.

5 participants