-
Notifications
You must be signed in to change notification settings - Fork 3.3k
chore: cy prompt infrastructure #31748
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
base: feat/cy-prompt
Are you sure you want to change the base?
Conversation
cypress
|
Project |
cypress
|
Branch Review |
ryanm/feat/cy-prompt-infra
|
Run status |
|
Run duration | 19m 45s |
Commit |
|
Committer | Ryan Manuel |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
10
|
|
1232
|
|
0
|
|
32164
|
View all changes introduced in this branch ↗︎ |
UI Coverage
45.56%
|
|
---|---|
|
191
|
|
164
|
Accessibility
92.73%
|
|
---|---|
|
3 critical
9 serious
2 moderate
2 minor
|
|
696
|
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.
Pull Request Overview
This PR provides the foundational infrastructure for the new cy.prompt()
command by pulling down, verifying, and loading a remotely hosted bundle, wiring in lifecycle managers, and enabling the experimental flag across server, driver, config, and docs.
- Adds bundle download/extract helpers and cloud API calls for cy-prompt
- Introduces
CyPromptManager
andCyPromptLifecycleManager
for runtime orchestration - Registers the experimentalPromptCommand flag in config, driver, tests, and documentation
Reviewed Changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
packages/server/lib/cloud/cy-prompt/ensure_cy_prompt_bundle.ts | Fetches or copies and extracts the cy-prompt bundle |
packages/server/lib/cloud/cy-prompt/CyPromptManager.ts | Invokes methods on dynamically loaded cy-prompt server scripts |
packages/server/lib/cloud/cy-prompt/CyPromptLifecycleManager.ts | Orchestrates session creation, bundle setup, and manager ready |
packages/server/lib/cloud/api/cy-prompt/post_cy_prompt_session.ts | Implements POST to start a cy-prompt session |
packages/server/lib/cloud/api/cy-prompt/get_cy_prompt_bundle.ts | Downloads and verifies the signed cy-prompt bundle |
packages/data-context/src/data/coreDataShape.ts | Adds cyPromptLifecycleManager to the shared data context shape |
packages/driver/src/cy/commands/prompt/prompt-driver-types.ts | Defines driver interface for cy.prompt |
packages/driver/src/cy/commands/prompt/index.ts | Implements the prompt command using module federation runtime |
packages/driver/src/cy/commands/index.ts | Registers the prompt command under driver commands |
packages/driver/package.json | Adds @module-federation/runtime dependency |
packages/driver/cypress/e2e/commands/prompt.cy.ts | Basic end-to-end smoke test for cy.prompt |
packages/driver/cypress/e2e/e2e/origin/commands/misc.cy.ts | Updated command list to include prompt |
packages/driver/cypress.config.ts | Enables experimentalPromptCommand |
packages/config/src/options.ts | Introduces new experimental flag |
packages/config/test/project/utils.spec.ts | Updates default and public config keys tests |
packages/config/snapshots/index.spec.ts.js | Updates snapshots to include the new flag |
packages/frontend-shared/src/locales/en-US.json | Adds UI copy for the new experimental flag |
guides/cy-prompt-development.md | Documents local and remote development workflows for cy.prompt |
Comments suppressed due to low confidence (1)
packages/driver/cypress/e2e/commands/prompt.cy.ts:7
- [nitpick] This test only verifies that the command does not throw—consider adding assertions on expected side effects or backend calls to improve coverage.
cy.prompt('Hello, world!')
throw new Error('Unable to get studio signature') | ||
} | ||
|
||
const verified = await verifySignatureFromFile(bundlePath, responseSignature) | ||
|
||
if (!verified) { | ||
throw new Error('Unable to verify studio signature') |
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.
The error message below refers to 'studio signature' but this is for cy-prompt; update it to reference 'cy-prompt signature' to avoid confusion.
throw new Error('Unable to get studio signature') | |
} | |
const verified = await verifySignatureFromFile(bundlePath, responseSignature) | |
if (!verified) { | |
throw new Error('Unable to verify studio signature') | |
throw new Error('Unable to get cy-prompt signature') | |
} | |
const verified = await verifySignatureFromFile(bundlePath, responseSignature) | |
if (!verified) { | |
throw new Error('Unable to verify cy-prompt signature') |
Copilot uses AI. Check for mistakes.
const verified = await verifySignatureFromFile(bundlePath, responseSignature) | ||
|
||
if (!verified) { | ||
throw new Error('Unable to verify studio signature') |
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.
The error thrown here mentions 'Unable to verify studio signature'—it should reference 'cy-prompt signature' for accuracy.
throw new Error('Unable to verify studio signature') | |
throw new Error('Unable to verify cy-prompt signature') |
Copilot uses AI. Check for mistakes.
|
||
- Set: | ||
- `CYPRESS_INTERNAL_ENV=<environment>` (e.g. `staging` or `production` if you want to hit those deployments of `cypress-services` or `development` if you want to hit a locally running version of `cypress-services`) | ||
``` |
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.
There is an unmatched code fence here that breaks the markdown list; remove or properly close the block so the document renders correctly.
Copilot uses AI. Check for mistakes.
// TODO: handle this better | ||
throw new Error('CyPromptDriver not found') |
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.
Catching any error and rethrowing a generic 'CyPromptDriver not found' hides the original error—consider rethrowing or logging the original exception for better debugging.
// TODO: handle this better | |
throw new Error('CyPromptDriver not found') | |
throw new Error('CyPromptDriver not found', { cause: error }) |
Copilot uses AI. Check for mistakes.
Additional details
This PR lays the ground work for consuming the cloud code that will be responsible for supporting
cy.prompt()
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?