microsoft/rushstack

[rush] Rush should not write to the build cache when build contains warnings

justindeocampodd opened this issue · 0 comments

Summary

Our monorepo has been experiencing issues with linting regressions making their way into the master branch. We believe it is due to the way that Rush continues to write to the build cache even when a build fails on warnings. This causes an edge case where our build will fail due to the linting error, but if the user makes another commit (e.g. rebasing master) that doesn't trigger changes in the project, it will build successfully since it will just pull from the build cache and assume that it is pulling a successful build from the build cache.

Repro steps

  1. Create a PR that has changes that contain a linting warning for a project (this build fails)
  2. Push some changes that do not trigger the cache for that project (e.g. rebasing master) (this build succeeds)
  3. Validate if the build for the latest commit succeeds and pulls from the build cache for the project that contains the linting error

Expected result: When Rush experiences a warning during the build phase, it does not write to the build cache.
Actual result: When Rush experiences a warning during the build phase, it continues to write to the build cache.

Details

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version?
rushVersion from rush.json? 5.109.1
useWorkspaces from rush.json?
Operating system? Mac
Would you consider contributing a PR? Yes
Node.js version (node -v)? 18.17.0