feat(fixtures): deterministic bundleVersion re-stamp + sync automation#38
Merged
Conversation
…tomation The fork's self-hosting schema patches move the bundleVersion contract hash away from upstream's committed fixture stamps, failing protocol/fixtures.test.ts on every build (and recurring at each upstream sync). Rather than re-syncing fixtures against a builder, re-stamp the value deterministically from the schema. - packages/protocol/scripts/restamp-fixtures.ts: surgical text-replace of the bundleVersion field in each fixtures/*/.webstudio/data.json to the value computed from this checkout's schema. `--check` mode reports drift (exit 1). - package.json: `pnpm fixtures:restamp`. - sync-upstream.yml: after a clean rebase, run the re-stamp and commit/push so develop stays green with no manual step. - CLAUDE.md: document the workflow. The existing fixtures.test.ts keeps guarding structural validity (publishedProjectBundle.parse); this only refreshes the version stamp. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vianmora
added a commit
that referenced
this pull request
Jul 20, 2026
…tomation (#38) The fork's self-hosting schema patches move the bundleVersion contract hash away from upstream's committed fixture stamps, failing protocol/fixtures.test.ts on every build (and recurring at each upstream sync). Rather than re-syncing fixtures against a builder, re-stamp the value deterministically from the schema. - packages/protocol/scripts/restamp-fixtures.ts: surgical text-replace of the bundleVersion field in each fixtures/*/.webstudio/data.json to the value computed from this checkout's schema. `--check` mode reports drift (exit 1). - package.json: `pnpm fixtures:restamp`. - sync-upstream.yml: after a clean rebase, run the re-stamp and commit/push so develop stays green with no manual step. - CLAUDE.md: document the workflow. The existing fixtures.test.ts keeps guarding structural validity (publishedProjectBundle.parse); this only refreshes the version stamp. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
Why
bundleVersion(packages/protocol/src/schema.ts) is a contract hash of the schema. This fork's self-hosting patches change the schema, so its hash differs from the upstream-generated stamps committed infixtures/*/.webstudio/data.json— failingpackages/protocol/src/fixtures.test.ts. This isn't a one-off: it recurs at every upstream sync (upstream now computes the hash from the schema, since webstudio-is#5831/webstudio-is#5838), because our patches touch that schema.Re-syncing fixtures the upstream way (
pnpm fixtures) can't fix it:fixtures:synctargets upstream's hosted builder, which runs upstream's schema and stamps upstream's value. So we re-stamp deterministically from this checkout's schema instead.What
packages/protocol/scripts/restamp-fixtures.ts— reads the computedbundleVersionand does a surgical text-replace of thebundleVersionfield in eachfixtures/*/.webstudio/data.json(formatting preserved).--checkreports drift and exits non-zero.package.json—pnpm fixtures:restamp.sync-upstream.yml— after a clean rebase of the patch series, run the re-stamp and commit/push, sodeveloplands green with no manual step.CLAUDE.md— documents the workflow.Only the version stamp is refreshed;
fixtures.test.tsstill guards structural validity viapublishedProjectBundle.parse.Validation
Tested locally: detects drift, re-stamps, idempotent, leaves a clean tree.
Note / follow-up
The manual re-stamp from #37 is still a standing commit in the patch series. Once folded/dropped at the next
COMMUNITY_CHANGEScleanup, the sync-workflow step becomes the sole, fully-automated source of the stamp. Until then, if an upstream sync regenerates these fixtures such that #37 conflicts during rebase, the sync aborts as usual — resolve withgit checkout --theirs 'fixtures/*/.webstudio/data.json' && pnpm fixtures:restamp.🤖 Generated with Claude Code