fix(isolator): don't isolate published-tag dependency-only cycles#10488
Conversation
When isolating seeders (bit build/sign), a cyclic dependency is now pulled into the isolation only when the registry can't serve it: an unpublished snap, or a member of a cycle that includes a seeder. A published-tag, dependency-only cycle installs as a regular package instead of a capsule, so its env is never loaded. This prevents build/sign from failing when such a dependency carries an old/deprecated env that can't be loaded, and avoids needlessly isolating (and installing) large transitive dependency graphs.
PR Summary by QodoFix isolator to skip published-tag dependency-only cyclic dependencies
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewPrevious review resultsReview updated until commit 8ade0b5 Results up to commit 3026074
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewResults up to commit 4b29ef8
Great, no issues found!Qodo reviewed your code and found no material issues that require review |
|
Code review by qodo was updated up to the latest commit beb55ec |
|
Code review by qodo was updated up to the latest commit 3026074 |
|
Code review by qodo was updated up to the latest commit 8ade0b5 |
Symptom
bit buildcan abort withEnvNotFoundfor a dependency's env — a component that is never built in this run, only pulled in as build context. When such a dependency carries an old/deprecated env that can't be loaded, resolving it fails the whole build, even though the dependency should simply be installed as a package.Root cause
Since #10449 (
isolate cyclic dependencies of seeders to avoid registry fetch), refined by #10453 (isolate & link snap-versioned cyclic deps during aspect isolation),getCyclicDependenciesOfSeederspulls cyclic deps of seeders into the seeders-only isolation. #10453 added anonlySnapsguard but applied it only to aspect isolation — the build path runs withonlySnaps=falseand therefore pulls in every member of every cycle found in the seeder's dependency closure, including cycles that exist purely among dependencies.A published-tag, dependency-only cycle resolves fine from the registry and never needed a capsule. Isolating it needlessly pulls in large transitive graphs and force-loads each member's env — which aborts the build when a member has an env that can't be loaded.
Why it worked before those PRs: seeders-only isolation contained only the seeders — dependencies installed as packages, so their envs were never resolved.
Fix
Isolate a cyclic dependency only when the registry can't serve it: it's an unpublished snap, or it belongs to a cycle that includes a seeder (whose own package is unpublished, so a registry install of the member would try to fetch the seeder and fail). A published-tag, dependency-only cycle installs as a regular package again.
Behavior for the scenarios #10449/#10453 target is unchanged: cycles involving a seeder still pull in all their members, snap-versioned members are still isolated, and the aspect-isolation (
onlySnaps) path is untouched.Test
Added an e2e case (
e2e/harmony/isolate-cyclic-deps.e2e.ts): when the seeder is outside a dependency-only cycle,bit capsule create <seeder> --seeders-onlyisolates only the seeder, not the cycle members — the inverse of the existing test that verifies a seeder-cycle is isolated.