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

Fetches Cloud validation typings during install/build and updates server Cloud API to use them with tightened types and small flow tweaks.

  • Server
    • Cloud validations:
      • Add scripts/sync-cloud-validations.sh to fetch lib/validations/cloudValidations.d.ts (ETag-based); wire via postinstall, build-prod, check-ts, and new scripts sync-cloud-validations/ensure-cloud-validations.
      • Ignore lib/validations/** in .gitignore and ESLint.
    • Cloud API typing:
      • Replace custom request/response interfaces with ../../validations/cloudValidations types in lib/cloud/api/index.ts and lib/cloud/api/create_instance.ts; add explicit method return types.
      • Gate capture protocol setup to e2e/component testing types.
      • postInstanceTests, postInstanceResults, updateInstanceStdout, updateInstanceArtifacts, createInstance now use validated request/response types.
    • User API:
      • Make getBaseLoginUrl async and read dashboardAuthUrl from getAuthUrls() result.
    • Record mode:
      • Refactor _postInstanceTests to async/await with centralized error handling; onTestsReceived handles SPEC: SKIP and error paths without invoking the callback.
  • Tooling:
    • @tooling/v8-snapshot build ensures typedefs by invoking server ensure-cloud-validations.
  • Deps/Scripts:
    • Add zod; update npm scripts accordingly.

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

@cypress
Copy link

cypress bot commented Oct 2, 2025

cypress    Run #67000

Run Properties:  status check failed Failed #67000  •  git commit dfe3934bb1: do not lint server validations
Project cypress
Branch Review chore/use-api-typedefs
Run status status check failed Failed #67000
Run duration 19m 34s
Commit git commit dfe3934bb1: do not lint server validations
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 14
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 26748
View all changes introduced in this branch ↗︎

Warning

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

UI Coverage  45.2%
  Untested elements 189  
  Tested elements 160  
Accessibility  98%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 101  

Tests for review

Failed  src/gql-components/error/BaseError.cy.tsx • 1 failed test • frontend-shared-ct

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay
Flakiness  commands/actions/selectFile.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > throws with aliased intercepts Test Replay
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-inject-document-domain-chrome

View Output

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

View Output

Test Artifacts
src/cy/commands/files > #readFile > retries to read when ENOENT
    </td>
  </tr></table>
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>

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.

3 participants