-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
base: develop
Are you sure you want to change the base?
Conversation
cypress
|
Project |
cypress
|
Branch Review |
ryanm/chore/add_internal_studio
|
Run status |
|
Run duration | 15m 46s |
Commit |
|
Committer | Ryan Manuel |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
1
|
|
28
|
|
0
|
|
762
|
View all changes introduced in this branch ↗︎ |
UI Coverage
62.5%
|
|
---|---|
|
31
|
|
55
|
Accessibility
96.23%
|
|
---|---|
|
0 critical
4 serious
1 moderate
0 minor
|
|
194
|
Co-authored-by: Jennifer Shehane <[email protected]>
await appStudio.setup({ script, studioPath, studioHash }) | ||
|
||
return appStudio | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we type the error here since anything can throw and make sure we pass the right type into createInErrorManager
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our ts rules require any
or unknown
so I'm going to specify any
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on this pattern? 634109a
(#31033)
packages/server/lib/cloud/studio.ts
Outdated
return manager | ||
} | ||
|
||
async setup ({ script, studioPath, studioHash }: { script: string, studioPath: string, studioHash?: string }): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async setup ({ script, studioPath, studioHash }: { script: string, studioPath: string, studioHash?: string }): Promise<void> { | |
setup ({ script, studioPath, studioHash }: { script: string, studioPath: string, studioHash?: string }): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed: 634109a
(#31033)
packages/server/lib/cloud/studio.ts
Outdated
|
||
try { | ||
return this._appStudio[method].apply(this._appStudio, args) | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to above, it is worth typing the error to say something like unknown
to make sure we handle/cast it correctly? It might be overkill if we know what we are dealing with error wise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on this pattern? 634109a
(#31033)
@@ -109,6 +109,16 @@ const getProtocolFileSource = async (protocolFilePath) => { | |||
return fileContents.replaceAll('process.env.CYPRESS_LOCAL_PROTOCOL_PATH', 'undefined') | |||
} | |||
|
|||
const getStudioFileSource = async (studioFilePath) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const getStudioFileSource = async (studioFilePath) => { | |
const getStudioFileSource = async (studioFilePath: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a js file.
@@ -117,6 +127,14 @@ const validateProtocolFile = async (protocolFilePath) => { | |||
} | |||
} | |||
|
|||
const validateStudioFile = async (studioFilePath) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const validateStudioFile = async (studioFilePath) => { | |
const validateStudioFile = async (studioFilePath: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a js file
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:
CYPRESS_ENABLE_CLOUD_STUDIO
andCYPRESS_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 functionalitySteps to test
The best way to test this is to:
cypress-services
repoyarn
yarn watch
inpackages/app-studio
CYPRESS_LOCAL_APP_STUDIO_PATH
to the path to thecypress-services/packages/app-studio/dist/development
directorycypress
repoyarn
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
cypress-documentation
?type definitions
?