fix: cascade lane updateDependents during local bit snap#10322
fix: cascade lane updateDependents during local bit snap#10322davidfirst wants to merge 23 commits intomasterfrom
Conversation
Fold updateDependents entries into the same snap pass when their recorded dependencies reference a component being snapped, so the lane stays internally consistent without a second snap command (one Version and one Ripple CI build per cascaded component). Handles transitive and cyclic cases via fixed-point expansion with hashes pre-assigned before deps are rewritten.
There was a problem hiding this comment.
Pull request overview
This PR makes bit snap on lanes with updateDependents cascade those updateDependent components into the same snap pass, keeping lane heads and exported objects consistent without requiring a follow-up “snap updates” action.
Changes:
- Add
include-update-dependents-in-snap.tsto compute and load the updateDependents cascade set for a snap pass. - Extend
SnappingMain.snap()andVersionMakerto treat cascaded updateDependents as scope-only/hidden (skip bitmap updates, linking, pre-snap hooks, build, etc.). - Ensure divergence/export logic includes updateDependents heads and clears the one-shot
overrideUpdateDependentsflag after export.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/model-component.ts | Use lane head lookup that includes updateDependents for divergence/export correctness. |
| scopes/scope/export/export.main.runtime.ts | Ensure export includes updateDependents ids when override flag is set; clear override flag post-export. |
| scopes/component/snapping/version-maker.ts | Add updateDependentIds handling and skip workspace-only operations for cascaded updateDependents. |
| scopes/component/snapping/snapping.main.runtime.ts | Include cascaded updateDependents in the snap seed set and pass ids through to VersionMaker. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper to prefetch objects and compute cascade set via fixed-point expansion. |
There was a problem hiding this comment.
Pull request overview
This PR makes bit snap on a lane with updateDependents cascade the affected updateDependents components into the same snap pass, so the lane stays internally consistent (and export/divergence logic can “see” and push the resulting Version objects without requiring an extra “snap updates” step).
Changes:
- Add a snap-time cascade expander that loads
updateDependentscandidates from main head, computes the fixed-point cascade set, and injects them into the snap seeds. - Extend
VersionMakerto treat a per-componentupdateDependentIdsset as “updateDependents in lane” components and skip workspace-only operations for them (bitmap updates, linking, pre-snap hooks, build, etc.). - Ensure export/divergence paths consider lane heads that live under
lane.updateDependents, and export those ids whenoverrideUpdateDependentsis set (then clear the flag post-export).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/model-component.ts | Divergence/export head calculation now considers lane updateDependents entries as valid local lane heads. |
| scopes/scope/export/export.main.runtime.ts | Export explicitly includes updateDependents ids when the lane signals override, and clears the override flag after export. |
| scopes/component/snapping/version-maker.ts | Adds per-component updateDependentIds handling to route cascaded components through scope-only paths and skip workspace-side operations. |
| scopes/component/snapping/snapping.main.runtime.ts | Integrates updateDependents cascade computation into snap() and passes updateDependentIds through to VersionMaker. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper to load updateDependents from main head, compute fixed-point cascade set, and return extra snap seeders. |
…snap --update-dependents When bit _snap --update-dependents introduces a component into lane.updateDependents for the first time, any entry in lane.components that depends on it would keep pointing at the pre- updateDependents (usually main) version. Fold those dependents into the same snap pass so their dep refs land on the new updateDependents hash in one shot — no second snap required.
There was a problem hiding this comment.
Pull request overview
This PR makes lane updateDependents cascading happen within the same local bit snap pass, so lanes remain internally consistent without requiring an extra “snap updates” step after every snap.
Changes:
- Add helpers to include relevant
lane.updateDependents(workspace snap) and dependentlane.components(bare-scope_snap --update-dependents) into the same snap pass via fixed-point expansion. - Extend snapping/version-making/export flows to treat cascaded updateDependents as “scope-only” (skip bitmap, linking, hooks, build) and ensure they’re exported when locally updated.
- Update lane head resolution used by divergence/export to include
updateDependentsentries.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/model-component.ts | Use lane head lookup that includes updateDependents for divergence/export correctness. |
| scopes/scope/export/export.main.runtime.ts | Ensure locally-cascaded updateDependents are included in export, and clear the one-shot override flag after export. |
| scopes/component/snapping/version-maker.ts | Add per-component updateDependentIds handling and skip workspace-only steps for those components. |
| scopes/component/snapping/snapping.main.runtime.ts | Fold updateDependents (workspace snap) and lane-component dependents (bare-scope snapFromScope) into the same snap pass. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper: select which lane.updateDependents must be included in the snap via fixed-point expansion (based on main head). |
| scopes/component/snapping/include-lane-components-for-updep-snap.ts | New helper: in bare-scope updateDependents snap, select lane.components that depend on the targets. |
Comments suppressed due to low confidence (1)
scopes/component/snapping/version-maker.ts:235
harmonyCompsToTagis documented as being merged "in the original order", but the current implementation concatenatesworkspaceHarmonyCompsthenscopeHarmonyComps, which can reorder components relative tothis.allComponentsToTag. If any downstream logic relies on order alignment (or if deterministic ordering is expected), this can cause subtle issues. Consider reconstructingharmonyCompsToTagby mapping over the originalthis.allComponentsToTagorder (e.g., build a map by id and then rehydrate in order) or adjust the comment to reflect the actual ordering guarantee.
// Cascaded updateDependents are not tracked in the workspace bitmap, so loading them via
// `workspace.getManyByLegacy` would fail when the workspace tries to resolve their rootDir.
// Route them through `scope.getManyByLegacy` while the real workspace components go through
// the normal workspace path, then merge the results in the original order.
const workspaceComps: ConsumerComponent[] = [];
const scopeOnlyComps: ConsumerComponent[] = [];
this.allComponentsToTag.forEach((comp) => {
if (this.workspace && updateDependentIds?.searchWithoutVersion(comp.id)) {
scopeOnlyComps.push(comp);
} else {
workspaceComps.push(comp);
}
});
const workspaceHarmonyComps = workspaceComps.length
? await (this.workspace || this.scope).getManyByLegacy(workspaceComps)
: [];
const scopeHarmonyComps = scopeOnlyComps.length ? await this.scope.getManyByLegacy(scopeOnlyComps) : [];
const harmonyCompsToTag = [...workspaceHarmonyComps, ...scopeHarmonyComps];
// this is not necessarily the same as the previous allComponentsToTag. although it should be, because
// harmonyCompsToTag is created from allComponentsToTag. however, for aspects, the getMany returns them from cache
// and therefore, their instance of ConsumerComponent can be different than the one in allComponentsToTag.
this.allComponentsToTag = harmonyCompsToTag.map((c) => c.state._consumer);
…ting setLaneHeadLocal Reverts the setLaneHeadLocal change to getCompHeadIncludeUpdateDependents (which broke bit import <updDep>) and pushes the updDep head straight from getVersionsToExport instead. Cascaded updateDependents still get their Version objects exported; lane-level behaviors that rely on laneHeadLocal being empty for updateDependents are back to normal.
There was a problem hiding this comment.
Pull request overview
Ensures lanes remain internally consistent when snapping with updateDependents by cascading the affected components in the same snap pass (both from workspace bit snap and bare-scope _snap --update-dependents), and by exporting the cascaded updateDependents heads reliably.
Changes:
- Cascade
lane.updateDependentsinto workspacebit snapand pass per-componentupdateDependentIdsintoVersionMaker. - When running
_snap --update-dependentsin a bare scope, also include affectedlane.componentsdependents in the same snap pass. - Export path now explicitly includes/exports locally-cascaded
updateDependentsheads and clears the one-shot override flag after successful export.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/export/export.main.runtime.ts | Explicitly exports locally-cascaded updateDependents heads and clears overrideUpdateDependents after export. |
| scopes/component/snapping/version-maker.ts | Adds per-component updateDependentIds and skips workspace-only steps (bitmap/link/build/pre-snap/autotag) for scope-only cascades. |
| scopes/component/snapping/snapping.main.runtime.ts | Seeds cascaded updateDependents into workspace snaps, and pulls lane dependents into _snap --update-dependents runs. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | Computes the fixed-point cascade set for lane.updateDependents during workspace snap using main head as the base. |
| scopes/component/snapping/include-lane-components-for-updep-snap.ts | Computes fixed-point dependents set from lane.components that depend on _snap --update-dependents targets. |
…load errors, dedup, reconcile Lane doc
There was a problem hiding this comment.
Pull request overview
This PR makes lane updateDependents behavior internally consistent by cascading affected components into the same snap pass (both for workspace bit snap and bare-scope _snap --update-dependents), and ensuring the resulting objects are exportable without requiring a second user action.
Changes:
- Add cascade helpers to compute fixed-point snap sets for
lane.updateDependents(workspace snap) and forlane.componentsthat depend on updateDependent targets (bare-scope_snap --update-dependents). - Extend
VersionMakerto support per-component “updateDependent” handling (skip bitmap updates/linking/build hooks for those ids, but still snap them and update lane state). - Update export logic to explicitly include cascaded updateDependent versions/ids when exporting from a lane, and clear the override flag after export.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/lane.ts | Updates docs around the one-shot overrideUpdateDependents flag semantics. |
| scopes/scope/export/export.main.runtime.ts | Ensures cascaded updateDependent versions are included in export and clears the override flag post-export. |
| scopes/component/snapping/version-maker.ts | Adds updateDependentIds to mix lane.components + lane.updateDependents in one snap pass and skips workspace-only steps for updateDependent ids. |
| scopes/component/snapping/snapping.main.runtime.ts | Seeds cascade sets for both workspace snap and bare-scope snap-from-scope flows. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper to fold relevant lane.updateDependents into a workspace snap (main-head based fixed-point expansion). |
| scopes/component/snapping/include-lane-components-for-updep-snap.ts | New helper to fold affected lane.components into _snap --update-dependents (fixed-point expansion on recorded deps). |
There was a problem hiding this comment.
Pull request overview
This PR fixes lane graph inconsistencies around lane.updateDependents by folding the required cascaded re-snaps into the same bit snap / bit _snap --update-dependents pass, and ensuring the resulting updateDependents heads are correctly exported and merged remotely.
Changes:
- Add cascade seed discovery for workspace
bit snap(pulling affectedlane.updateDependentsin from main head) and for bare-scope_snap --update-dependents(pulling affectedlane.componentsdependents into the same pass). - Extend
VersionMakerwith per-componentupdateDependentIdsso one pass can write to bothlane.componentsandlane.updateDependentswhile safely skipping workspace-only operations for cascaded scope-only comps. - Update export + merge behavior to reliably push/merge cascaded
updateDependentsvia the one-shotoverrideUpdateDependentsflag, and clear it locally after successful export.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/lane.ts | Clarifies and documents the one-shot overrideUpdateDependents contract and its round-tripping behavior. |
| scopes/scope/export/export.main.runtime.ts | Ensures cascaded updateDependents versions are included in the export set, pushes their heads explicitly, and clears the override flag after export. |
| scopes/component/snapping/version-maker.ts | Adds updateDependentIds and routes cascaded updateDependents through scope-only paths (skipping bitmap, linking, pre-snap steps, build, auto-tag triggers). |
| scopes/component/snapping/snapping.main.runtime.ts | Seeds cascade sets for both workspace snap and bare-scope _snap --update-dependents, passing updateDependentIds into VersionMaker. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper: fixed-point cascade expansion for lane.updateDependents during workspace bit snap, basing parents on main head. |
| scopes/component/snapping/include-lane-components-for-updep-snap.ts | New helper: fixed-point cascade expansion for lane.components dependents during bare-scope _snap --update-dependents. |
| components/legacy/scope/repositories/sources.ts | Adjusts import/export merge semantics so pending local updateDependents cascades aren’t overwritten by imports, while export override remains explicit. |
…tes' and 'exported updates' sections, drop misleading untracked-files warning
There was a problem hiding this comment.
Pull request overview
This PR makes lane updateDependents cascades occur within the same local snap/update-dependents snap pass, keeping lane graphs consistent without requiring a second user action, and adds safeguards so local cascades aren’t lost before export.
Changes:
- Cascade relevant
lane.updateDependentsintobit snapand re-snap affectedlane.componentsduring_snap --update-dependents. - Extend
VersionMakerto support per-component routing intolane.updateDependentswhile skipping workspace-only steps (bitmap/linking/build hooks) for hidden cascaded components. - Adjust export/import behavior and CLI output to correctly include/push cascaded updateDependents and present them as “updates”.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/lane.ts | Updates JSDoc for overrideUpdateDependents semantics. |
| scopes/scope/export/export.main.runtime.ts | Ensures cascaded updateDependents are exported and avoids misleading bitmap warnings; clears override flag after successful export. |
| scopes/scope/export/export-cmd.ts | Splits CLI output into regular exported components vs exported updates (updateDependents). |
| scopes/component/snapping/version-maker.ts | Adds updateDependentIds to mix lane.components and lane.updateDependents in one pass; skips workspace-only steps for hidden comps. |
| scopes/component/snapping/snapping.main.runtime.ts | Seeds cascades for bit snap and for _snap --update-dependents dependents in lane.components. |
| scopes/component/snapping/snap-cmd.ts | Displays cascaded updateDependents separately as “snapped updates”. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper: fixed-point expansion to include relevant updateDependents (based on main head). |
| scopes/component/snapping/include-lane-components-for-updep-snap.ts | New helper: fixed-point expansion to include lane.components affected by _snap --update-dependents targets. |
| components/legacy/scope/repositories/sources.ts | Adds import-side guard to avoid wiping pending local cascades. |
Comments suppressed due to low confidence (1)
components/legacy/scope/repositories/sources.ts:752
- In
mergeLane(), the import-side guard prevents overwritingexistingLane.updateDependentswhen the local lane hasoverrideUpdateDependentsset. However, on the export path when the lane does not already exist on the remote (existingLaneis undefined), the incominglane(withoverrideUpdateDependents=true) will be returned and then persisted bymergeObjects(). This would unintentionally store the one-shot flag on the remote lane object. Consider clearingoverrideUpdateDependentson the lane object that will be persisted (e.g. before returning frommergeLane()whenisExport), even when there is noexistingLane.
if (isImport && existingLane && !existingLane.shouldOverrideUpdateDependents()) {
existingLane.updateDependents = lane.updateDependents;
}
if (isExport && existingLane && lane.shouldOverrideUpdateDependents()) {
await Promise.all(
Store lane.updateDependents + overrideUpdateDependents in each LaneHistory entry so bit reset can rewind to the newest remaining entry after removing the reset batches. Also ensures every state transition (fetch/import/export) writes a history entry so there's always a baseline to restore from. bit reset --head rewinds one snap at a time; bit reset --all rewinds all the way back to the pre-cascade state. overrideUpdateDependents is recomputed from the restored entry so a partial reset that leaves one cascade pending keeps the flag true.
…s stored lane so it never persists across a first-time push
There was a problem hiding this comment.
Pull request overview
This PR improves lane consistency around lane.updateDependents by cascading affected components into the same snap pass (both workspace bit snap and bare-scope _snap --update-dependents), and by ensuring export/import/reset flows preserve and correctly merge the resulting lane state.
Changes:
- Add workspace-side cascade so
bit snapre-snaps relevantlane.updateDependentsin the same pass, keeping their dependency refs aligned to the lane’s new hashes. - Add bare-scope
_snap --update-dependentscascade in the opposite direction by also re-snappinglane.componentsthat depend on the updated targets. - Persist/merge/export/reset support: snapshot
updateDependentsstate intoLaneHistory, guard import-side merges from overwriting pending local cascades, and ensure export pushes cascaded updateDependents heads and clears the override flag.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/lane.ts | Adds a helper to restore updateDependents + override flag together; updates override flag contract docs. |
| scopes/scope/objects/models/lane-history.ts | Stores updateDependents and overrideUpdateDependents snapshots per history entry; adds helper to find latest entry excluding keys. |
| scopes/scope/importer/importer.main.runtime.ts | Always attempts to record lane history on fetch/import paths to provide reset baselines. |
| scopes/scope/importer/import-components.ts | Always attempts to record lane history on lane import/merge saves. |
| scopes/scope/export/export.main.runtime.ts | Ensures cascaded updateDependents versions/ids are included in export decisions; clears override flag after successful export; avoids bitmap “not tracked” warning for updateDependents. |
| scopes/scope/export/export-cmd.ts | Splits CLI output into “exported components” vs “exported updates” (lane updateDependents). |
| scopes/component/snapping/version-maker.ts | Introduces per-component updateDependentIds handling; skips bitmap/link/build/pre-snap for cascaded updateDependents. |
| scopes/component/snapping/snapping.main.runtime.ts | Seeds cascade sets for both workspace snap and bare-scope updateDependents snap; updates reset to restore updateDependents from lane history. |
| scopes/component/snapping/snap-cmd.ts | Distinguishes cascaded updateDependents in snap output as “snapped updates”. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper to compute fixed-point cascade set for workspace bit snap using main-head parenting. |
| scopes/component/snapping/include-lane-components-for-updep-snap.ts | New helper to include affected lane.components when running _snap --update-dependents. |
| components/legacy/scope/repositories/sources.ts | Adds import-side guard to avoid overwriting pending local cascaded updateDependents; clears override flag on remote after export merge. |
…ate) Copilot flagged that 'latest non-excluded' would pick up newer entries whose content captures the post-cascade state — e.g. a 'bit fetch --lanes' entry recorded after the snap. Switched to 'latest entry with date < earliest excluded batch date', which deterministically lands on a pre-reset state. Also reverted the unconditional 'save history on fetch' change — the initial baseline from persistIfNotExists is enough, and spam entries on every no-op fetch created the stale-state problem this fix now defends against.
There was a problem hiding this comment.
Pull request overview
This PR makes lane updateDependents cascading consistent across local bit snap, bare-scope _snap --update-dependents, export/import, and reset flows—so users don’t need a second “snap updates” action to repair lane graph consistency.
Changes:
- Cascade
lane.updateDependentsinto the same workspacebit snappass (and cascade affectedlane.componentsduring_snap --update-dependents) using fixed-point dependency expansion. - Persist/restore
updateDependents+overrideUpdateDependentsviaLaneHistory, and rewind them correctly duringbit reset. - Harden export/import semantics: explicitly export locally-cascaded updateDependents when
overrideUpdateDependentsis set, and prevent import from overwriting pending local cascades.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/lane.ts | Adds an atomic restore setter for updateDependents + override flag; updates override flag JSDoc/contract. |
| scopes/scope/objects/models/lane-history.ts | Extends lane history entries to snapshot updateDependents and override flag; adds helper to find the “prior” entry for reset. |
| scopes/scope/importer/importer.main.runtime.ts | Ensures an initial lane history baseline exists when first fetching a lane object from remote. |
| scopes/scope/export/export.main.runtime.ts | Ensures cascaded updateDependents are exported when needed and avoids bitmap “not tracked” warnings for them; clears override after successful export and records history. |
| scopes/scope/export/export-cmd.ts | Splits CLI output into exported “components” vs exported “updates” (updateDependents). |
| scopes/component/snapping/version-maker.ts | Adds per-component updateDependentIds handling; skips workspace-only steps (bitmap updates/link/build/pre-snap/autotag triggers) for cascaded updateDependents. |
| scopes/component/snapping/snapping.main.runtime.ts | Seeds cascade sets for both workspace and bare-scope snap flows; updates reset to rewind updateDependents state using lane history. |
| scopes/component/snapping/snap-cmd.ts | Updates snap reporting to separately list “snapped updates” (cascaded updateDependents). |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper to include relevant updateDependents in workspace snap (main-head based, fixed-point expansion). |
| scopes/component/snapping/include-lane-components-for-updep-snap.ts | New helper to include lane.components dependents during _snap --update-dependents (fixed-point expansion). |
| components/legacy/scope/repositories/sources.ts | Import-side guard to avoid wiping pending local cascades; clears override flag on remote after honoring it on export. |
…bucket; rename export section to 'updated dependents'
There was a problem hiding this comment.
Pull request overview
This PR makes lane updateDependents cascades happen within the same local snap / update-dependents snap pass, keeping a lane’s internal dependency graph consistent without requiring an extra “snap updates” action, and safeguards those local cascades from being overwritten by import/fetch before export.
Changes:
- Cascade
lane.updateDependentsduring workspacebit snap, and cascade affectedlane.componentsduring bare-scope_snap --update-dependents. - Extend
VersionMakerto support per-component routing intolane.updateDependentsvslane.components, while skipping workspace-only steps for hidden updateDependents. - Persist/restore
updateDependents+ override flag viaLaneHistory, adjust export/import merge behavior, and improve CLI reporting for cascaded/hidden snaps.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/lane.ts | Adds a reset-focused setter for restoring updateDependents + override flag; updates override flag documentation. |
| scopes/scope/objects/models/lane-history.ts | Snapshots updateDependents/override flag into history and adds helper to find the correct pre-batch restore point for reset. |
| scopes/scope/importer/importer.main.runtime.ts | Records an initial lane-history entry when fetching a new lane to enable correct resets. |
| scopes/scope/export/export.main.runtime.ts | Ensures updateDependents cascades are exported and avoids misleading bitmap warnings; clears override after successful export. |
| scopes/scope/export/export-cmd.ts | Splits export output into regular components vs “updated dependents” (hidden lane updateDependents). |
| scopes/component/snapping/version-maker.ts | Adds updateDependentIds to route specific components into lane.updateDependents and skip workspace-only operations for them. |
| scopes/component/snapping/snapping.main.runtime.ts | Seeds cascades for workspace snap and bare-scope update-dependents snap; rewinds updateDependents on reset using lane-history. |
| scopes/component/snapping/snap-cmd.ts | Improves snap output to account for cascaded updateDependents separately from user-changed components. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper that selects which lane updateDependents to cascade into a workspace snap (fixed-point over full dep set). |
| scopes/component/snapping/include-lane-components-for-updep-snap.ts | New helper that pulls affected lane.components into _snap --update-dependents (fixed-point + concurrency cap). |
| components/legacy/scope/repositories/sources.ts | Adds import-side guard to avoid overwriting local cascaded updateDependents; clears override flag on remote after honoring it. |
There was a problem hiding this comment.
Pull request overview
This PR makes lane updateDependents snapping/exporting consistent in a single pass (both for workspace bit snap and bare-scope _snap --update-dependents), and protects locally-cascaded updateDependents from being overwritten by an import/fetch before export.
Changes:
- Cascade lane
updateDependentsinto workspacebit snap, and cascade affectedlane.componentsinto_snap --update-dependents, keeping lane graphs internally consistent without extra user actions. - Extend VersionMaker/snap pipelines to support per-component “goes to
lane.updateDependents” behavior and skip workspace-only steps (bitmap/linking/build/hooks) for hidden updateDependents. - Persist/rewind
updateDependents+overrideUpdateDependentsvia LaneHistory and add an import-side guard + export handling for the one-shot override flag.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scopes/scope/objects/models/lane.ts | Adds setUpdateDependentsAndOverride() and updates override flag contract/docs. |
| scopes/scope/objects/models/lane-history.ts | Snapshots updateDependents + override flag and adds “latest entry before batches” helper for reset. |
| scopes/scope/importer/importer.main.runtime.ts | Records initial LaneHistory entry when fetching a lane for the first time. |
| scopes/scope/export/export.main.runtime.ts | Ensures cascaded updateDependents versions are exported, suppresses misleading bitmap warning, and clears override flag post-export. |
| scopes/scope/export/export-cmd.ts | Splits CLI output between regular exported components vs hidden “updated dependents”. |
| scopes/lanes/merge-lanes/merge-lanes.main.runtime.ts | Fetch/merge logic optionally includes updateDependents objects/heads for main↔lane flows. |
| scopes/component/snapping/version-maker.ts | Adds updateDependentIds to route specific components into lane.updateDependents and skip workspace-only steps for them. |
| scopes/component/snapping/snapping.main.runtime.ts | Seeds cascades for both workspace snap and scope snap; reset now rewinds lane updateDependents state using LaneHistory. |
| scopes/component/snapping/snap-cmd.ts | Updates snap report to distinguish cascaded updateDependents and adjust auto-snapped counts/sections. |
| scopes/component/snapping/include-update-dependents-in-snap.ts | New helper: fixed-point expansion to include relevant lane.updateDependents in a workspace snap pass. |
| scopes/component/snapping/include-lane-components-for-updep-snap.ts | New helper: fixed-point expansion to include affected lane.components when snapping updateDependents in bare scope. |
| scopes/component/merging/merging.main.runtime.ts | Merge-snap preserves updateDependent status by passing explicit updateDependentIds into snap-from-scope. |
| components/legacy/scope/repositories/sources.ts | Import-side guard to not overwrite local cascaded updateDependents; clears override flag on remote merge result. |
Keeps a lane internally consistent with its
updateDependentswithout asking the user for a second action. Previously the only way to refreshupdateDependentswas the UI's "snap updates" button; nowbit snap,bit reset, and_merge-lane main <lane>(the UI's "update lane from main" button) all handle it automatically.What each flow does now
Local
bit snapon a lane with existing updateDependentsFolds affected entries into the same snap pass: loads each from main head, re-snaps it as a direct descendant of main with dep refs rewritten to the new lane hashes. One Version per cascaded comp, one Ripple CI build per cascaded comp, not two. Cascade set is a fixed-point expansion across runtime + dev + peer + extension deps (transitive + cycle safe).
First click of "snap updates" (
_snap --update-dependents)Pulls any
lane.componentsentry that transitively depends on the new updateDependent into the same pass and re-snaps it with the cascaded hash — so we don't end up withcompA@lane -> compB@mainwhencompB@lane.updateDependentsexists.bit reset/bit reset --headRewinds
lane.updateDependents+overrideUpdateDependentsto the state recorded in the LaneHistory entry immediately BEFORE the earliest reset batch (by date, so it correctly ignores newer history entries from a post-snapbit fetch). Orphaned cascade Version objects are cleaned from their ModelComponent._merge-lane main <lane>(UI "update lane")Now includes
lane.updateDependentsin the merge set so their refs are refreshed against main's advanced heads instead of staying stuck at their old main-head base until someone re-snaps. The merged ids are routed back intolane.updateDependents(not promoted tolane.components) via a per-idupdateDependentIdsplumbed from the merge caller down throughsnapFromScope/VersionMaker.How
include-update-dependents-in-snap.ts/include-lane-components-for-updep-snap.ts— the cascade helpers for the two snap directions. Basing cascades on main's current head (not the prior updateDependents snap) keeps the new snap a direct descendant of main, avoiding drift when main moved on since the last "snap updates" click.snapFromScopegained a per-idupdateDependentIds?: string[]so a mixed snap pass (merge-snap) can route some ids tolane.componentsand others tolane.updateDependents.merging.applyVersion.addToCurrentLaneroutes updates for existing updateDependent ids toaddComponentToUpdateDependents+setOverrideUpdateDependents(true)instead of promoting them.merge-lanes.resolveMergeContextfetches the target lane + main-side heads withincludeUpdateDependentsso the bare-scope merge has the Version objects it needs.updateDependents+overrideUpdateDependentson every write, with agetLatestEntryBeforeBatcheslookup used by reset to find the prior state.getVersionsToExportpushes the updateDependents head directly for lane entries flagged byshouldOverrideUpdateDependents(),getLaneCompIdsToExportincludes those ids in the export set,updateLanesAfterExportclears the override flag + records a post-export LaneHistory checkpoint.sources.mergeLaneskips the updateDependents override whenexistingLane.shouldOverrideUpdateDependents()is true — protects a pending local cascade from being wiped bybit fetch --lanes. On the remote side of export, the flag is cleared so it never persists.CLI output (terminology alignment with UI)
bit snap: cascaded updateDependents fold into the existing "auto-snapped dependents" bucket — rolled up as a scope-count in the default output, with a dedicated "auto-snapped dependents (not in workspace)" subsection inbit details.bit export: the "exported updates" section renamed to "updated dependents" with a matching description.Test coverage
teambit.dot-cli/scope-commands/update-dependents-cascade.spec.ts— 34 passing, 2 pending:lane.components.bit fetch --lanesbefore export.bit reset/bit reset --headrewind both the direct snap AND the cascaded updateDependents via LaneHistory._merge-lane main devrefreshes stale updateDependents when main advances, keeps them inlane.updateDependents.