Commit 7f00fdb
authored
fix(isolator): isolate cyclic dependencies of seeders to avoid registry fetch (#10449)
## Summary
Fixes the circular-dependency build failure seen consistently on Ripple,
where the build tries to install a cycle member from the registry that
isn't published yet:
```
GET https://node-registry.bit.cloud/@<scope>%2Fcomp1: Not Found - 404
@<scope>/comp1@0.0.0-<hash> is not in the npm registry (ERR_PNPM_FETCH_404)
```
### Root cause
`bit sign` isolates components in **`seedersOnly`** mode — only the
components being signed get capsules; every *dependency* is installed as
an npm package from the registry. That breaks for a dependency in a
**cycle** with a seeder: the cyclic component references back into a
seeder whose snap-version package was never published, so the capsule
install 404s.
It only reproduces on a real hub/lane (locally, remotes are registered
and workspace components link locally), which is why it's
Ripple-specific.
### Fix (`scopes/component/isolator/isolator.main.runtime.ts`)
- **seedersOnly path** — new `getCyclicDependenciesOfSeeders`: build the
seeder graph, use `graph.findCycles()` (the graph is seeded, so this
returns seeder-involving cycles), and pull those cyclic dependency
components into `componentsToIsolate` so they become real capsules
linked locally instead of fetched.
- **non-seedersOnly path** (`bit build`) —
`filterUnmodifiedExportedDependencies` now takes `idsInCycle` and never
excludes a component that's part of a seeder cycle from capsule
creation, closing the same gap for built+exported cyclic deps.
## Test plan
- [x] `npm run lint` (tsc + oxlint) clean.
- [x] Reproduced via the sign-from-scope flow (lane, `comp1 ↔ comp2`
cycle, snap both pending + export, sign one alone). **Without** the fix:
`ERR_PNPM_FETCH_404` on the unpublished cyclic snap. **With** the fix:
signs `succeed`, cyclic dep isolated as a capsule and linked locally.
- [x] Regression test added to the `sign` command spec ("signing one
member of a circular dependency while the other is still pending"). The
`sign` command lives in its own repo, so that test is committed there,
not in this PR.
## Notes
`getCyclicDependenciesOfSeeders` builds the seeder graph on every
seedersOnly isolation. It's cheap relative to the full sign (capsule
writes + install + tasks), but can be gated behind a lighter pre-check
if preferred.1 parent 1a75bd9 commit 7f00fdb
2 files changed
Lines changed: 83 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
369 | 369 | | |
370 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
371 | 383 | | |
372 | 384 | | |
373 | 385 | | |
| |||
433 | 445 | | |
434 | 446 | | |
435 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
436 | 482 | | |
437 | 483 | | |
438 | 484 | | |
| |||
0 commit comments