Skip to content

perf(target-graph): index ordered dependency expansion - #1251

Merged
Nemanja Tesic (nemanjatesic) merged 6 commits into
microsoft:mainfrom
djordjem88:user/djmaks/lage-dependency-indexes
Nov 6, 2026
Merged

Nemanja Tesic (nemanjatesic) merged 6 commits into
microsoft:mainfrom
djordjem88:user/djmaks/lage-dependency-indexes

Conversation

@djordjem88

Copy link
Copy Markdown
Contributor

Summary

Requested reviewers: Nemanja Tesic (@nemanjatesic) and Elizabeth Craig (@ecraig12345).

Build task/package lookup indexes once per dependency expansion instead of repeatedly scanning all targets. Gather and sort matching target positions to preserve registration order for direct, transitive, and global task dependencies.

Part of the broader Lage performance effort explored in #1238. This change is self-contained and can merge independently. It intentionally excludes the separate transitive-memo lifetime fix. The indexes are expansion-local; there is no new process-wide cache.

Validation

  • Independent branch: target-graph suite passed (37 tests, 7 snapshots).
  • Added coverage for direct/transitive ordering, scoped packages, missing tasks, phantom filtering, interleaved global/package targets, and index isolation.
  • Full local CI passed during development of the combined series; this is not a claim about GitHub PR CI.
  • Includes a Beachball patch change file.

Djordje Maksimovic and others added 2 commits November 3, 2026 11:13
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b26a45b-25aa-45e3-95b4-f9a1b55dcb58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The dependency-expansion indexing change has no active review issues.

No open issues 🎉

What changed in this PR

This PR reduces repeated target scans during dependency expansion in Lage’s target-graph builder. It is a self-contained part of the broader performance effort and leaves transitive-cache lifetime unchanged.

Changes:

  • Builds expansion-local task and package indexes while preserving target registration order.
  • Adds regression tests for dependency ordering, scoped packages, missing tasks, global targets, and index isolation.
  • Includes a Beachball patch release note.
File Description
packages/​target-graph/​src/​expandDepSpecs.ts Replaces repeated scans with ordered, task/package-indexed lookups.
packages/​target-graph/​src/​__tests__/​WorkspaceTargetGraphBuilder.test.ts Adds ordering and index-isolation regression coverage.
change/​change-54bfdc0f-3f47-498d-bd7a-ec056560ef0d.json Records the target-graph optimization as a patch release.

Review effort: Max

Djordje Maksimovic and others added 2 commits November 5, 2026 11:50
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b26a45b-25aa-45e3-95b4-f9a1b55dcb58
Preserve invocation-local transitive caching alongside ordered dependency indexes and both regression test groups.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b26a45b-25aa-45e3-95b4-f9a1b55dcb58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The remaining changelog nit is that the entry describes implementation details rather than the user-facing performance improvement for large target graphs.

1 open issue

Review effort: Max

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@nemanjatesic
Nemanja Tesic (nemanjatesic) merged commit cf15521 into microsoft:main Nov 6, 2026
14 checks passed
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.

4 participants