Skip to content

fix(dev): Keep evals on Blob storage and start S3 in acp-local - #2328

Merged
thomasjiangcy merged 1 commit into
mainfrom
fix/test-env-attachment-storage
Oct 29, 2026
Merged

thomasjiangcy merged 1 commit into
mainfrom
fix/test-env-attachment-storage

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

#2327 added S3 defaults to apps/example/.env.example. This PR fixes two places that picked up those defaults by mistake. Cursor Bugbot reported both on #2327.

Evals used S3 instead of the Blob mock

The eval Vitest configs load apps/example/.env.example through loadJuniorTestEnvFiles. So evals now selected the s3 provider at localhost:7072. Eval CI has no S3 service, and the eval agent fixture mocks Vercel Blob (src/fixture/blob.ts). Attachment evals, such as attachments.eval.ts and the file cases in delivery.eval.ts, would fail the next time they run. They did not run on #2327, because CI skipped the eval jobs for those paths.

The behavioral and integration eval configs now set JUNIOR_ATTACHMENT_STORAGE_PROVIDER=vercel-blob next to the fake BLOB_READ_WRITE_TOKEN they already set. The guardian, router and harness configs set no Blob token, so they do not store attachments, and this PR leaves them unchanged.

acp-local did not start S3

scripts/acp-local.mjs loads the same S3 defaults but started only postgres and redis. It now runs docker compose up -d --wait with no service list, like the README.

Verification

  • Resolved each eval config with vitest/node resolveConfig. On main, the integration config resolves to s3. With this change, both changed configs resolve to vercel-blob.
  • With s3 stopped, docker compose up -d --wait started all 3 services, and all were healthy.
  • Prettier passes.
  • I could not run the evals locally, because the sandbox has no cloudflared for eval egress. CI eval jobs should run for these config changes.

The packages/junior tests also load these defaults. They pass on main, because they pass storage in directly. The next slice will set a memory provider for them.

via @thomasjiangcy.

--

View Junior Session [Sentry]

#2327 added S3 defaults to `apps/example/.env.example`. The eval Vitest
configs load that file through `loadJuniorTestEnvFiles`, so evals now
picked the S3 provider at `localhost:7072`. Eval CI has no S3 service,
and the eval fixture mocks Vercel Blob. Attachment evals would fail.

The behavioral and integration eval configs now set
`JUNIOR_ATTACHMENT_STORAGE_PROVIDER=vercel-blob` next to the fake Blob
token they already set.

`acp-local` loads the same S3 defaults but started only `postgres` and
`redis`. It now runs `docker compose up -d --wait` with no service list,
like the README.

Fixes two Cursor Bugbot findings on #2327.

Co-Authored-By: Thomas Jiang <[email protected]>
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 29, 2026 6:51am UTC

Request Review

@sentry-evals

sentry-evals Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-behavioral

Run Status Passed Failed Errored Cost Tokens Duration
Head Error 73 4 1 $1.15 0 539.26s

Base commit fc1b713 has no eval run to compare against.

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Failed 101 1 0 $0.57 0 289.81s

Base commit fc1b713 has no eval run to compare against.

@thomasjiangcy
thomasjiangcy merged commit d75fe15 into main Oct 29, 2026
46 of 48 checks passed
@thomasjiangcy
thomasjiangcy deleted the fix/test-env-attachment-storage branch October 29, 2026 07:09
dcramer pushed a commit that referenced this pull request Oct 29, 2026
Junior apps no longer install `@sentry/nitro` themselves.
`@sentry/junior` now depends on it, and `@sentry/junior/nitro` exports
`withSentryConfig`.

The Sentry SDK keeps one client for each SDK version
(`globalThis.__SENTRY__[SDK_VERSION]`). `initSentry()` creates that
client with Junior's `@sentry/node`. If an app pins an `@sentry/nitro`
version that differs from Junior's `@sentry/node`, the Nitro runtime
hooks find no client. The error hook and request spans then do nothing,
and nothing reports it. Before this change, each app had to keep its
`@sentry/nitro` pin equal to the `@sentry/node` version inside
`@sentry/junior` by hand.

Now `@sentry/nitro` and `@sentry/node` are next to each other in the
pnpm catalog, so they get bumped together. Apps write:

```ts
import { juniorNitro, withSentryConfig } from "@sentry/junior/nitro";
```

`withSentryConfig` is a thin wrapper around the SDK function. It sets
one default: the build release name is `getDeploymentServiceVersion()`,
which is `<junior version>+<VERCEL_GIT_COMMIT_SHA>`. This is the same
release that `initSentry()` reports. Without this default,
`@sentry/nitro` names the build release after the bare commit SHA, so
source maps and runtime events would be under two different releases. An
explicit `release.name` still wins. The wrapper types come from
`@sentry/nitro`'s own signature, so `dist/nitro.d.ts` does not inline
Nitro's types.

The `apps/example` app, the `junior init` scaffold, and the
`existing-app` docs use the new import. The package README no longer
tells apps to install `@sentry/node`. That instruction is how
`getsentry/junior-prod` got an unused second copy
(`@sentry/[email protected]` next to Junior's 10.65.0).

Why now: `junior-prod` never adopted `withSentryConfig`, so production
source maps are never uploaded. Production stack frames point at
`_libs/@sentry/junior+[...].mjs` around line 226k with `js_no_source`.
getsentry/junior-prod#568 is the draft follow-up that uses this export.

**Trade-off:** every Junior app now installs `@sentry/nitro`,
`@sentry/bundler-plugin-core`, and `@sentry/cli`. `@sentry/junior`
already hard-depends on `@sentry/node`, so this seemed acceptable.
Without a Sentry auth token, the build logs a warning and skips the
upload.

**Not done here:** wrapping the Sentry setup inside `juniorNitro()`
itself. `@sentry/nitro` does not export the module factory for that, and
it must change the config before modules run. Doing it here would mean
copying SDK internals.

**Verification**
- `pnpm --filter @sentry/junior build`: `dist/nitro.js` imports
`@sentry/nitro` as an external dependency, and `dist/nitro.d.ts` stays
small (47 lines).
- `pnpm typecheck` and `pnpm lint` in `packages/junior`, and `pnpm
typecheck` in `apps/example`.
- `vitest run` on `init-cli`, `check-cli`, and `nitro-plugin-module`
passed.
- A temporary test with a mocked `@sentry/nitro` checked the release
default. It passed `0.264.0+deadbeef` when `VERCEL_GIT_COMMIT_SHA` was
set, kept an explicit name, and left the name undefined when no SHA was
set.
- `nitro build` in `apps/example`: one `@sentry/core` (10.65.0) is in
the output, and `scripts/check-vercel-output.mjs` passes.
- `pnpm build:ci` in `junior-prod` linked to this branch: the build
passes with one `@sentry/core` (10.65.0). The upload step ran
`sentry-cli releases new 0.264.0+deadbeef`. The sandbox token was not
authorized, so the step got a 401 and created no release.
- `pnpm release:check` passes.
- The behavioral evals failure also occurs on unrelated PRs (#2339,
#2328, #2317, #2313). The integration evals pass.
- I did not test a real source map upload.

<!-- junior-request-attribution:start -->
via **Francesco Gringl-Novy**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AD0CA8FXFXAS%3A1793266810.973359 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AD0CA8FXFXAS%3A1793266810.973359)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0CA8FXFXAS%3A1793266810.973359/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Francesco Gringl-Novy <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 58fdaf7d Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant