Skip to content

fix(lanes): fetch hidden updateDependents from the lane scope - #10844

Open
davidfirst wants to merge 1 commit into
masterfrom
fix-lane-update-dependents-fetch-from-lane-scope
Open

davidfirst wants to merge 1 commit into
masterfrom
fix-lane-update-dependents-fetch-from-lane-scope

Conversation

@davidfirst

Copy link
Copy Markdown
Member

A cascade snap of a hidden lane entry (lane.updateDependents) is only in the lane scope. The origin scope of the component has only its main history. Some flows did not send includeUpdateDependents when they fetched these entries. Thus, the fetch went to the origin scope and did not find the cascade snap.

This PR sends the flag in these flows:

  • bit import on a lane. It fetches the hidden entries from the lane scope.
  • Snapping from a scope with update-dependents (e.g. a second "snap updates"). A seeder can be a hidden entry, so it is fetched from the lane scope.
  • A lane merge into main from a bare scope. The merge now also fetches the main objects of the hidden entries. A cascade is pushed with its head only, so the lane scope does not have the main head. Before, the merge failed with "@ was not found".

The e2e covers a second cascade from a new bare scope, then bit import, then a lane merge into main.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fetch hidden lane dependents from the correct scopes

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Route hidden lane dependents to the lane scope during import and repeated snapping.
• Fetch their main history from origin scopes before merging a lane into main.
• Cover repeated cascades, id-less import, and merge with a cross-scope e2e test.
Diagram

graph TD
  LaneScope[("Lane scope")] --> Seeder["Scope snapping"] --> UpdatedHead["New cascade snap"] --> Import["Workspace import"] --> Merge["Main merge"]
  LaneScope --> Import
  OriginScope[("Origin scope")] --> Merge
Loading
High-Level Assessment

Use the existing includeUpdateDependents routing flag at the missing fetch sites and expand the merge’s main-object fetch to its full input set. This preserves the distinction between lane-only snaps and origin-scope main history without introducing a separate fetch mechanism.

Files changed (4) +65 / -1

Bug fix (3) +14 / -1
merge-status-provider.tsFetch main objects for every merge candidate +4/-1

Fetch main objects for every merge candidate

• Uses the supplied merge IDs rather than only visible lane components when fetching main objects. This includes hidden updateDependents whose main heads are absent from the lane scope.

scopes/component/merging/merge-status-provider.ts

snapping.main.runtime.tsFetch hidden snapping seeders from the lane scope +3/-0

Fetch hidden snapping seeders from the lane scope

• Enables update-dependent routing when importing existing seeders for scope snapping. A repeated cascade can therefore find its previous hidden head and snap on top of it.

scopes/component/snapping/snapping.main.runtime.ts

import-components.tsRoute id-less lane imports for hidden dependents +7/-0

Route id-less lane imports for hidden dependents

• Passes includeUpdateDependents through both object-fetch stages of lane import. Hidden entries included in an id-less import are fetched from the lane scope rather than their component origin scopes.

scopes/scope/importer/import-components.ts

Tests (1) +51 / -0
update-dependents-cascade-import.e2e.tsCover repeated cross-scope cascades through import and merge +51/-0

Cover repeated cross-scope cascades through import and merge

• Extends the cross-scope hidden-dependent scenario with a second cascade from a fresh bare scope. Verifies parentage, retrieval by id-less bit import, and promotion of the hidden head by a lane-to-main merge.

e2e/harmony/lanes/update-dependents-cascade-import.e2e.ts

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant