Repository navigation
fix(e2e): turn Sentry off in the Workplace e2e dev server - #670
Merged
Merged
Conversation
24cc8b5 turned Sentry on by default, so every Workplace page the e2e suite loads now posts envelopes to ingest.us.sentry.io. The settings specs refuse any request that leaves the local app and backend: the read-only guard records the POST to /api/<project>/envelope/ as an API mutation, and the browser-only harness records it as an external HTTP request. On develop that failed 411 settings tests and 18 of 36 browser-only tests, and every run sent events from localhost to the placeos-dev project. Sentry reads sentry_dsn only when the app starts, so the off switch has to be in the build-time settings. A new `e2e` build and serve configuration replaces the settings file with settings.e2e.ts, which is the Workplace settings with sentry_dsn ''. The Playwright webServer serves that configuration. Production, mobile, staging and plain `nx serve workplace` are unchanged and keep Sentry on. The harness guards are left as they are: they still catch any other request that leaves the stack.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
24cc8b5 (enable Sentry by default) means every Workplace page now loads Sentry and posts envelopes to
https://o437082.ingest.us.sentry.io/api/4506817038909440/envelope/. That includes the pages the e2e suite opens on localhost.The settings specs refuse any request that leaves the local app and backend, and the Sentry POST trips both of their guards:
apps/workplace/e2e/local/wpa-settings-readonly-legacy.fixture.tsand the per-spec copies) routes**/api/**. The Sentry URL matches that pattern, it's a POST, and it isn't to the local origin. So it's recorded as an API mutation and the test fails "read-only scenario must perform zero API mutations"."external HTTP request"(plus the"request failed"and console error from the abort) and fails the strict teardown audit.Since it landed:
It also means every e2e run was sending traces and error events from
localhostto the placeos-dev Sentry project.The fix
Sentry reads
sentry_dsnonly when the app starts, so (as the settings docs say) the off switch has to be in the build-time settings. This adds:apps/workplace/src/environments/settings.e2e.ts: the Workplace build-time settings withsentry_dsn: ''e2ebuild configuration that swaps it in, and ane2eserve configuration that uses it--configuration=e2eon the Playwright webServer command, plus the matching line ine2e/README.mdProduction, mobile, staging and plain
nx serve workplaceare unchanged and keep Sentry on. The harness guards aren't touched, so they still catch any other request that leaves the stack.Only Workplace's e2e runs in CI, so that's the only app changed here. Other apps' Playwright configs (concierge, stagehand and so on) will also report to Sentry if they're run locally. They can get the same configuration when they join CI.
Testing
Browser-only settings project (
--project=settings-browser, TZ=Etc/UTC, CI=1), run locally:The full suite against the e2e stack (
workplacejob) is running on this branch through a workflow dispatch: https://github.com/PlaceOS/user-interfaces/actions/runs/41740767164🤖 Generated with Claude Code
https://claude.ai/code/session_015VtrxAzu8XnqXeQG3QbRXt