@rushstack/rush-http-build-cache-plugin 5.113.3 → 5.114.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/.eslintrc.js +12 -0
- package/.rush/temp/operation/_phase_build/all.log +3 -2
- package/.rush/temp/operation/_phase_build/state.json +1 -1
- package/.rush/temp/operation/_phase_test/all.log +3 -3
- package/.rush/temp/operation/_phase_test/state.json +1 -1
- package/.rush/temp/{rushstack+rush-http-build-cache-plugin-_phase_build-7181ffda50e9cb42b5cdec91b6f8aec77466b67a.tar.log → rushstack+rush-http-build-cache-plugin-_phase_build-bdf30e460f994579fa5d5b8a382c75152ff42394.tar.log} +3 -2
- package/.rush/temp/{rushstack+rush-http-build-cache-plugin-_phase_build-7181ffda50e9cb42b5cdec91b6f8aec77466b67a.untar.log → rushstack+rush-http-build-cache-plugin-_phase_build-bdf30e460f994579fa5d5b8a382c75152ff42394.untar.log} +2 -2
- package/.rush/temp/{rushstack+rush-http-build-cache-plugin-_phase_test-14d46fb78397843cb544549cec510f0927403668.tar.log → rushstack+rush-http-build-cache-plugin-_phase_test-76e145455db25f136523ab72c2aaed644e2abb26.tar.log} +2 -2
- package/.rush/temp/{rushstack+rush-http-build-cache-plugin-_phase_test-14d46fb78397843cb544549cec510f0927403668.untar.log → rushstack+rush-http-build-cache-plugin-_phase_test-76e145455db25f136523ab72c2aaed644e2abb26.untar.log} +2 -2
- package/.rush/temp/shrinkwrap-deps.json +1 -1
- package/coverage/HttpBuildCacheProvider.ts.html +53 -26
- package/coverage/RushHttpBuildCachePlugin.ts.html +2 -2
- package/coverage/cobertura-coverage.xml +257 -245
- package/coverage/index.html +13 -13
- package/coverage/index.ts.html +14 -5
- package/coverage/junit.xml +4 -4
- package/lib/HttpBuildCacheProvider.d.ts +2 -2
- package/lib/HttpBuildCacheProvider.d.ts.map +1 -1
- package/lib/HttpBuildCacheProvider.js +2 -0
- package/lib/HttpBuildCacheProvider.js.map +1 -1
- package/lib/RushHttpBuildCachePlugin.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/test/HttpBuildCacheProvider.test.js +3 -3
- package/lib/test/HttpBuildCacheProvider.test.js.map +1 -1
- package/package.json +6 -5
- package/rush-logs/rush-http-build-cache-plugin._phase_build.cache.log +4 -3
- package/rush-logs/rush-http-build-cache-plugin._phase_build.log +3 -2
- package/rush-logs/rush-http-build-cache-plugin._phase_test.cache.log +4 -4
- package/rush-logs/rush-http-build-cache-plugin._phase_test.log +3 -3
- package/src/HttpBuildCacheProvider.ts +29 -20
- package/src/RushHttpBuildCachePlugin.ts +1 -1
- package/src/index.ts +3 -0
- package/src/test/HttpBuildCacheProvider.test.ts +2 -2
- package/temp/build/lint/_eslint-it73M-Rx.json +21 -0
- package/temp/build/typescript/ts_l9Fw4VUO.json +1 -1
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
|
|
2
|
+
require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution');
|
|
3
|
+
// This is a workaround for https://github.com/microsoft/rushstack/issues/3021
|
|
4
|
+
require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
extends: [
|
|
8
|
+
'local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool',
|
|
9
|
+
'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals'
|
|
10
|
+
],
|
|
11
|
+
parserOptions: { tsconfigRootDir: __dirname }
|
|
12
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Invoking: heft run --only build -- --clean --production
|
|
2
2
|
---- build started ----
|
|
3
3
|
[build:typescript] Using TypeScript version 5.3.3
|
|
4
|
+
[build:lint] Using ESLint version 8.7.0
|
|
4
5
|
[build:typescript] Copied 1 folder or file and linked 0 files
|
|
5
|
-
---- build finished (
|
|
6
|
-
-------------------- Finished (
|
|
6
|
+
---- build finished (8.378s) ----
|
|
7
|
+
-------------------- Finished (8.405s) --------------------
|
|
@@ -5,11 +5,11 @@ The provided list of phases does not contain all phase dependencies. You may nee
|
|
|
5
5
|
[test:jest]
|
|
6
6
|
[test:jest] Run start. 1 test suite
|
|
7
7
|
[test:jest] START lib/test/HttpBuildCacheProvider.test.js
|
|
8
|
-
[test:jest] PASS lib/test/HttpBuildCacheProvider.test.js (duration: 1.
|
|
8
|
+
[test:jest] PASS lib/test/HttpBuildCacheProvider.test.js (duration: 1.559s, 2 passed, 0 failed)
|
|
9
9
|
[test:jest]
|
|
10
10
|
[test:jest] Tests finished:
|
|
11
11
|
[test:jest] Successes: 2
|
|
12
12
|
[test:jest] Failures: 0
|
|
13
13
|
[test:jest] Total: 2
|
|
14
|
-
---- test finished (
|
|
15
|
-
-------------------- Finished (
|
|
14
|
+
---- test finished (3.393s) ----
|
|
15
|
+
-------------------- Finished (3.401s) --------------------
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Start time:
|
|
2
|
-
Invoking "/usr/bin/tar -c -f /mnt/vss/_work/1/s/common/temp/build-cache/rushstack+rush-http-build-cache-plugin-_phase_build-
|
|
1
|
+
Start time: Mon Feb 19 2024 21:52:42 GMT+0000 (Coordinated Universal Time)
|
|
2
|
+
Invoking "/usr/bin/tar -c -f /mnt/vss/_work/1/s/common/temp/build-cache/rushstack+rush-http-build-cache-plugin-_phase_build-bdf30e460f994579fa5d5b8a382c75152ff42394-16011c4a1d5735d8.temp -z --files-from=-"
|
|
3
3
|
|
|
4
4
|
======= BEGIN PROCESS INPUT ======
|
|
5
5
|
.rush/temp/operation/_phase_build/all.log
|
|
@@ -21,6 +21,7 @@ lib/test/HttpBuildCacheProvider.test.d.ts
|
|
|
21
21
|
lib/test/HttpBuildCacheProvider.test.d.ts.map
|
|
22
22
|
lib/test/HttpBuildCacheProvider.test.js
|
|
23
23
|
lib/test/HttpBuildCacheProvider.test.js.map
|
|
24
|
+
temp/build/lint/_eslint-it73M-Rx.json
|
|
24
25
|
temp/build/typescript/ts_l9Fw4VUO.json
|
|
25
26
|
======== END PROCESS INPUT =======
|
|
26
27
|
======= BEGIN PROCESS OUTPUT =======
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Start time:
|
|
2
|
-
Invoking "/usr/bin/tar -x -m -f /mnt/vss/_work/1/s/common/temp/build-cache/rushstack+rush-http-build-cache-plugin-_phase_build-
|
|
1
|
+
Start time: Mon Feb 19 2024 21:54:24 GMT+0000 (Coordinated Universal Time)
|
|
2
|
+
Invoking "/usr/bin/tar -x -m -f /mnt/vss/_work/1/s/common/temp/build-cache/rushstack+rush-http-build-cache-plugin-_phase_build-bdf30e460f994579fa5d5b8a382c75152ff42394"
|
|
3
3
|
|
|
4
4
|
======= BEGIN PROCESS INPUT ======
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Start time:
|
|
2
|
-
Invoking "/usr/bin/tar -c -f /mnt/vss/_work/1/s/common/temp/build-cache/rushstack+rush-http-build-cache-plugin-_phase_test-
|
|
1
|
+
Start time: Mon Feb 19 2024 21:52:46 GMT+0000 (Coordinated Universal Time)
|
|
2
|
+
Invoking "/usr/bin/tar -c -f /mnt/vss/_work/1/s/common/temp/build-cache/rushstack+rush-http-build-cache-plugin-_phase_test-76e145455db25f136523ab72c2aaed644e2abb26-577bbcf170c05a4e.temp -z --files-from=-"
|
|
3
3
|
|
|
4
4
|
======= BEGIN PROCESS INPUT ======
|
|
5
5
|
.rush/temp/operation/_phase_test/all.log
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Start time:
|
|
2
|
-
Invoking "/usr/bin/tar -x -m -f /mnt/vss/_work/1/s/common/temp/build-cache/rushstack+rush-http-build-cache-plugin-_phase_test-
|
|
1
|
+
Start time: Mon Feb 19 2024 21:54:24 GMT+0000 (Coordinated Universal Time)
|
|
2
|
+
Invoking "/usr/bin/tar -x -m -f /mnt/vss/_work/1/s/common/temp/build-cache/rushstack+rush-http-build-cache-plugin-_phase_test-76e145455db25f136523ab72c2aaed644e2abb26"
|
|
3
3
|
|
|
4
4
|
======= BEGIN PROCESS INPUT ======
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"../../rush-plugins/rush-http-build-cache-plugin": "../../rush-plugins/rush-http-build-cache-plugin:
|
|
2
|
+
"../../rush-plugins/rush-http-build-cache-plugin": "../../rush-plugins/rush-http-build-cache-plugin:cNBg/EFP7SVuA8cyjjufadM11GkM/nl9F4T8neVJTL0=:",
|
|
3
3
|
"/@types/node-fetch@2.6.2": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
|
|
4
4
|
"/@types/node@18.17.15": "sha512-2yrWpBk32tvV/JAd3HNHWuZn/VDN1P+72hWirHnvsvTGSqbANi+kSeuQR9yAHnbvaBvHDsoTdXV0Fe+iRtHLKA==",
|
|
5
5
|
"/agent-base@6.0.2": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">64.89% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>281/433</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">
|
|
47
|
+
<span class="strong">64.89% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>281/433</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -487,7 +487,21 @@
|
|
|
487
487
|
<a name='L422'></a><a href='#L422'>422</a>
|
|
488
488
|
<a name='L423'></a><a href='#L423'>423</a>
|
|
489
489
|
<a name='L424'></a><a href='#L424'>424</a>
|
|
490
|
-
<a name='L425'></a><a href='#L425'>425</a
|
|
490
|
+
<a name='L425'></a><a href='#L425'>425</a>
|
|
491
|
+
<a name='L426'></a><a href='#L426'>426</a>
|
|
492
|
+
<a name='L427'></a><a href='#L427'>427</a>
|
|
493
|
+
<a name='L428'></a><a href='#L428'>428</a>
|
|
494
|
+
<a name='L429'></a><a href='#L429'>429</a>
|
|
495
|
+
<a name='L430'></a><a href='#L430'>430</a>
|
|
496
|
+
<a name='L431'></a><a href='#L431'>431</a>
|
|
497
|
+
<a name='L432'></a><a href='#L432'>432</a>
|
|
498
|
+
<a name='L433'></a><a href='#L433'>433</a>
|
|
499
|
+
<a name='L434'></a><a href='#L434'>434</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
500
|
+
<span class="cline-any cline-yes">1x</span>
|
|
501
|
+
<span class="cline-any cline-yes">1x</span>
|
|
502
|
+
<span class="cline-any cline-yes">1x</span>
|
|
503
|
+
<span class="cline-any cline-yes">1x</span>
|
|
504
|
+
<span class="cline-any cline-yes">1x</span>
|
|
491
505
|
<span class="cline-any cline-yes">1x</span>
|
|
492
506
|
<span class="cline-any cline-yes">1x</span>
|
|
493
507
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -660,6 +674,10 @@
|
|
|
660
674
|
<span class="cline-any cline-no"> </span>
|
|
661
675
|
<span class="cline-any cline-no"> </span>
|
|
662
676
|
<span class="cline-any cline-no"> </span>
|
|
677
|
+
<span class="cline-any cline-no"> </span>
|
|
678
|
+
<span class="cline-any cline-no"> </span>
|
|
679
|
+
<span class="cline-any cline-no"> </span>
|
|
680
|
+
<span class="cline-any cline-no"> </span>
|
|
663
681
|
<span class="cline-any cline-yes">1x</span>
|
|
664
682
|
<span class="cline-any cline-yes">1x</span>
|
|
665
683
|
<span class="cline-any cline-no"> </span>
|
|
@@ -911,15 +929,20 @@
|
|
|
911
929
|
<span class="cline-any cline-yes">1x</span>
|
|
912
930
|
<span class="cline-any cline-yes">1x</span>
|
|
913
931
|
<span class="cline-any cline-yes">1x</span>
|
|
914
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js"
|
|
932
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
933
|
+
// See LICENSE in the project root for license information.
|
|
934
|
+
|
|
935
|
+
import { Executable, Async } from '@rushstack/node-core-library';
|
|
936
|
+
import type { ITerminal } from '@rushstack/terminal';
|
|
915
937
|
import {
|
|
916
|
-
ICloudBuildCacheProvider,
|
|
917
|
-
ICredentialCacheEntry,
|
|
938
|
+
type ICloudBuildCacheProvider,
|
|
939
|
+
type ICredentialCacheEntry,
|
|
918
940
|
CredentialCache,
|
|
919
|
-
RushSession,
|
|
941
|
+
type RushSession,
|
|
920
942
|
EnvironmentConfiguration
|
|
921
943
|
} from '@rushstack/rush-sdk';
|
|
922
|
-
import fetch, { BodyInit, Response } from 'node-fetch';
|
|
944
|
+
import fetch, { type BodyInit, type Response } from 'node-fetch';
|
|
945
|
+
import type { SpawnSyncReturns } from 'child_process';
|
|
923
946
|
|
|
924
947
|
enum CredentialsOptions {
|
|
925
948
|
Optional,
|
|
@@ -956,7 +979,7 @@ export interface IHttpBuildCacheProviderOptions {
|
|
|
956
979
|
}
|
|
957
980
|
|
|
958
981
|
const MAX_HTTP_CACHE_ATTEMPTS: number = 3;
|
|
959
|
-
const DEFAULT_MIN_HTTP_RETRY_DELAY_MS = 2500;
|
|
982
|
+
const DEFAULT_MIN_HTTP_RETRY_DELAY_MS: number = 2500;
|
|
960
983
|
|
|
961
984
|
export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
962
985
|
private readonly _pluginName: string;
|
|
@@ -994,7 +1017,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
994
1017
|
cacheId: string
|
|
995
1018
|
): Promise<Buffer | undefined> {
|
|
996
1019
|
try {
|
|
997
|
-
const result = await this._http({
|
|
1020
|
+
const result: boolean | Buffer = await this._http({
|
|
998
1021
|
terminal: terminal,
|
|
999
1022
|
relUrl: `${this._cacheKeyPrefix}${cacheId}`,
|
|
1000
1023
|
method: 'GET',
|
|
@@ -1024,7 +1047,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1024
1047
|
<span class="cstat-no" title="statement not covered" > terminal.writeDebugLine('Uploading object with cacheId: ', cacheId);</span>
|
|
1025
1048
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
1026
1049
|
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
1027
|
-
<span class="cstat-no" title="statement not covered" > const result = await this._http({</span>
|
|
1050
|
+
<span class="cstat-no" title="statement not covered" > const result: boolean | Buffer = await this._http({</span>
|
|
1028
1051
|
<span class="cstat-no" title="statement not covered" > terminal: terminal,</span>
|
|
1029
1052
|
<span class="cstat-no" title="statement not covered" > relUrl: `${this._cacheKeyPrefix}${cacheId}`,</span>
|
|
1030
1053
|
<span class="cstat-no" title="statement not covered" > method: this._uploadMethod,</span>
|
|
@@ -1067,9 +1090,13 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1067
1090
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
1068
1091
|
<span class="cstat-no" title="statement not covered" > const cmd: string = `${this._tokenHandler.exec} ${(this._tokenHandler.args || []).join(' ')}`;</span>
|
|
1069
1092
|
<span class="cstat-no" title="statement not covered" > terminal.writeVerboseLine(`Running '${cmd}' to get credentials`);</span>
|
|
1070
|
-
<span class="cstat-no" title="statement not covered" > const result = Executable.spawnSync(
|
|
1071
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1072
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1093
|
+
<span class="cstat-no" title="statement not covered" > const result: SpawnSyncReturns<string> = Executable.spawnSync(</span>
|
|
1094
|
+
<span class="cstat-no" title="statement not covered" > this._tokenHandler.exec,</span>
|
|
1095
|
+
<span class="cstat-no" title="statement not covered" > this._tokenHandler.args || [],</span>
|
|
1096
|
+
<span class="cstat-no" title="statement not covered" > {</span>
|
|
1097
|
+
<span class="cstat-no" title="statement not covered" > currentWorkingDirectory: this._rushProjectRoot</span>
|
|
1098
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1099
|
+
<span class="cstat-no" title="statement not covered" > );</span>
|
|
1073
1100
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
1074
1101
|
<span class="cstat-no" title="statement not covered" > terminal.writeErrorLine(result.stderr);</span>
|
|
1075
1102
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
@@ -1077,7 +1104,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1077
1104
|
<span class="cstat-no" title="statement not covered" > throw new Error(`Could not obtain credentials. The command '${cmd}' failed.`);</span>
|
|
1078
1105
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1079
1106
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
1080
|
-
<span class="cstat-no" title="statement not covered" > const credential = result.stdout.trim();</span>
|
|
1107
|
+
<span class="cstat-no" title="statement not covered" > const credential: string = result.stdout.trim();</span>
|
|
1081
1108
|
<span class="cstat-no" title="statement not covered" > terminal.writeVerboseLine('Got credentials');</span>
|
|
1082
1109
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
1083
1110
|
<span class="cstat-no" title="statement not covered" > await this.updateCachedCredentialAsync(terminal, credential);</span>
|
|
@@ -1122,9 +1149,9 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1122
1149
|
credentialOptions?: CredentialsOptions;
|
|
1123
1150
|
}): Promise<Buffer | boolean> {
|
|
1124
1151
|
const { terminal, relUrl, method, body, warningText, readBody, credentialOptions } = options;
|
|
1125
|
-
const safeCredentialOptions = credentialOptions ?? CredentialsOptions.Optional;
|
|
1126
|
-
const credentials = await this._tryGetCredentials(safeCredentialOptions);
|
|
1127
|
-
const url = new URL(relUrl, this._url).href;
|
|
1152
|
+
const safeCredentialOptions: CredentialsOptions = credentialOptions ?? CredentialsOptions.Optional;
|
|
1153
|
+
const credentials: string | undefined = await this._tryGetCredentials(safeCredentialOptions);
|
|
1154
|
+
const url: string = new URL(relUrl, this._url).href;
|
|
1128
1155
|
|
|
1129
1156
|
const headers: Record<string, string> = {};
|
|
1130
1157
|
if (typeof credentials === 'string') <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
@@ -1137,11 +1164,11 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1137
1164
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1138
1165
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1139
1166
|
|
|
1140
|
-
const bodyLength = (body<span class="branch-0 cbranch-no" title="branch not covered" > as { length: number })?.length </span>|| 'unknown';
|
|
1167
|
+
const bodyLength: number | 'unknown' = (body<span class="branch-0 cbranch-no" title="branch not covered" > as { length: number })?.length </span>|| 'unknown';
|
|
1141
1168
|
|
|
1142
1169
|
terminal.writeDebugLine(`[http-build-cache] request: ${method} ${url} ${bodyLength} bytes`);
|
|
1143
1170
|
|
|
1144
|
-
const response = await fetch(url, {
|
|
1171
|
+
const response: Response = await fetch(url, {
|
|
1145
1172
|
method: method,
|
|
1146
1173
|
headers: headers,
|
|
1147
1174
|
body: body,
|
|
@@ -1149,7 +1176,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1149
1176
|
});
|
|
1150
1177
|
|
|
1151
1178
|
if (!response.ok) {
|
|
1152
|
-
const isNonCredentialResponse = response.status >= 500 && response.status < 600;
|
|
1179
|
+
const isNonCredentialResponse: boolean = response.status >= 500 && response.status < 600;
|
|
1153
1180
|
|
|
1154
1181
|
if (
|
|
1155
1182
|
!isNonCredentialResponse &&
|
|
@@ -1168,8 +1195,8 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1168
1195
|
// Pause a bit before retrying in case the server is busy
|
|
1169
1196
|
// Add some random jitter to the retry so we can spread out load on the remote service
|
|
1170
1197
|
// A proper solution might add exponential back off in case the retry count is high (10 or more)
|
|
1171
|
-
const factor = 1.0 + Math.random(); // A random number between 1.0 and 2.0
|
|
1172
|
-
const retryDelay = Math.floor(factor * this._minHttpRetryDelayMs);
|
|
1198
|
+
const factor: number = 1.0 + Math.random(); // A random number between 1.0 and 2.0
|
|
1199
|
+
const retryDelay: number = Math.floor(factor * this._minHttpRetryDelayMs);
|
|
1173
1200
|
|
|
1174
1201
|
await Async.sleep(retryDelay);
|
|
1175
1202
|
|
|
@@ -1342,7 +1369,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider {
|
|
|
1342
1369
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1343
1370
|
Code coverage generated by
|
|
1344
1371
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1345
|
-
at 2024-
|
|
1372
|
+
at 2024-02-19T21:52:46.098Z
|
|
1346
1373
|
</div>
|
|
1347
1374
|
<script src="prettify.js"></script>
|
|
1348
1375
|
<script>
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
<span class="cstat-no" title="statement not covered" >// See LICENSE in the project root for license information.</span>
|
|
230
230
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
231
231
|
<span class="cstat-no" title="statement not covered" >import type { IRushPlugin, RushSession, RushConfiguration } from '@rushstack/rush-sdk';</span>
|
|
232
|
-
<span class="cstat-no" title="statement not covered" >import type {
|
|
232
|
+
<span class="cstat-no" title="statement not covered" >import type { IHttpBuildCacheProviderOptions } from './HttpBuildCacheProvider';</span>
|
|
233
233
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
234
234
|
<span class="cstat-no" title="statement not covered" >const PLUGIN_NAME: string = 'HttpBuildCachePlugin';</span>
|
|
235
235
|
<span class="cstat-no" title="statement not covered" ></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 2024-
|
|
316
|
+
at 2024-02-19T21:52:46.098Z
|
|
317
317
|
</div>
|
|
318
318
|
<script src="prettify.js"></script>
|
|
319
319
|
<script>
|