fix: Missing Packages After bit new with Forked Env#10201
Open
zkochan wants to merge 11 commits intoteambit:masterfrom
Open
fix: Missing Packages After bit new with Forked Env#10201zkochan wants to merge 11 commits intoteambit:masterfrom
zkochan wants to merge 11 commits intoteambit:masterfrom
Conversation
…egression) Reproduces the chicken-and-egg problem where forking an env with "+" dep-resolver entries into a fresh workspace causes MissingManuallyConfiguredPackages because the usedPeerDependencies filter excludes packages that aren't yet installed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two fixes for the chicken-and-egg problem where "+" dependency markers on a forked env couldn't resolve in a fresh workspace: 1. workspace-manifest-factory.ts: widen usedPeerDependencies filter to include packages explicitly listed in the component's dep-resolver config, so pnpm will install them even before they appear in the resolved dependency manifest. 2. apply-overrides.ts: in getDependenciesToAddManually(), when _manuallyAddPackage() can't resolve "+" from workspace package.json, check if the package was already resolved by applyAutoDetectedPeersFromEnvOnEnvItSelf() and remove it from missingPackageDependencies to prevent a false MissingManuallyConfiguredPackages issue. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a regression where a fresh workspace created via bit new / bit fork with a forked env can end up with manually-configured "+" dependencies never getting installed (and repeatedly reported as missing), by ensuring those deps make it into the generated manifests and by reducing a related false-positive missing-deps report.
Changes:
- Include env peer-deps in
usedPeerDependencieswhen the package is explicitly present in the component’s dep-resolver policy (to break the"+"chicken-and-egg cycle). - Avoid reporting
MissingManuallyConfiguredPackageswhen a+sentinel can’t be resolved but the package is already present in resolved package dependencies. - Add an e2e regression test covering the forked-env
+marker scenario.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
scopes/dependencies/dependency-resolver/manifest/workspace-manifest-factory.ts |
Expands the usedPeerDependencies filter to also consider explicitly-configured dep-resolver policy packages. |
scopes/dependencies/dependencies/dependencies-loader/apply-overrides.ts |
Removes a dependency from missingPackageDependencies when it’s already present in resolved package deps. |
e2e/harmony/dependencies/forked-env-missing-deps.e2e.ts |
Adds regression coverage for the forked-env + dependency marker installation cycle. |
scopes/dependencies/dependency-resolver/manifest/workspace-manifest-factory.ts
Outdated
Show resolved
Hide resolved
scopes/dependencies/dependencies/dependencies-loader/apply-overrides.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
scopes/dependencies/dependencies/dependencies-loader/apply-overrides.ts
Outdated
Show resolved
Hide resolved
scopes/dependencies/dependency-resolver/manifest/workspace-manifest-factory.ts
Outdated
Show resolved
Hide resolved
scopes/dependencies/dependency-resolver/manifest/workspace-manifest-factory.ts
Outdated
Show resolved
Hide resolved
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.
close #10200
Two fixes for the chicken-and-egg problem where "+" dependency markers on a forked env couldn't resolve in a fresh workspace:
workspace-manifest-factory.ts: widenusedPeerDependenciesfilter to include packages explicitly listed in the component's dep-resolver config, so pnpm will install them even before they appear in the resolved dependency manifest.apply-overrides.ts: ingetDependenciesToAddManually(), when_manuallyAddPackage()can't resolve"+"from workspacepackage.json, check if the package was already resolved byapplyAutoDetectedPeersFromEnvOnEnvItSelf()and remove it frommissingPackageDependenciesto prevent a falseMissingManuallyConfiguredPackagesissue.Proposed Changes