Skip to content

internal: (studio) improve error reporting #31546

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

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

Conversation

ryanthemanuel
Copy link
Collaborator

@ryanthemanuel ryanthemanuel commented Apr 18, 2025

Additional details

This PR sets up communication with studio in the cloud so that we can be notified when errors occur. Specifically it:

  • Updates reportError to call out to the cloud if studio has been initialized
  • If studio has not been initialized it falls back to an app-only version of reporting the error to the cloud at <cloud-url>/studio/errors
  • Adds studioHash to the studio options so that version can properly be reported

Steps to test

How has the user experience changed?

PR Tasks

@ryanthemanuel ryanthemanuel self-assigned this Apr 18, 2025
@ryanthemanuel ryanthemanuel changed the title internal: (studio) improvements to how studio can access the protocol database internal: (studio) improve error reporting Apr 18, 2025
Copy link

cypress bot commented Apr 18, 2025

cypress    Run #61884

Run Properties:  status check passed Passed #61884  •  git commit 5e63285c93: fix tests
Project cypress
Branch Review ryanm/feat/errors
Run status status check passed Passed #61884
Run duration 18m 44s
Commit git commit 5e63285c93: fix tests
Committer Ryan Manuel
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 9
Tests that did not run due to a developer annotating a test with .skip  Pending 1232
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 32140
View all changes introduced in this branch ↗︎
UI Coverage  46.31%
  Untested elements 184  
  Tested elements 163  
Accessibility  92.63%
  Failed rules  3 critical   8 serious   2 moderate   2 minor
  Failed elements 887  

Copy link
Contributor

@Copilot Copilot AI left a 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 improves error reporting for studio by integrating cloud-based error notifications and updating existing API interfaces and test cases accordingly.

  • Updated error reporting to call the cloud API when studio is initialized, falling back to an app-only version when it isn’t.
  • Added a new studioHash option and revised import paths across the codebase.
  • Updated tests to verify the new error reporting flow and refactored imports to reflect the new folder structure.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/gulp/tasks/gulpCloudDeliveredTypes.ts Updated import path for studio manager
scripts/after-pack-hook.js Updated import path for getAndInitializeStudioManager
packages/types/src/studio/studio-server-types.ts Extended interface with studioHash and reportError method
packages/server/test/unit/* Revised tests to assert the new error reporting behavior
packages/server/lib/cloud/studio.ts Modified reportError to delegate to the studio server’s error reporter
packages/server/lib/cloud/api/studio/* Updated error reporting implementation and import paths
packages/server/lib/cloud/api/studio/get_and_initialize_studio_manager.ts Adjusted error handling to use the new error reporting API

import type { StudioCloudApi } from '@packages/types/src/studio/studio-server-types'
import Debug from 'debug'

const debug = Debug('cypress:server:cloud:api:studio:report_studio_errors')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const debug = Debug('cypress:server:cloud:api:studio:report_studio_errors')
const debug = Debug('cypress:server:cloud:api:studio:report_studio_error')

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