Skip to content

test: guard hoisted layouts and the published engine version - #122

Open
zkochan wants to merge 1 commit into
mainfrom
hoisted-layout-integrity-test
Open

test: guard hoisted layouts and the published engine version#122
zkochan wants to merge 1 commit into
mainfrom
hoisted-layout-integrity-test

Conversation

@zkochan

@zkochan zkochan commented Aug 20, 2026

Copy link
Copy Markdown
Member

Adds the two guards that would have caught the broken releases up to 3.1.1, one per failure mode:

  1. hoisted-layout-integrity.spec.ts — runs the real bundled @pnpm/napi engine (the existing install spec mocks it entirely) on a fixture reproducing the failure shape: root holds parse-entities@2 while two local packages both depend on parse-entities@4, whose character-entities-legacy@3 conflicts with the root-hoisted @1. Asserts each dependent resolves the conflicting transitive dep correctly. The pre-rc.8 engine nests it under only one dependent (verified against the old engine), which is exactly the bug class that crashed bit startups with ERR_IMPORT_ATTRIBUTE_MISSING. Runs in ~1s (the engine is fast). Since component tests run during bit tag --build, a regressed engine can no longer be tagged.

  2. Release workflow: an explicit bit test step before tagging (fail fast, and a safety net in case a build pipeline ever skips tests), plus a post-publish step comparing the published @teambit/bvm's @pnpm/napi dependency against the version installed in the release workspace. 3.1.1 was tagged from a workspace on rc.8 yet published depending on rc.7 (hardcoded stamp in the bundle env, fixed in fix: stamp the bundle's @pnpm/napi version from the installed package #121); with this step such drift fails the release run loudly instead of shipping silently.

Verified: the spec passes on main (rc.8 engine) and fails when its expectations are perturbed; the same resolution check against a layout produced by the old engine shows the wrong version (character-entities-legacy@1 from one dependent).

🤖 Generated with Claude Code

Two guards against the failure modes that shipped broken bvm releases:

- A hoisted-layout-integrity spec that runs the real bundled
  @pnpm/napi engine (not a mock - the existing install spec mocks it)
  on a fixture with a version-conflicted package shared by two
  dependents, and asserts each dependent resolves the conflicting
  transitive dependency correctly. This is the engine bug class that
  broke bit startups (ERR_IMPORT_ATTRIBUTE_MISSING) up to bvm 3.1.1:
  the old hoister nested the dep under only one dependent.

- Release workflow: run bit test before tagging, and after publishing
  compare the published @teambit/bvm's @pnpm/napi dependency against
  the version installed in the release workspace. 3.1.1 was tagged
  from a workspace on rc.8 yet published depending on rc.7 (the
  bundle env hardcoded the version); this makes such drift fail the
  release loudly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.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