Skip to content

ref(client): Share client helpers and prefix client errors - #57

Merged
dcramer merged 1 commit into
mainfrom
chore/client-tidy
Nov 5, 2026
Merged

dcramer merged 1 commit into
mainfrom
chore/client-tidy

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Cleanup in @sentry/roach after the recent fix PRs. No behavior change.

  • DEFAULT_NO_PROXY now lives in config.ts. client.ts and vitest.ts use it. config.ts is not in the exports map, so the public API does not change.
  • New swapEnv(values) returns a restore function. vitest.ts and vitest-setup.ts use it instead of two copies of the same code. On restore it deletes a key that was not set before, as the old code did.
  • Client errors start with Roach: : the Node version check, the HTTP error, the old-service error and the missing run input. Each message keeps its meaning.
  • A bad roach.json now gives Roach: <path> is not valid JSON: …, with the parse error as cause.

Kept as is: for noProxy: "", the action uses the default and the vitest integration passes the empty string through. Changing that would change behavior, so it is out of scope.

Checks (Node 24.22.2): pnpm check passes (format, lint with 0 warnings, typecheck, knip, 108 tests). packages/roach/tests/package.test.ts passes. Only one test text pin in service.test.ts changed.

This does not touch the files in #54 or #55.

via @dcramer.

--

View Session [Sentry]

Put DEFAULT_NO_PROXY and swapEnv() in config.ts, and use them in
client.ts, vitest.ts, and vitest-setup.ts. Start each error message of
the client with "Roach: ", and name the file when roach.json is not
valid JSON. The behavior does not change.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@dcramer
dcramer marked this pull request as ready for review November 5, 2026 17:38
@dcramer
dcramer merged commit 08aea67 into main Nov 5, 2026
16 checks passed
@dcramer
dcramer deleted the chore/client-tidy branch November 5, 2026 17:38
sentry-junior Bot added a commit that referenced this pull request Nov 5, 2026
Check each path, limit, metric, attribute, and section against the code
after the service split (#55) and the client tidy (#57):

- README: name the `url` input of the action, the rule name limits, the
  length limit of run secrets, the full list of credential header names,
  what a recording keeps (method, redacted URL, `content-type` and
  `location`), the 500 misses that the stats keep, `http.request.method`
  on `roach.request` and `roach.upstream`, the 10 s limit of a PROXY
  header, the 201/400/401/429 answers of `POST /__roach/runs`, and the
  404 for a wrong run token.
- README: the service log gets the class, the code, and the GCS status of
  an error.
- README: shorten the one-time PROXY protocol rollout to the steady-state
  order: deploy the image, apply the config secret with `-target`, reset
  the VM, apply the rest.
- README: drop the cache list of "Sentry" that TELEMETRY.md repeats, and
  the repeat of the miss rule of "Misses" in "Service". Move the
  changing-keys query to TELEMETRY.md.
- README: list redaction.test.ts and packages/roach/tests/package.test.ts,
  and say that CI also runs coverage and packs the package.
- TELEMETRY: name server.ts as a source, add `roach.recordings`,
  `roach.written`, and `http.request.method`, and the log fields.
- AGENTS: the Image workflow runs `terraform validate`, not CI.
- service.ts and server.ts comments: the key worker is a process, and
  the keep-alive time is 5 s and 1 s more.

Only docs and comments change. The tunnel limits bullet stays as on
main, because the fix of the tunnel idle limit changes it.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
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.

1 participant