Skip to content

fix: Fix workspace graph caching. Avoid unnecessary plugin calls. - #2602

Merged
milesj merged 7 commits into
masterfrom
fix-pg-cache
Jul 8, 2026
Merged

fix: Fix workspace graph caching. Avoid unnecessary plugin calls.#2602
milesj merged 7 commits into
masterfrom
fix-pg-cache

Conversation

@milesj

@milesj milesj commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 7, 2026 19:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves workspace graph caching by making the cache key include more of the inputs that can affect the workspace graph, and by avoiding running graph-extension plugin hooks when the cached graph is reused.

Changes:

  • Introduces a toolchain plugin extend_project_graph implementation in the tc-tier1 WASM test plugin to validate caching behavior and plugin invocation.
  • Refactors workspace graph cache state/fingerprinting to hash project sources, config/toolchain inputs, environment, and plugin versions, and updates cache state file naming.
  • Adds/updates tests to verify cache hit/miss behavior for plugin graph extension and cache invalidation scenarios.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
wasm/tc-tier1/src/lib.rs Adds extend_project_graph hook used by tests to validate cache-hit behavior and alias extraction.
wasm/Cargo.lock Updates dependency lockfile versions/checksums for the WASM workspace.
crates/workspace/src/workspace_cache.rs Renames cache state and expands workspace graph fingerprint inputs.
crates/workspace/src/workspace_builder.rs Reworks cache digest generation and plugin extension flow for the workspace graph.
crates/project-graph/tests/project_graph_test.rs Updates cache state assertions and adds new plugin caching/invalidation tests.
crates/app/src/watchers/workspace_watcher.rs Updates watcher cleanup to remove the new cache state file.
.moon/workspace.yml Disables asyncGraphBuilding experiment (now commented out).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/workspace/src/workspace_builder.rs Outdated
Comment thread crates/workspace/src/workspace_builder.rs
Comment thread .moon/workspace.yml
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Run report for 6b36d2a0 (ubuntu-latest)

Total time: 1m 50s | Comparison time: 2m 1s | Estimated savings: 10.9s (9.0% faster)

Action Time Status Info
🟩 SyncWorkspace 412.9ms Passed
🟩 SyncProject(types) 5.9ms Passed
🟩 SyncProject(report) 5.4ms Passed
🟩 SetupProto(0.58.2) 9.7s Passed
🟩 SetupToolchain(node:22.18.0) 6.5s Passed
🟩 SetupToolchain(yarn:4.16.0) 1.2s Passed
⬛️ SetupToolchain(javascript) 0.3ms Skipped
🟩 SetupEnvironment(javascript) 3.3ms Passed
⬛️ InstallDependencies(javascript) 0.9ms Skipped
🟩 RunTask(types:test) 1.4s Passed
🟩 RunTask(types:typecheck) 1.5s Passed
🟩 RunTask(types:build) 1.9s Passed
🟩 RunTask(report:test) 2.8s Passed
🟩 RunTask(visualizer:test) 3.2s Passed
🟩 RunTask(visualizer:typecheck) 3.9s Passed
🟩 RunTask(website:test) 1.6s Passed
🟩 RunTask(report:build) 3.3s Passed
🟩 RunTask(report:typecheck) 2.2s Passed
🟩 RunTask(vscode-extension:typecheck) 3s Passed
🟩 RunTask(visualizer:build) 4.5s Passed
And 4 more...
Expanded report
Action Time Status Info
🟩 RunTask(vscode-extension:test) 1.9s Passed
🟩 RunTask(vscode-extension:build) 2.1s Passed
🟩 RunTask(website:typecheck) 9.3s Passed
🟩 RunTask(website:build) 1m 31s Passed
Environment

OS: Linux
Matrix:

os = ubuntu-latest
Changed files
.moon/workspace.yml
crates/app/src/watchers/workspace_watcher.rs
crates/project-graph/tests/project_graph_test.rs
crates/workspace/src/workspace_builder.rs
crates/workspace/src/workspace_cache.rs
wasm/Cargo.lock
wasm/tc-tier1/src/lib.rs

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Run report for 6b36d2a0 (windows-latest)

Total time: 2m 2s | Comparison time: 2m 27s | Estimated savings: 24.9s (16.9% faster)

Action Time Status Info
🟩 SyncWorkspace 432.5ms Passed
🟩 SyncProject(types) 7.1ms Passed
🟩 SyncProject(report) 6.5ms Passed
🟩 SetupProto(0.58.2) 9.5s Passed
🟩 SetupToolchain(node:22.18.0) 9.3s Passed
🟩 SetupToolchain(yarn:4.16.0) 1.6s Passed
⬛️ SetupToolchain(javascript) 0.3ms Skipped
🟩 SetupEnvironment(javascript) 4.3ms Passed
⬛️ InstallDependencies(javascript) 0.6ms Skipped
🟩 RunTask(types:typecheck) 2.3s Passed
🟩 RunTask(types:test) 2.4s Passed
🟩 RunTask(types:build) 3.3s Passed
🟩 RunTask(visualizer:typecheck) 5.1s Passed
🟩 RunTask(visualizer:test) 6.1s Passed
🟩 RunTask(report:build) 6.7s Passed
🟩 RunTask(website:test) 3.8s Passed
🟩 RunTask(report:test) 3.4s Passed
🟩 RunTask(report:typecheck) 1.2s Passed
🟩 RunTask(vscode-extension:typecheck) 4.3s Passed
🟩 RunTask(website:typecheck) 10.8s Passed
And 4 more...
Expanded report
Action Time Status Info
🟩 RunTask(visualizer:build) 7s Passed
🟩 RunTask(vscode-extension:build) 2.8s Passed
🟩 RunTask(vscode-extension:test) 2.6s Passed
🟩 RunTask(website:build) 1m 38s Passed
Environment

OS: Windows
Matrix:

os = windows-latest
Changed files
.moon/workspace.yml
crates/app/src/watchers/workspace_watcher.rs
crates/project-graph/tests/project_graph_test.rs
crates/workspace/src/workspace_builder.rs
crates/workspace/src/workspace_cache.rs
wasm/Cargo.lock
wasm/tc-tier1/src/lib.rs

@codspeed-hq

codspeed-hq Bot commented Jul 7, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 23 untouched benchmarks


Comparing fix-pg-cache (6fafeda) with master (03e0c2e)

Open in CodSpeed

@milesj
milesj merged commit b5462c4 into master Jul 8, 2026
35 checks passed
@milesj
milesj deleted the fix-pg-cache branch July 8, 2026 02:47
@cedws

cedws commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Much love for this fix, it's made a huge difference.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants