Skip to content

test(vercel): tie the root-config marker to the reconciliation flag - #721

Merged
blove merged 1 commit into
mainfrom
blove/vercel-provenance-marker
Sep 18, 2026
Merged

blove merged 1 commit into
mainfrom
blove/vercel-provenance-marker

Conversation

@blove

@blove blove commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Follow-up from #697. I raised this on #691 while that PR owned these lines; it closed unmerged and the b4.func rename landed through #717 instead, leaving the note unactioned and the lines free.

The latent trap

NATIVE_REMOTE_BUILD_SIGNATURE in packages/cli/test/helpers/vercel-native-fixture.ts is consumed as an exact-ordered, all-present signature: exactOrderedSignature requires every entry to appear exactly once, in increasing index order. Since #697 its last entry, wrote vercel.json, is conditional rather than guaranteed, because the vercel target drops the root config from its emitted artifacts when build.vercel.reconcileVercelJson is false. That is the prebuilt-CI configuration the flag exists for.

Nothing was broken. The flag defaults to true and no fixture in this lane sets it, so the marker is always emitted and the lane stays green. The trap is for whoever next points that fixture at a prebuilt-only project: the parser would reject a build for doing exactly what it was configured to do, and the failure surfaced as native Vercel source build provenance is incomplete with no indication which of seven markers moved.

What changed

  • parseNativeBuildProvenance takes reconcilesVercelJson, defaulting to true to match the target's own default.
  • The flag is an assertion, not a relaxation. With reconciliation on the marker is required; with it off the marker must be absent, because reconciliation happening anyway means the opt-out never reached the remote builder. That direction is the one worth having: it catches a regression in the feature itself.
  • A mismatch now names the offending marker and how it offended: missing, duplicated, out-of-order, or unexpected.
  • The prebuilt branch still asserts the absence of the full marker list, unchanged, since that assertion does not depend on the flag.

Tests

Two new cases in vercel-native-lane.test.ts, both in the ungated lane, so they run without Docker or a real Vercel project:

  • the root-config marker is required by default, accepted as absent under reconcilesVercelJson: false, and rejected as unexpected marker when it appears despite the opt-out;
  • missing, duplicated, and out-of-order markers each name themselves in the error.

The first test fails against the previous parser on its first assertion, which is how I confirmed it binds rather than passing vacuously.

Locally: lint, cli typecheck, check-docs, and the four vercel suites (vercel-native-lane, vercel-target, build-targets, vercel-stores, 470 tests) all pass.

Test-only, so no changeset. The changeset check agrees: no user-facing changes detected.

🤖 Generated with Claude Code

The native lane's NATIVE_REMOTE_BUILD_SIGNATURE is consumed as an
exact-ordered, all-present signature, and since #697 its last entry,
`wrote vercel.json`, is conditional rather than guaranteed: the vercel
target drops the root config from its emitted artifacts when
`build.vercel.reconcileVercelJson` is false, which is the prebuilt-CI
configuration. Nothing was broken, because the flag defaults to true and
no fixture sets it, but pointing that lane at a prebuilt-only project
would have failed the parser for doing exactly what it was configured to
do.

`parseNativeBuildProvenance` now takes `reconcilesVercelJson` (default
true) and follows it in both directions: the marker is required when
reconciliation is on and must be ABSENT when it is off, since
reconciliation that happens anyway means the opt-out never reached the
builder.

A signature mismatch also names the offending marker now — missing,
duplicated, out-of-order, or unexpected — instead of reporting only
"native Vercel source build provenance is incomplete", which gave no
clue which of seven markers moved.

Test-only; no package behaviour changes.

Co-Authored-By: Claude Opus 5 <[email protected]>
@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
b4-run Ready Ready Preview Sep 18, 2026 12:41am UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@blove
blove enabled auto-merge (squash) September 18, 2026 00:40
@blove
blove merged commit 2f0eae7 into main Sep 18, 2026
30 of 31 checks passed
@blove
blove deleted the blove/vercel-provenance-marker branch September 18, 2026 00:58

This branch was successfully deployed

1 active and 1 inactive deployments
Preview — e6529acc Deployed Sep 18, 2026 by vercel[bot]
vercel-preview — e6529acc Deployed Sep 18, 2026 by blove via vercel-native #2049
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