Skip to content

test: add non-adapter deploy snapshots to otel-middleware-trace - #100583

Merged
sokra merged 1 commit into
canaryfrom
fleet/otel-middleware-trace-non-adapter-deploy
Oct 22, 2026
Merged

sokra merged 1 commit into
canaryfrom
fleet/otel-middleware-trace-non-adapter-deploy

Conversation

@sokra

@sokra sokra commented Oct 22, 2026

Copy link
Copy Markdown
Member

What?

Adds snapshots for deployments built without the adapter to test/e2e/app-dir/otel-middleware-trace/otel-middleware-trace.test.ts. Test-only change.

Why?

The v16.5.0-canary.23 release deploy tests (run 39773330104) fail 20 of 30 tests in this file, on every retry, in Run Deploy Tests (Turbopack) and Run Deploy Tests (Webpack). Those jobs deploy with NEXT_ENABLE_ADAPTER=0. The deploy snapshots were filled from PR CI, which deploys only through the adapter (NEXT_ENABLE_ADAPTER=1). Run Deploy Adapter Tests passes the same file.

Without the adapter, the trace topology is the same: one trace, and the middleware and render are siblings under Next.request or the incoming context. Only the render's spans have the self-hosted shape:

  • the request span is unnamed (GET instead of GET /page/page);
  • findPageComponents → loadRouteModule spans appear;
  • the render's instrumentation.ts lifecycle spans are startup roots. Node.js middleware still emits its lifecycle spans inside the middleware span.

How?

  • Builder flag. A new isNonAdapterDeploy flag selects non-adapter snapshots for deployments without the adapter, in the default render mode.
    • The snapshots are the complete received trees from that run. They were identical across Turbopack and Webpack and all 3 attempts.
    • The lifecycle-span test reuses the existing self-hosted snapshot.
  • Existing snapshots unchanged. All adapter, self-hosted and Cache Components snapshots stay as they are. Non-adapter deployments with Cache Components keep the existing assertions, because the release suite doesn't run that combination, so there's no observed tree to assert.
  • No coverage dropped. No deployment skips or known-failure entries.

Verification:

  • Mechanical checks. The new literals were checked against the trees reconstructed from the CI logs. A check of which snapshot each of the 192 test/environment combinations selects confirms that only default-mode non-adapter deployments change.
  • Local runs. test-start-turbo, test-dev-turbo and test-start-webpack pass with no snapshot changes.
  • Not confirmed by PR CI. PR CI deploys only through the adapter, so it doesn't exercise the new snapshots. The next release deploy run confirms them.

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: c3fac57

@github-actions github-actions Bot added created-by: Turbopack team PRs by the Turbopack team. tests labels Oct 22, 2026
@sokra
sokra requested a review from mischnic October 22, 2026 13:51
@sokra
sokra marked this pull request as ready for review October 22, 2026 13:51
@sokra
sokra merged commit f196a3a into canary Oct 22, 2026
121 checks passed
@sokra
sokra deleted the fleet/otel-middleware-trace-non-adapter-deploy branch October 22, 2026 13:59
sokra added a commit that referenced this pull request Oct 22, 2026
)

### What?

Adds snapshots for deployments built without the adapter to
`test/e2e/app-dir/otel-middleware-trace/otel-middleware-trace.test.ts`.
Test-only change.

### Why?

The v16.5.0-canary.23 release deploy tests ([run
39773330104](https://github.com/vercel/next.js/actions/runs/39773330104))
fail 20 of 30 tests in this file, on every retry, in `Run Deploy Tests
(Turbopack)` and `Run Deploy Tests (Webpack)`. Those jobs deploy with
`NEXT_ENABLE_ADAPTER=0`. The deploy snapshots were filled from PR CI,
which deploys only through the adapter (`NEXT_ENABLE_ADAPTER=1`). `Run
Deploy Adapter Tests` passes the same file.

Without the adapter, the trace topology is the same: one trace, and the
middleware and render are siblings under `Next.request` or the incoming
context. Only the render's spans have the self-hosted shape:
- the request span is unnamed (`GET` instead of `GET /page/page`);
- `findPageComponents` → `loadRouteModule` spans appear;
- the render's `instrumentation.ts` lifecycle spans are startup roots.
Node.js middleware still emits its lifecycle spans inside the middleware
span.

### How?

- **Builder flag.** A new `isNonAdapterDeploy` flag selects non-adapter
snapshots for deployments without the adapter, in the default render
mode.
- The snapshots are the complete received trees from that run. They were
identical across Turbopack and Webpack and all 3 attempts.
  - The lifecycle-span test reuses the existing self-hosted snapshot.
- **Existing snapshots unchanged.** All adapter, self-hosted and Cache
Components snapshots stay as they are. Non-adapter deployments with
Cache Components keep the existing assertions, because the release suite
doesn't run that combination, so there's no observed tree to assert.
- **No coverage dropped.** No deployment skips or known-failure entries.

Verification:
- **Mechanical checks.** The new literals were checked against the trees
reconstructed from the CI logs. A check of which snapshot each of the
192 test/environment combinations selects confirms that only
default-mode non-adapter deployments change.
- **Local runs.** `test-start-turbo`, `test-dev-turbo` and
`test-start-webpack` pass with no snapshot changes.
- **Not confirmed by PR CI.** PR CI deploys only through the adapter, so
it doesn't exercise the new snapshots. The next release deploy run
confirms them.

<!-- NEXT_JS_LLM -->

<!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e -->

Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
(cherry picked from commit f196a3a)

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
mischnic pushed a commit that referenced this pull request Oct 22, 2026
…0294, #100324, #100350, #100552, #100583) (#100542)

Backports the OpenTelemetry request-trace stack to
`releases/lts/active`:

- #100349 Start the request span before route module preparation
- #100294 Keep middleware and render in one OpenTelemetry trace as
siblings (re-lands #100136, whose LTS backport #100226 was reverted in
#100269)
- #100324 docs: note that instrumentation-time spans don't join request
traces
- #100350 Emit instrumentation lifecycle spans in the request that
registered it
- #100552 Preserve deferred middleware instrumentation spans when the
adapter throws
- #100583 test: add non-adapter deploy snapshots to
otel-middleware-trace. Without it, `otel-middleware-trace` fails the
release deploy tests that deploy with `NEXT_ENABLE_ADAPTER=0`, as on
v16.5.0-canary.23.

The six canary merge commits are cherry-picked in order with `-x`, and
all applied cleanly. The patch content is identical to canary's; only
blob IDs and line offsets differ.

## Verification

- `test/e2e/opentelemetry/instrumentation/`: `test-start-turbo` (122
passed) and `test-dev-turbo` (67 passed). The #100552 regression test
fails without its `middleware.ts` change.
- `test/e2e/app-dir/otel-middleware-trace`: `test-start-turbo`,
`test-dev-turbo` and `test-start-webpack` (30 passed each, inline
snapshots unchanged). The #100583 commit leaves the test file
byte-identical to canary's.
- Unit tests for `instrumentation-globals`, `tracer` and
`forward-trace-context` (40 passed), plus `pnpm --filter=next types`
- Built with `CI=true pnpm build-all` against the published `@next/swc`
16.4.2 binary. The backport touches no Rust.
- PR CI deploys only through the adapter, so the non-adapter snapshots
from #100583 are confirmed by the next release deploy run.

<!-- NEXT_JS_LLM -->


<!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e -->

---------

Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
@github-actions github-actions Bot added the locked label Nov 6, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants