@rushstack/rush-http-build-cache-plugin 5.109.1 → 5.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/operation/_phase_build/all.log +6 -6
- package/.rush/temp/operation/_phase_build/state.json +1 -1
- package/.rush/temp/operation/_phase_test/all.log +15 -15
- package/.rush/temp/operation/_phase_test/state.json +1 -1
- package/.rush/temp/{rushstack+rush-http-build-cache-plugin-_phase_build-7d401680bf3bf0eed7a5fd5643898d15e32a9b69.tar.log → rushstack+rush-http-build-cache-plugin-_phase_build-6123140279635b4e69641307e04c82615d4a5778.tar.log} +2 -2
- package/.rush/temp/rushstack+rush-http-build-cache-plugin-_phase_build-6123140279635b4e69641307e04c82615d4a5778.untar.log +10 -0
- package/.rush/temp/{rushstack+rush-http-build-cache-plugin-_phase_test-feaedf2fd3e8683d195ad4842d74adbfdde78aee.tar.log → rushstack+rush-http-build-cache-plugin-_phase_test-78333a9310f75472822f70554dee637804eb3b97.tar.log} +2 -2
- package/.rush/temp/rushstack+rush-http-build-cache-plugin-_phase_test-78333a9310f75472822f70554dee637804eb3b97.untar.log +10 -0
- package/README.md +116 -116
- package/config/jest.config.json +14 -14
- package/config/rig.json +18 -18
- package/coverage/HttpBuildCacheProvider.ts.html +12 -12
- package/coverage/RushHttpBuildCachePlugin.ts.html +2 -2
- package/coverage/cobertura-coverage.xml +42 -42
- package/coverage/index.html +10 -10
- package/coverage/index.ts.html +1 -1
- package/coverage/junit.xml +4 -4
- package/lib/HttpBuildCacheProvider.d.ts +1 -2
- package/lib/HttpBuildCacheProvider.d.ts.map +1 -1
- package/lib/HttpBuildCacheProvider.js +4 -3
- package/lib/HttpBuildCacheProvider.js.map +1 -1
- package/lib/RushHttpBuildCachePlugin.js +1 -1
- package/lib/RushHttpBuildCachePlugin.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/schemas/plugin-config.schema.json +52 -52
- package/lib/test/HttpBuildCacheProvider.test.js +1 -1
- package/lib/test/HttpBuildCacheProvider.test.js.map +1 -1
- package/package.json +4 -4
- package/rush-logs/rush-http-build-cache-plugin._phase_build.cache.log +8 -7
- package/rush-logs/rush-http-build-cache-plugin._phase_build.log +6 -6
- package/rush-logs/rush-http-build-cache-plugin._phase_test.cache.log +17 -16
- package/rush-logs/rush-http-build-cache-plugin._phase_test.log +15 -15
- package/rush-plugin-manifest.json +11 -11
- package/src/HttpBuildCacheProvider.ts +424 -424
- package/src/RushHttpBuildCachePlugin.ts +81 -81
- package/src/index.ts +4 -4
- package/src/schemas/plugin-config.schema.json +52 -52
- package/src/test/HttpBuildCacheProvider.test.ts +115 -115
- package/temp/build/typescript/ts_l9Fw4VUO.json +1 -1
- package/tsconfig.json +3 -3
- package/.rush/temp/rushstack+rush-http-build-cache-plugin-_phase_build-7d401680bf3bf0eed7a5fd5643898d15e32a9b69.untar.log +0 -10
- package/.rush/temp/rushstack+rush-http-build-cache-plugin-_phase_test-feaedf2fd3e8683d195ad4842d74adbfdde78aee.untar.log +0 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Invoking: heft run --only build -- --clean --production
|
|
2
|
-
---- build started ----
|
|
3
|
-
[build:typescript] Using TypeScript version 5.0.4
|
|
4
|
-
[build:typescript] Copied 1 folder or file and linked 0 files
|
|
5
|
-
---- build finished (
|
|
6
|
-
-------------------- Finished (
|
|
1
|
+
Invoking: heft run --only build -- --clean --production
|
|
2
|
+
---- build started ----
|
|
3
|
+
[build:typescript] Using TypeScript version 5.0.4
|
|
4
|
+
[build:typescript] Copied 1 folder or file and linked 0 files
|
|
5
|
+
---- build finished (4.156s) ----
|
|
6
|
+
-------------------- Finished (4.163s) --------------------
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
Invoking: heft run --only test -- --clean --production
|
|
2
|
-
The provided list of phases does not contain all phase dependencies. You may need to run the excluded phases manually.
|
|
3
|
-
---- test started ----
|
|
4
|
-
[test:jest] Using Jest version 29.5.0
|
|
5
|
-
[test:jest]
|
|
6
|
-
[test:jest] Run start. 1 test suite
|
|
7
|
-
[test:jest] START lib
|
|
8
|
-
[test:jest] PASS lib
|
|
9
|
-
[test:jest]
|
|
10
|
-
[test:jest] Tests finished:
|
|
11
|
-
[test:jest] Successes: 2
|
|
12
|
-
[test:jest] Failures: 0
|
|
13
|
-
[test:jest] Total: 2
|
|
14
|
-
---- test finished (1.
|
|
15
|
-
-------------------- Finished (1.
|
|
1
|
+
Invoking: heft run --only test -- --clean --production
|
|
2
|
+
The provided list of phases does not contain all phase dependencies. You may need to run the excluded phases manually.
|
|
3
|
+
---- test started ----
|
|
4
|
+
[test:jest] Using Jest version 29.5.0
|
|
5
|
+
[test:jest]
|
|
6
|
+
[test:jest] Run start. 1 test suite
|
|
7
|
+
[test:jest] START lib\test\HttpBuildCacheProvider.test.js
|
|
8
|
+
[test:jest] PASS lib\test\HttpBuildCacheProvider.test.js (duration: 0.976s, 2 passed, 0 failed)
|
|
9
|
+
[test:jest]
|
|
10
|
+
[test:jest] Tests finished:
|
|
11
|
+
[test:jest] Successes: 2
|
|
12
|
+
[test:jest] Failures: 0
|
|
13
|
+
[test:jest] Total: 2
|
|
14
|
+
---- test finished (1.860s) ----
|
|
15
|
+
-------------------- Finished (1.866s) --------------------
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Start time:
|
|
2
|
-
Invoking "
|
|
1
|
+
Start time: Mon Oct 30 2023 23:21:22 GMT+0000 (Coordinated Universal Time)
|
|
2
|
+
Invoking "C:\Windows\system32\tar.exe -c -f D:\a\_work\1\s\common\temp\build-cache\rushstack+rush-http-build-cache-plugin-_phase_build-6123140279635b4e69641307e04c82615d4a5778-2af28b40a6505109.temp -z --files-from=-"
|
|
3
3
|
|
|
4
4
|
======= BEGIN PROCESS INPUT ======
|
|
5
5
|
.rush/temp/operation/_phase_build/all.log
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Start time: Mon Oct 30 2023 23:36:29 GMT+0000 (Coordinated Universal Time)
|
|
2
|
+
Invoking "C:\Windows\system32\tar.exe -x -m -f D:\a\_work\1\s\common\temp\build-cache\rushstack+rush-http-build-cache-plugin-_phase_build-6123140279635b4e69641307e04c82615d4a5778"
|
|
3
|
+
|
|
4
|
+
======= BEGIN PROCESS INPUT ======
|
|
5
|
+
|
|
6
|
+
======== END PROCESS INPUT =======
|
|
7
|
+
======= BEGIN PROCESS OUTPUT =======
|
|
8
|
+
======== END PROCESS OUTPUT ========
|
|
9
|
+
|
|
10
|
+
Exited with code "0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Start time:
|
|
2
|
-
Invoking "
|
|
1
|
+
Start time: Mon Oct 30 2023 23:23:10 GMT+0000 (Coordinated Universal Time)
|
|
2
|
+
Invoking "C:\Windows\system32\tar.exe -c -f D:\a\_work\1\s\common\temp\build-cache\rushstack+rush-http-build-cache-plugin-_phase_test-78333a9310f75472822f70554dee637804eb3b97-bff6412c018e4375.temp -z --files-from=-"
|
|
3
3
|
|
|
4
4
|
======= BEGIN PROCESS INPUT ======
|
|
5
5
|
.rush/temp/operation/_phase_test/all.log
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Start time: Mon Oct 30 2023 23:36:29 GMT+0000 (Coordinated Universal Time)
|
|
2
|
+
Invoking "C:\Windows\system32\tar.exe -x -m -f D:\a\_work\1\s\common\temp\build-cache\rushstack+rush-http-build-cache-plugin-_phase_test-78333a9310f75472822f70554dee637804eb3b97"
|
|
3
|
+
|
|
4
|
+
======= BEGIN PROCESS INPUT ======
|
|
5
|
+
|
|
6
|
+
======== END PROCESS INPUT =======
|
|
7
|
+
======= BEGIN PROCESS OUTPUT =======
|
|
8
|
+
======== END PROCESS OUTPUT ========
|
|
9
|
+
|
|
10
|
+
Exited with code "0"
|
package/README.md
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
# @rushstack/rush-http-build-cache-plugin
|
|
2
|
-
|
|
3
|
-
A Rush plugin that uses HTTP/HTTPS to manage cache objects.
|
|
4
|
-
|
|
5
|
-
Authentication is provided via standard `Authorization` HTTP headers, with the value (a Bearer or Basic token) configured using a custom node script. Your "tokenHandler" node script is automatically called when the user updates their cloud credentials.
|
|
6
|
-
|
|
7
|
-
## Configuration
|
|
8
|
-
|
|
9
|
-
To use the HTTP build cache plugin, enable it in `common/config/rush/build-cache.json`:
|
|
10
|
-
|
|
11
|
-
```json
|
|
12
|
-
{
|
|
13
|
-
"buildCacheEnabled": true,
|
|
14
|
-
|
|
15
|
-
"cacheProvider": "http"
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Then customize the `httpConfiguration` block. For typical use cases, where you'll use a remote HTTP URL with authentication, you'll need to provide at least the `url` and `tokenHandler` options:
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"httpConfiguration": {
|
|
24
|
-
"url": "https://build-cache.example.com",
|
|
25
|
-
"tokenHandler": {
|
|
26
|
-
"exec": "node",
|
|
27
|
-
"args": ["common/scripts/custom-script-that-returns-an-authentication-header.js"]
|
|
28
|
-
},
|
|
29
|
-
"isCacheWriteAllowed": false
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
(For more detail on the above properties and additional optional properties, consult the default `build-cache.json` file.)
|
|
35
|
-
|
|
36
|
-
## Authorization Details
|
|
37
|
-
|
|
38
|
-
The HTTP build cache plugin offloads authorization to an external executable script that you define. A typical use case would be to create a simple script, for example `common/scripts/cache-auth.js`, that prints an Authorization header value when executed.
|
|
39
|
-
|
|
40
|
-
For example:
|
|
41
|
-
|
|
42
|
-
```console
|
|
43
|
-
node common/scripts/cache-auth.js
|
|
44
|
-
# => Bearer 0284357923592790DDb979dBcd2zz
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
How the script generates authorization values is up to you, and depends on the configuration of your remote cache server.
|
|
48
|
-
|
|
49
|
-
Possible implementations:
|
|
50
|
-
|
|
51
|
-
- The script could read simple environment variables (`CACHE_USER` and `CACHE_TOKEN`) defined by the developer
|
|
52
|
-
- It could reuse existing credentials your developers have, like NPM tokens, GitHub credentials, or jFrog API tokens
|
|
53
|
-
- It could make an HTTP call to another server accessible by your developers that returns temporary credentials
|
|
54
|
-
|
|
55
|
-
## HTTP Cache Server Requirements
|
|
56
|
-
|
|
57
|
-
The HTTP build cache plugin can use almost any HTTP/HTTPS backend for remote caching, as long as it honors the following rules:
|
|
58
|
-
|
|
59
|
-
- Uses `Authorization: Bearer xxx` or `Authorization: Basic xxx` headers for authentication.
|
|
60
|
-
- Accepts GET requests for cache reads.
|
|
61
|
-
- Accepts PUT requests for cache writes (with a raw request body -- no `form/multipart` MIME types).
|
|
62
|
-
- Cache hits return HTTP 200 with the file in the response body.
|
|
63
|
-
- Successful cache writes return HTTP 2xx (200-299).
|
|
64
|
-
- Cache misses return HTTP 404 or HTTP 403.
|
|
65
|
-
- Invalid or missing authentication returns HTTP 401.
|
|
66
|
-
|
|
67
|
-
## Examples
|
|
68
|
-
|
|
69
|
-
### Gradle Build Cache Server
|
|
70
|
-
|
|
71
|
-
The Gradle Build Cache Server (typically used to support Gradle Remote Build Cache) meets all of the requirements above, so if you don't have another server in mind, you can use it as your remote backend.
|
|
72
|
-
|
|
73
|
-
First, start up and configure your build cache node locally:
|
|
74
|
-
|
|
75
|
-
- Download latest JAR file from https://docs.gradle.com/build-cache-node/
|
|
76
|
-
- Start the service: `java -jar build-cache-node-14.0.jar start`
|
|
77
|
-
- Copy the startup banner information, and navigate to the specified localhost port
|
|
78
|
-
- Enter the temporary username/password credentials printed in the startup banner
|
|
79
|
-
- Click Build Cache > Settings > Cache Access Control and grant "Read & write" access to Anonymous
|
|
80
|
-
|
|
81
|
-
Second, configure your `build-cache.json` file as described in the Configuration section:
|
|
82
|
-
|
|
83
|
-
- Note that your `url` must end with `/cache/`, for example, `http://localhost:5071/cache/`.
|
|
84
|
-
- To test reading and writing, set `isCacheWriteAllowed: true`.
|
|
85
|
-
- Configure `tokenHandler` to point to a script that prints a Basic or Bearer Authorization value (this can be a dummy string if you granted Read and Write to Anonymous in your build cache node configuration).
|
|
86
|
-
|
|
87
|
-
Note that the Gradle Build Cache Server has a stricter format for its cache keys (they should be a simple hexadecimal hash with no non-alphanumeric characters). Configure this setting in your `build-cache.json` file:
|
|
88
|
-
|
|
89
|
-
```json
|
|
90
|
-
{
|
|
91
|
-
"cacheEntryNamePattern": "[hash]"
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Last, initialize your cache credentials using Rush:
|
|
96
|
-
|
|
97
|
-
```console
|
|
98
|
-
rush update-cloud-credentials --interactive
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
To test out your remote build cache with full debugging output (for spotting any errors reading or writing the cache), run with the `--debug` flag:
|
|
102
|
-
|
|
103
|
-
```console
|
|
104
|
-
rush --debug build --verbose
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
> If you go on to deploy Rush remote build caching to your developers using the Gradle Build Cache, update your `tokenHandler`
|
|
108
|
-
> script to reflect your use case -- for example, you could require each developer to have a designated username/token configured
|
|
109
|
-
> via environment variables, and configure Cache Access Control with the corresponding entries. In this case the `tokenHandler`
|
|
110
|
-
> script should read the environment variables and print out an Authorization header, for example:
|
|
111
|
-
>
|
|
112
|
-
> ```javascript
|
|
113
|
-
> // common/scripts/build-cache-auth.js
|
|
114
|
-
> const credentials = `${process.env.CACHE_USER}:${process.env.CACHE_TOKEN}`;
|
|
115
|
-
> console.log('Basic ' + Buffer.from(credentials).toString('base64'));
|
|
116
|
-
> ```
|
|
1
|
+
# @rushstack/rush-http-build-cache-plugin
|
|
2
|
+
|
|
3
|
+
A Rush plugin that uses HTTP/HTTPS to manage cache objects.
|
|
4
|
+
|
|
5
|
+
Authentication is provided via standard `Authorization` HTTP headers, with the value (a Bearer or Basic token) configured using a custom node script. Your "tokenHandler" node script is automatically called when the user updates their cloud credentials.
|
|
6
|
+
|
|
7
|
+
## Configuration
|
|
8
|
+
|
|
9
|
+
To use the HTTP build cache plugin, enable it in `common/config/rush/build-cache.json`:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"buildCacheEnabled": true,
|
|
14
|
+
|
|
15
|
+
"cacheProvider": "http"
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then customize the `httpConfiguration` block. For typical use cases, where you'll use a remote HTTP URL with authentication, you'll need to provide at least the `url` and `tokenHandler` options:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"httpConfiguration": {
|
|
24
|
+
"url": "https://build-cache.example.com",
|
|
25
|
+
"tokenHandler": {
|
|
26
|
+
"exec": "node",
|
|
27
|
+
"args": ["common/scripts/custom-script-that-returns-an-authentication-header.js"]
|
|
28
|
+
},
|
|
29
|
+
"isCacheWriteAllowed": false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
(For more detail on the above properties and additional optional properties, consult the default `build-cache.json` file.)
|
|
35
|
+
|
|
36
|
+
## Authorization Details
|
|
37
|
+
|
|
38
|
+
The HTTP build cache plugin offloads authorization to an external executable script that you define. A typical use case would be to create a simple script, for example `common/scripts/cache-auth.js`, that prints an Authorization header value when executed.
|
|
39
|
+
|
|
40
|
+
For example:
|
|
41
|
+
|
|
42
|
+
```console
|
|
43
|
+
node common/scripts/cache-auth.js
|
|
44
|
+
# => Bearer 0284357923592790DDb979dBcd2zz
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
How the script generates authorization values is up to you, and depends on the configuration of your remote cache server.
|
|
48
|
+
|
|
49
|
+
Possible implementations:
|
|
50
|
+
|
|
51
|
+
- The script could read simple environment variables (`CACHE_USER` and `CACHE_TOKEN`) defined by the developer
|
|
52
|
+
- It could reuse existing credentials your developers have, like NPM tokens, GitHub credentials, or jFrog API tokens
|
|
53
|
+
- It could make an HTTP call to another server accessible by your developers that returns temporary credentials
|
|
54
|
+
|
|
55
|
+
## HTTP Cache Server Requirements
|
|
56
|
+
|
|
57
|
+
The HTTP build cache plugin can use almost any HTTP/HTTPS backend for remote caching, as long as it honors the following rules:
|
|
58
|
+
|
|
59
|
+
- Uses `Authorization: Bearer xxx` or `Authorization: Basic xxx` headers for authentication.
|
|
60
|
+
- Accepts GET requests for cache reads.
|
|
61
|
+
- Accepts PUT requests for cache writes (with a raw request body -- no `form/multipart` MIME types).
|
|
62
|
+
- Cache hits return HTTP 200 with the file in the response body.
|
|
63
|
+
- Successful cache writes return HTTP 2xx (200-299).
|
|
64
|
+
- Cache misses return HTTP 404 or HTTP 403.
|
|
65
|
+
- Invalid or missing authentication returns HTTP 401.
|
|
66
|
+
|
|
67
|
+
## Examples
|
|
68
|
+
|
|
69
|
+
### Gradle Build Cache Server
|
|
70
|
+
|
|
71
|
+
The Gradle Build Cache Server (typically used to support Gradle Remote Build Cache) meets all of the requirements above, so if you don't have another server in mind, you can use it as your remote backend.
|
|
72
|
+
|
|
73
|
+
First, start up and configure your build cache node locally:
|
|
74
|
+
|
|
75
|
+
- Download latest JAR file from https://docs.gradle.com/build-cache-node/
|
|
76
|
+
- Start the service: `java -jar build-cache-node-14.0.jar start`
|
|
77
|
+
- Copy the startup banner information, and navigate to the specified localhost port
|
|
78
|
+
- Enter the temporary username/password credentials printed in the startup banner
|
|
79
|
+
- Click Build Cache > Settings > Cache Access Control and grant "Read & write" access to Anonymous
|
|
80
|
+
|
|
81
|
+
Second, configure your `build-cache.json` file as described in the Configuration section:
|
|
82
|
+
|
|
83
|
+
- Note that your `url` must end with `/cache/`, for example, `http://localhost:5071/cache/`.
|
|
84
|
+
- To test reading and writing, set `isCacheWriteAllowed: true`.
|
|
85
|
+
- Configure `tokenHandler` to point to a script that prints a Basic or Bearer Authorization value (this can be a dummy string if you granted Read and Write to Anonymous in your build cache node configuration).
|
|
86
|
+
|
|
87
|
+
Note that the Gradle Build Cache Server has a stricter format for its cache keys (they should be a simple hexadecimal hash with no non-alphanumeric characters). Configure this setting in your `build-cache.json` file:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"cacheEntryNamePattern": "[hash]"
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Last, initialize your cache credentials using Rush:
|
|
96
|
+
|
|
97
|
+
```console
|
|
98
|
+
rush update-cloud-credentials --interactive
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
To test out your remote build cache with full debugging output (for spotting any errors reading or writing the cache), run with the `--debug` flag:
|
|
102
|
+
|
|
103
|
+
```console
|
|
104
|
+
rush --debug build --verbose
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
> If you go on to deploy Rush remote build caching to your developers using the Gradle Build Cache, update your `tokenHandler`
|
|
108
|
+
> script to reflect your use case -- for example, you could require each developer to have a designated username/token configured
|
|
109
|
+
> via environment variables, and configure Cache Access Control with the corresponding entries. In this case the `tokenHandler`
|
|
110
|
+
> script should read the environment variables and print out an Authorization header, for example:
|
|
111
|
+
>
|
|
112
|
+
> ```javascript
|
|
113
|
+
> // common/scripts/build-cache-auth.js
|
|
114
|
+
> const credentials = `${process.env.CACHE_USER}:${process.env.CACHE_TOKEN}`;
|
|
115
|
+
> console.log('Basic ' + Buffer.from(credentials).toString('base64'));
|
|
116
|
+
> ```
|
package/config/jest.config.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "local-node-rig/profiles/default/config/jest.config.json",
|
|
3
|
-
"clearMocks": true,
|
|
4
|
-
"restoreMocks": true,
|
|
5
|
-
"collectCoverage": true,
|
|
6
|
-
"coverageThreshold": {
|
|
7
|
-
"global": {
|
|
8
|
-
"branches": 4,
|
|
9
|
-
"functions": 15,
|
|
10
|
-
"lines": 4,
|
|
11
|
-
"statements": 4
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "local-node-rig/profiles/default/config/jest.config.json",
|
|
3
|
+
"clearMocks": true,
|
|
4
|
+
"restoreMocks": true,
|
|
5
|
+
"collectCoverage": true,
|
|
6
|
+
"coverageThreshold": {
|
|
7
|
+
"global": {
|
|
8
|
+
"branches": 4,
|
|
9
|
+
"functions": 15,
|
|
10
|
+
"lines": 4,
|
|
11
|
+
"statements": 4
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/config/rig.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
// The "rig.json" file directs tools to look for their config files in an external package.
|
|
3
|
-
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
|
|
4
|
-
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* (Required) The name of the rig package to inherit from.
|
|
8
|
-
* It should be an NPM package name with the "-rig" suffix.
|
|
9
|
-
*/
|
|
10
|
-
"rigPackageName": "local-node-rig",
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* (Optional) Selects a config profile from the rig package. The name must consist of
|
|
14
|
-
* lowercase alphanumeric words separated by hyphens, for example "sample-profile".
|
|
15
|
-
* If omitted, then the "default" profile will be used."
|
|
16
|
-
*/
|
|
17
|
-
"rigProfile": "default"
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
// The "rig.json" file directs tools to look for their config files in an external package.
|
|
3
|
+
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
|
|
4
|
+
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* (Required) The name of the rig package to inherit from.
|
|
8
|
+
* It should be an NPM package name with the "-rig" suffix.
|
|
9
|
+
*/
|
|
10
|
+
"rigPackageName": "local-node-rig",
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* (Optional) Selects a config profile from the rig package. The name must consist of
|
|
14
|
+
* lowercase alphanumeric words separated by hyphens, for example "sample-profile".
|
|
15
|
+
* If omitted, then the "default" profile will be used."
|
|
16
|
+
*/
|
|
17
|
+
"rigProfile": "default"
|
|
18
|
+
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">65.
|
|
26
|
+
<span class="strong">65.09% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>276/424</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">65.
|
|
47
|
+
<span class="strong">65.09% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>276/424</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -548,7 +548,6 @@
|
|
|
548
548
|
<span class="cline-any cline-yes">1x</span>
|
|
549
549
|
<span class="cline-any cline-yes">1x</span>
|
|
550
550
|
<span class="cline-any cline-yes">1x</span>
|
|
551
|
-
<span class="cline-any cline-yes">1x</span>
|
|
552
551
|
<span class="cline-any cline-no"> </span>
|
|
553
552
|
<span class="cline-any cline-no"> </span>
|
|
554
553
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -565,7 +564,6 @@
|
|
|
565
564
|
<span class="cline-any cline-yes">2x</span>
|
|
566
565
|
<span class="cline-any cline-yes">2x</span>
|
|
567
566
|
<span class="cline-any cline-yes">2x</span>
|
|
568
|
-
<span class="cline-any cline-yes">2x</span>
|
|
569
567
|
<span class="cline-any cline-yes">1x</span>
|
|
570
568
|
<span class="cline-any cline-yes">1x</span>
|
|
571
569
|
<span class="cline-any cline-yes">2x</span>
|
|
@@ -660,6 +658,8 @@
|
|
|
660
658
|
<span class="cline-any cline-no"> </span>
|
|
661
659
|
<span class="cline-any cline-no"> </span>
|
|
662
660
|
<span class="cline-any cline-no"> </span>
|
|
661
|
+
<span class="cline-any cline-no"> </span>
|
|
662
|
+
<span class="cline-any cline-no"> </span>
|
|
663
663
|
<span class="cline-any cline-yes">1x</span>
|
|
664
664
|
<span class="cline-any cline-yes">1x</span>
|
|
665
665
|
<span class="cline-any cline-no"> </span>
|
|
@@ -952,7 +952,7 @@ export interface IHttpBuildCacheProviderOptions {
|
|
|
952
952
|
cacheKeyPrefix?: string;
|
|
953
953
|
isCacheWriteAllowed: boolean;
|
|
954
954
|
pluginName: string;
|
|
955
|
-
|
|
955
|
+
rushJsonFolder: string;
|
|
956
956
|
}
|
|
957
957
|
|
|
958
958
|
const MAX_HTTP_CACHE_ATTEMPTS: number = 3;
|
|
@@ -960,7 +960,6 @@ const DEFAULT_MIN_HTTP_RETRY_DELAY_MS = 2500;
|
|
|
960
960
|
|
|
961
961
|
export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
962
962
|
private readonly _pluginName: string;
|
|
963
|
-
private readonly _rushSession: RushSession;
|
|
964
963
|
private readonly _rushProjectRoot: string;
|
|
965
964
|
private readonly _environmentCredential: string | undefined;
|
|
966
965
|
private readonly _isCacheWriteAllowedByConfiguration: boolean;
|
|
@@ -978,8 +977,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
978
977
|
|
|
979
978
|
public constructor(options: IHttpBuildCacheProviderOptions, rushSession: RushSession) {
|
|
980
979
|
this._pluginName = options.pluginName;
|
|
981
|
-
this.
|
|
982
|
-
this._rushProjectRoot = options.rushProjectRoot;
|
|
980
|
+
this._rushProjectRoot = options.rushJsonFolder;
|
|
983
981
|
|
|
984
982
|
this._environmentCredential = EnvironmentConfiguration.buildCacheCredential;
|
|
985
983
|
this._isCacheWriteAllowedByConfiguration = options.isCacheWriteAllowed;
|
|
@@ -1069,7 +1067,9 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1069
1067
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
1070
1068
|
<span class="cstat-no" title="statement not covered" > const cmd: string = `${this._tokenHandler.exec} ${(this._tokenHandler.args || []).join(' ')}`;</span>
|
|
1071
1069
|
<span class="cstat-no" title="statement not covered" > terminal.writeVerboseLine(`Running '${cmd}' to get credentials`);</span>
|
|
1072
|
-
<span class="cstat-no" title="statement not covered" > const result = Executable.spawnSync(this._tokenHandler.exec, this._tokenHandler.args || []
|
|
1070
|
+
<span class="cstat-no" title="statement not covered" > const result = Executable.spawnSync(this._tokenHandler.exec, this._tokenHandler.args || [], {</span>
|
|
1071
|
+
<span class="cstat-no" title="statement not covered" > currentWorkingDirectory: this._rushProjectRoot</span>
|
|
1072
|
+
<span class="cstat-no" title="statement not covered" > });</span>
|
|
1073
1073
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
1074
1074
|
<span class="cstat-no" title="statement not covered" > terminal.writeErrorLine(result.stderr);</span>
|
|
1075
1075
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
@@ -1342,7 +1342,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1342
1342
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1343
1343
|
Code coverage generated by
|
|
1344
1344
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1345
|
-
at 2023-10-
|
|
1345
|
+
at 2023-10-30T23:23:10.071Z
|
|
1346
1346
|
</div>
|
|
1347
1347
|
<script src="prettify.js"></script>
|
|
1348
1348
|
<script>
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
292
292
|
<span class="cstat-no" title="statement not covered" > const options: IHttpBuildCacheProviderOptions = {</span>
|
|
293
293
|
<span class="cstat-no" title="statement not covered" > pluginName: this.pluginName,</span>
|
|
294
|
-
<span class="cstat-no" title="statement not covered" >
|
|
294
|
+
<span class="cstat-no" title="statement not covered" > rushJsonFolder: rushConfig.rushJsonFolder,</span>
|
|
295
295
|
<span class="cstat-no" title="statement not covered" > url: url,</span>
|
|
296
296
|
<span class="cstat-no" title="statement not covered" > uploadMethod: uploadMethod,</span>
|
|
297
297
|
<span class="cstat-no" title="statement not covered" > headers: headers,</span>
|
|
@@ -313,7 +313,7 @@
|
|
|
313
313
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
314
314
|
Code coverage generated by
|
|
315
315
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
316
|
-
at 2023-10-
|
|
316
|
+
at 2023-10-30T23:23:10.071Z
|
|
317
317
|
</div>
|
|
318
318
|
<script src="prettify.js"></script>
|
|
319
319
|
<script>
|