Skip to content

Allow caching outputless plugin operations without rush-project.json - #6150

Open
Ian Clanton-Thuon (iclanton) wants to merge 1 commit into
microsoft:mainfrom
iclanton:fix/cache-outputless-plugin-operations
Open

Ian Clanton-Thuon (iclanton) wants to merge 1 commit into
microsoft:mainfrom
iclanton:fix/cache-outputless-plugin-operations

Conversation

@iclanton

Copy link
Copy Markdown
Member

Summary

  • allow a plugin-defined operation to use the build cache without project configuration when it explicitly declares outputFolderNames: []
  • keep project configuration required when the operation declares outputs or cache inputs such as environment variables, Node.js version, or additional files
  • apply the same eligibility rule to cache execution and cobuild build-plan analysis
  • retain hotlink and explicit cache-disable protections

Validation

  • rushx build
  • rushx test --test-path-pattern CacheableOperationPlugin.test (37 passed)
  • rushx test --test-path-pattern RushProjectConfiguration.test (30 passed)
  • rushx test --test-path-pattern BuildPlanPlugin.test (1 passed)
  • rush change --verify --no-fetch

Broader test note

A full local rush-lib run was attempted. The changed suites passed, while unrelated environment-sensitive tests failed because daemon tests reject the existing user/repository .env configuration and a tar signal test returned the platform tar exit code 0 instead of 1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 focused eligibility change preserves the required safeguards, includes regression coverage, and has no identified blocking issues.

0 open findings

What changed in this PR

Allows explicitly outputless plugin operations to use Rush’s build cache without rush-project.json, while preserving cache-input, hotlink, and explicit-disable safeguards.

Changes:

  • Shares cache eligibility logic between execution and cobuild planning.
  • Adds regression tests for eligible operations and required configuration.
  • Updates the public API report and change record.
File Description
libraries/​rush-lib/​src/​logic/​operations/​test/​CacheableOperationPlugin.test.ts Tests caching without project configuration.
libraries/​rush-lib/​src/​logic/​operations/​CacheableOperationPlugin.ts Uses shared eligibility logic.
libraries/​rush-lib/​src/​logic/​operations/​BuildPlanPlugin.ts Supplies operation settings for planning.
libraries/​rush-lib/​src/​api/​test/​RushProjectConfiguration.test.ts Tests eligibility restrictions and explicit disabling.
libraries/​rush-lib/​src/​api/​RushProjectConfiguration.ts Implements and documents outputless-operation eligibility.
common/​reviews/​api/​rush-lib.api.md Records optional eligibility parameters.
common/​changes/​@microsoft/​rush/​fix-cache-outputless-plugin-operations_2026-10-15-21-41-39.json Records the caching behavior change.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

3 participants