[rush] Introduce dependsOnAdditionalFiles configuration option to operations in rush-project.json#3824
Conversation
|
@microsoft-github-policy-service agree |
Use helper class provided by @rushstack/node-core-library instead of plain 'fs' package or manually converting callback to promise.
6bef342 to
4f9fa41
Compare
|
An aside, I do wonder if it would be worth separating out two different config options for including files that are part of the repository but outside of the project working directory (e.g. that live in |
a2c56ed to
c2fc78c
Compare
I've added a new commit: 989175b So first of all - I don't think there is a need to have two different config options, we simply can just check whether the path belongs to the repo and whether we have a hash for it already. In my opinion that is enough info to move further. Furthermore, I've exposed |
|
🚀 This was released with Rush 5.89.0. |
|
@octogonz since this PR is merged neither https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json or rushjs.io/pages/configs/rush-project_json is updated. |
|
Just a heads up - if you'll want to use In essence, it seems that if We quickly solved this by duplicating |
|
@lukaskl did you ever create a proper ticket related to the misalignment with incremental builds? Asking because I am thinking of upgrading Rush to use the |
|
The work item to alter the cache key calculations to include the cache keys of the build tasks they depend on is still work to be done. |

Summary
This PR allows repository maintainers to pass glob (minimatch) patters as
dependsOnAdditionalFilesoption to operations inrush-project.json.If
dependsOnAdditionalFilesis passed,rushwill read matched files before said operation, hash their contents and include those hashes when calculating final hash for the build cache.Fixes: #3822
Details
This PR is heavily based on #3769
I've noticed that solution used in #3769 is nearly identical to what I need, with just a few changes.
In addition to that - it keeps things nicely colocated and aligned.
dependsOnAdditionalFilesis optional propertydependsOnAdditionalFilesis not provided (which I believe will be true for most of the repositories) the impact on performance should be nearly zero.How it was tested
I've followed the guide described here: https://rushjs.io/pages/contributing/
I've set up alias for the
./rushstack/libraries/rush-lib/lib/start.jsscript and tried to build my own rush projects.Impacted documentation
rush-project.schema.json, so if this PR will be merged, we should update https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json as well.