test: guard hoisted layouts and the published engine version - #122
Open
zkochan wants to merge 1 commit into
Open
test: guard hoisted layouts and the published engine version#122zkochan wants to merge 1 commit into
zkochan wants to merge 1 commit into
Conversation
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>
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.
Adds the two guards that would have caught the broken releases up to 3.1.1, one per failure mode:
hoisted-layout-integrity.spec.ts— runs the real bundled@pnpm/napiengine (the existing install spec mocks it entirely) on a fixture reproducing the failure shape: root holdsparse-entities@2while two local packages both depend onparse-entities@4, whosecharacter-entities-legacy@3conflicts 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 withERR_IMPORT_ATTRIBUTE_MISSING. Runs in ~1s (the engine is fast). Since component tests run duringbit tag --build, a regressed engine can no longer be tagged.Release workflow: an explicit
bit teststep 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/napidependency 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@1from one dependent).🤖 Generated with Claude Code