You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rush-plugins/rush-bridge-cache-plugin/README.md
+19-9Lines changed: 19 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Alternatively, the `--bridge-cache-action=read` parameter is useful for tasks su
8
8
9
9
## Here be dragons!
10
10
11
-
The `write` action for plugin assumes that the work for a particular task has already been completed and the build artifacts have been generated on disk. **If you run this command on a package where the command hasn't already been run and the build artifacts are missing or incorrect, you will cache invalid content**. Be careful and beware!
11
+
The `write` action for this plugin assumes that the work for a particular task has already been completed and the build artifacts have been generated on disk. **If you run this command on a package where the command hasn't already been run and the build artifacts are missing or incorrect, you will cache invalid content**. Be careful and beware! See the optional `requireOutputFoldersParameterName` setting below to include a safety check to require all expected output folders for a command to actually be on disk.
12
12
13
13
The `read` action for this plugin makes no guarantee that the requested operations will have their outputs restored and is purely a best-effort.
14
14
@@ -34,6 +34,14 @@ The `read` action for this plugin makes no guarantee that the requested operatio
34
34
"description": "When specified for any associated command, bypass running the command itself, and cache whatever outputs exist in the output folders as-is. Beware! Only run when you know the build artifacts are in a valid state for the command."
"description": "Optional flag that can be used in combination with --bridge-cache-action=write. When used, this will only populate a cache entry when all defined output folders for a command are present on disk.",
43
+
"parameterKind": "flag",
44
+
"longName": "--require-output-folders",
37
45
}
38
46
```
39
47
@@ -47,15 +55,20 @@ The `read` action for this plugin makes no guarantee that the requested operatio
47
55
```
48
56
49
57
4. Create a configuration file for this plugin at this location: `common/config/rush-plugins/rush-bridge-cache-plugin.json` that defines the flag name you'll use to trigger the plugin:
You can now use the parameter to have any Rush phased command either *only* restore from the cache (without any local building), or *only* write the cache, assuming all current output files are correct.
71
+
You can now use this plugin to have any Rush phased command either *only* restore from the cache (without any local building), or *only* write the cache, assuming all current output files are correct.
59
72
60
73
**Replay the cache entries for this command as best-effort, but don't execute any build processes**
That will populate the cache for `your-packageX` and all of its dependencies.
67
80
68
-
69
-
## Performance
70
-
71
-
When running within a pipeline, you may want to populate the cache as quickly as possible so local Rush users will benefit from the cached entry sooner. So instead of waiting until the full build graph has been processed, running it after each individual task when it's been completed, e.g.
72
-
73
-
`rush lint --only your-packageY --set-cache-only`
81
+
**Write whatever outputs are on disk for this command to the cache, but only if all output folders are present**
Copy file name to clipboardExpand all lines: rush-plugins/rush-bridge-cache-plugin/src/schemas/bridge-cache-config.schema.json
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,10 @@
10
10
"actionParameterName": {
11
11
"type": "string",
12
12
"description": "(Required) The name of the choice parameter used to trigger this plugin on your phased commands. It should accept two values, 'read' and 'write'."
13
+
},
14
+
"requireOutputFoldersParameterName": {
15
+
"type": "string",
16
+
"description": "(Optional) The name of the parameter used to specify whether the output folders must exist for the action in order to populate the cache."
0 commit comments