Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add logic to dynamically load studio functionality #31033

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

ryanthemanuel
Copy link
Collaborator

@ryanthemanuel ryanthemanuel commented Feb 6, 2025

Additional details

This PR lays the groundwork for being able to dynamically load studio functionality. There are no current functional changes with this PR (which is why it's a chore), but this work will eventually drive updates to the Studio UI, bug fixes for Studio, and AI recommendations for how to modify specs.

This PR:

  • Sets up environment variables (CYPRESS_ENABLE_CLOUD_STUDIO and CYPRESS_LOCAL_APP_STUDIO_PATH) as development placeholders to enable logic that pulls a bundle from the cloud that contains both frontend and backend code that will eventually drive studio functionality
    • The bundle is delivered in a similar manner to protocol code
    • The bundle is signed and verified to ensure no tampering
  • When the bundle is downloaded, it is extracted to a temp directory where the server logic is incorporated into the rest of the existing app server
    • This server logic adds new routes that can then handle front end requests for studio code that will drive the UI
    • These front end files are set up using module federation to allow us to import as normal dependencies and then vite figures out what routes are necessary to load the assets

Steps to test

The best way to test this is to:

  • Clone the cypress-services repo
    • Run yarn
    • Run yarn watch in packages/app-studio
  • Set CYPRESS_LOCAL_APP_STUDIO_PATH to the path to the cypress-services/packages/app-studio/dist/development directory
  • Clone the cypress repo
    • Run yarn
    • Run yarn cypress:open

Then you can open a specific project and should be able to see the console log of Studio loaded as an indication that everything is synced up properly.

How has the user experience changed?

PR Tasks

@ryanthemanuel ryanthemanuel self-assigned this Feb 6, 2025
@ryanthemanuel ryanthemanuel changed the title chore: add logic to dynamically load new studio functionality chore: add logic to dynamically load studio functionality Feb 6, 2025
Copy link

cypress bot commented Feb 6, 2025

cypress    Run #60284

Run Properties:  status check failed Failed #60284  •  git commit 95acc70b58: clean up code
Project cypress
Branch Review ryanm/chore/add_internal_studio
Run status status check failed Failed #60284
Run duration 17m 12s
Commit git commit 95acc70b58: clean up code
Committer Ryan Manuel
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 28
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 761
View all changes introduced in this branch ↗︎
UI Coverage  63.64%
  Untested elements 30  
  Tested elements 56  
Accessibility  96.21%
  Failed rules  0 critical   4 serious   1 moderate   0 minor
  Failed elements 194  

Tests for review

Failed  cypress\e2e\runner\sessions.ui.cy.ts • 1 failed test • app-e2e

View Output

Test Artifacts
runner/cypress sessions.ui.spec > does not save session when validation fails Test Replay Screenshots
Flakiness  cypress\e2e\specs_list_actual_git_repo.cy.ts • 1 flaky test • app-e2e

View Output

Test Artifacts
Spec List - Last updated with git info > shows correct git icons Test Replay Screenshots

@ryanthemanuel ryanthemanuel requested a review from mschile February 7, 2025 16:05
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