Skip to content

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Oct 2, 2025

  • Closes

Additional details

System tests currently fetch typescript definitions and example payloads for API endpoints when they run. This ensures our api calls are supported properly by the server.

This adds the same functionality to packages/server, so we can make sure our api functions use up-to-date typedefs from Cypress Cloud

Steps to test

How has the user experience changed?

PR Tasks


Note

Switches server API request/response typing to Cloud-provided validations and adds a script/workflow to sync those typedefs; updates related call sites and error handling.

  • Server API typing:
    • Replace manual types with Cloud validation types in lib/cloud/api/create_instance.ts and lib/cloud/api/index.ts (e.g., PostRun*, PostInstance*, PutInstance*).
    • Tighten method signatures/return types (createRun, createInstance, postInstanceTests, postInstanceResults, updateInstanceStdout, updateInstanceArtifacts).
    • Add explicit protocol setup guard based on testingType.
  • Recording flow:
    • Refactor _postInstanceTests to async/try-catch; centralize error conversion to cloudCannotProceedErr.
    • Simplify onTestsReceived error path and keep SKIP handling (emit end with skippedSpec: true).
  • Cloud auth:
    • Make user.getBaseLoginUrl async and read dashboardAuthUrl from getAuthUrls() result.
  • Tooling/CI:
    • Add scripts/sync-cloud-validations.sh and new npm scripts (sync-cloud-validations, ensure-cloud-validations); run during postinstall and before build/type-check.
    • Add zod dep; update @tooling/v8-snapshot build to ensure typedefs.
  • Housekeeping:
    • Ignore lib/validations via .gitignore.

Written by Cursor Bugbot for commit c537692. This will update automatically on new commits. Configure here.

Copy link

cypress bot commented Oct 2, 2025

cypress    Run #66453

Run Properties:  status check failed Failed #66453  •  git commit c537692fca: manually build server typedefs @@
Project cypress
Branch Review chore/use-api-typedefs
Run status status check failed Failed #66453
Run duration 19m 19s
Commit git commit c537692fca: manually build server typedefs @@
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 2
Tests that were flaky  Flaky 13
Tests that did not run due to a developer annotating a test with .skip  Pending 1102
Tests that did not run due to a failure in a mocha hook  Skipped 4
Tests that passed  Passing 26711
View all changes introduced in this branch ↗︎

Warning

Partial Report: The results for the Application Quality reports may be incomplete.

UI Coverage  45.27%
  Untested elements 186  
  Tested elements 158  
Accessibility  97.97%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 101  

Tests for review

Failed  commands/files.cy.js • 1 failed test • 5x-driver-firefox

View Output

Test Artifacts
src/cy/commands/files > #readFile > retries to read when ENOENT
    </td>
  </tr></table>
Failed  studio/studio.cy.ts • 1 failed test • app-e2e

View Output

Test Artifacts
Cypress Studio > updates an existing test with assertions Test Replay Screenshots
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary Test Replay
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
... > stops waiting when an xhr request is canceled
    </td>
  </tr></table>
Flakiness  commands/location.cy.js • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > does not log an additional log on failure Test Replay
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary Test Replay

The first 5 flaky specs are shown, see all 13 specs in Cypress Cloud.

@cacieprins cacieprins marked this pull request as ready for review October 3, 2025 15:09
@cacieprins cacieprins self-assigned this Oct 3, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

.catch((err: any) => {
onError(err)

return responseDidFail
Copy link
Contributor

Choose a reason for hiding this comment

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

do we no longer need this logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's still there, just without the boolean flag. This "hanging" behavior is further down in the catch block that BugBot is complaining about.

"dev": "node index.js",
"docker": "cd ../.. && WORKING_DIR=/packages/server ./scripts/run-docker-local.sh",
"postinstall": "patch-package",
"postinstall": "patch-package && yarn sync-cloud-validations",
Copy link
Contributor

Choose a reason for hiding this comment

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

if we are doing this at the package level, do we still need to call it in CI after the build? Would be nice to get rid of this https://github.com/cypress-io/cypress/blob/develop/.circleci/src/pipeline/@pipeline.yml#L201

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a fully separate cloud validations download, combining them was out of scope for this

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.

2 participants