@nrwl/nx-cloud 14.1.3-beta.2 → 14.2.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.
@@ -1,36 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ErrorReporterApi = void 0;
13
- const axios_1 = require("../../utilities/axios");
14
- const { output } = require('../../utilities/nx-imports');
15
- class ErrorReporterApi {
16
- constructor(options) {
17
- this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
18
- }
19
- reportError(message) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- try {
22
- yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/report-client-error', {
23
- message,
24
- }));
25
- }
26
- catch (e) {
27
- output.warn({
28
- title: `Unable to record the following error: '${message}'`,
29
- bodyLines: [e.message],
30
- });
31
- }
32
- });
33
- }
34
- }
35
- exports.ErrorReporterApi = ErrorReporterApi;
36
- //# sourceMappingURL=error-reporter.api.js.map
1
+ const a0_0x6e1e=['value','message','Unable\x20to\x20record\x20the\x20following\x20error:\x20\x27','post','__awaiter','apiAxiosInstance','next','defineProperty','warn','apply','ErrorReporterApi','../../utilities/nx-imports','/nx-cloud/report-client-error','../../utilities/axios','then','axiosMultipleTries','done','createApiAxiosInstance','throw','reportError','__esModule'];(function(_0x5c7ce9,_0x6e1e4f){const _0x4ec713=function(_0x434145){while(--_0x434145){_0x5c7ce9['push'](_0x5c7ce9['shift']());}};_0x4ec713(++_0x6e1e4f);}(a0_0x6e1e,0x1e8));const a0_0x4ec7=function(_0x5c7ce9,_0x6e1e4f){_0x5c7ce9=_0x5c7ce9-0x0;let _0x4ec713=a0_0x6e1e[_0x5c7ce9];return _0x4ec713;};'use strict';var __awaiter=this&&this[a0_0x4ec7('0x14')]||function(_0x2bed3a,_0x5d1c2e,_0x3095f7,_0x195ea7){function _0x11339c(_0x34f7ff){return _0x34f7ff instanceof _0x3095f7?_0x34f7ff:new _0x3095f7(function(_0x1d3ed4){_0x1d3ed4(_0x34f7ff);});}return new(_0x3095f7||(_0x3095f7=Promise))(function(_0x1b2746,_0x5a1534){function _0x574126(_0x3573d1){try{_0x144765(_0x195ea7[a0_0x4ec7('0x1')](_0x3573d1));}catch(_0x220c31){_0x5a1534(_0x220c31);}}function _0x1807fc(_0x269404){try{_0x144765(_0x195ea7[a0_0x4ec7('0xd')](_0x269404));}catch(_0x51e38e){_0x5a1534(_0x51e38e);}}function _0x144765(_0x3fa818){_0x3fa818[a0_0x4ec7('0xb')]?_0x1b2746(_0x3fa818[a0_0x4ec7('0x10')]):_0x11339c(_0x3fa818['value'])[a0_0x4ec7('0x9')](_0x574126,_0x1807fc);}_0x144765((_0x195ea7=_0x195ea7[a0_0x4ec7('0x4')](_0x2bed3a,_0x5d1c2e||[]))[a0_0x4ec7('0x1')]());});};Object[a0_0x4ec7('0x2')](exports,a0_0x4ec7('0xf'),{'value':!![]});exports[a0_0x4ec7('0x5')]=void 0x0;const axios_1=require(a0_0x4ec7('0x8'));const {output}=require(a0_0x4ec7('0x6'));class ErrorReporterApi{constructor(_0x5d1be8){this[a0_0x4ec7('0x0')]=(0x0,axios_1[a0_0x4ec7('0xc')])(_0x5d1be8);}[a0_0x4ec7('0xe')](_0x3f5534){return __awaiter(this,void 0x0,void 0x0,function*(){try{yield(0x0,axios_1[a0_0x4ec7('0xa')])(()=>this[a0_0x4ec7('0x0')][a0_0x4ec7('0x13')](a0_0x4ec7('0x7'),{'message':_0x3f5534}));}catch(_0x20a4c5){output[a0_0x4ec7('0x3')]({'title':a0_0x4ec7('0x12')+_0x3f5534+'\x27','bodyLines':[_0x20a4c5[a0_0x4ec7('0x11')]]});}});}}exports['ErrorReporterApi']=ErrorReporterApi;
@@ -1,65 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.RunGroupApi = void 0;
13
- const axios_1 = require("../../utilities/axios");
14
- const metric_logger_1 = require("../../utilities/metric-logger");
15
- const { output } = require('../../utilities/nx-imports');
16
- class RunGroupApi {
17
- constructor(options) {
18
- this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
19
- }
20
- createRunGroup(branch, runGroup) {
21
- var _a;
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const recorder = (0, metric_logger_1.createMetricRecorder)('createRunGroup');
24
- try {
25
- const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/create-run-group', {
26
- branch: branch,
27
- runGroup: runGroup,
28
- }));
29
- recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
30
- }
31
- catch (e) {
32
- recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
33
- ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
34
- : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
35
- output.error({
36
- title: e.message,
37
- });
38
- process.exit(1);
39
- }
40
- });
41
- }
42
- completeRunGroup(runGroup) {
43
- var _a;
44
- return __awaiter(this, void 0, void 0, function* () {
45
- const recorder = (0, metric_logger_1.createMetricRecorder)('createRunGroup');
46
- try {
47
- const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
48
- runGroup: runGroup,
49
- }));
50
- recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
51
- }
52
- catch (e) {
53
- recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
54
- ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
55
- : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
56
- output.error({
57
- title: e.message,
58
- });
59
- process.exit(1);
60
- }
61
- });
62
- }
63
- }
64
- exports.RunGroupApi = RunGroupApi;
65
- //# sourceMappingURL=run-group.api.js.map
1
+ const a1_0xf268=['post','next','done','createRunGroup','__esModule','createMetricRecorder','../../utilities/metric-logger','message','mapRespToPerfEntry','value','apply','/nx-cloud/executions/create-run-group','defineProperty','axiosMultipleTries','RunGroupApi','createApiAxiosInstance','throw','/nx-cloud/executions/complete-run-group','exit','__awaiter','axiosException','response','../../utilities/nx-imports','error','recordMetric','apiAxiosInstance','completeRunGroup'];(function(_0x7debc9,_0xf2687e){const _0x257110=function(_0x12d99d){while(--_0x12d99d){_0x7debc9['push'](_0x7debc9['shift']());}};_0x257110(++_0xf2687e);}(a1_0xf268,0x85));const a1_0x2571=function(_0x7debc9,_0xf2687e){_0x7debc9=_0x7debc9-0x0;let _0x257110=a1_0xf268[_0x7debc9];return _0x257110;};'use strict';var __awaiter=this&&this[a1_0x2571('0x15')]||function(_0x5afaf6,_0x29de19,_0x398703,_0x94146b){function _0x335817(_0x319c7d){return _0x319c7d instanceof _0x398703?_0x319c7d:new _0x398703(function(_0x4c7abc){_0x4c7abc(_0x319c7d);});}return new(_0x398703||(_0x398703=Promise))(function(_0x1dedff,_0x35ca08){function _0x4933ca(_0x58b2eb){try{_0x473fdf(_0x94146b[a1_0x2571('0x3')](_0x58b2eb));}catch(_0x1771da){_0x35ca08(_0x1771da);}}function _0x468676(_0x2cbd54){try{_0x473fdf(_0x94146b[a1_0x2571('0x12')](_0x2cbd54));}catch(_0x542fbd){_0x35ca08(_0x542fbd);}}function _0x473fdf(_0x280891){_0x280891[a1_0x2571('0x4')]?_0x1dedff(_0x280891[a1_0x2571('0xb')]):_0x335817(_0x280891[a1_0x2571('0xb')])['then'](_0x4933ca,_0x468676);}_0x473fdf((_0x94146b=_0x94146b[a1_0x2571('0xc')](_0x5afaf6,_0x29de19||[]))[a1_0x2571('0x3')]());});};Object[a1_0x2571('0xe')](exports,a1_0x2571('0x6'),{'value':!![]});exports[a1_0x2571('0x10')]=void 0x0;const axios_1=require('../../utilities/axios');const metric_logger_1=require(a1_0x2571('0x8'));const {output}=require(a1_0x2571('0x18'));class RunGroupApi{constructor(_0x18b822){this[a1_0x2571('0x0')]=(0x0,axios_1[a1_0x2571('0x11')])(_0x18b822);}[a1_0x2571('0x5')](_0x334267,_0x19ee69){var _0x4304a7;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x4cd8bc=(0x0,metric_logger_1[a1_0x2571('0x7')])('createRunGroup');try{const _0x5df62e=yield(0x0,axios_1[a1_0x2571('0xf')])(()=>this[a1_0x2571('0x0')][a1_0x2571('0x2')](a1_0x2571('0xd'),{'branch':_0x334267,'runGroup':_0x19ee69}));_0x4cd8bc[a1_0x2571('0x1a')]((0x0,metric_logger_1['mapRespToPerfEntry'])(_0x5df62e));}catch(_0x28e522){_0x4cd8bc[a1_0x2571('0x1a')](((_0x4304a7=_0x28e522===null||_0x28e522===void 0x0?void 0x0:_0x28e522['axiosException'])===null||_0x4304a7===void 0x0?void 0x0:_0x4304a7[a1_0x2571('0x17')])?(0x0,metric_logger_1[a1_0x2571('0xa')])(_0x28e522['axiosException'][a1_0x2571('0x17')]):metric_logger_1['RUNNER_FAILURE_PERF_ENTRY']);output[a1_0x2571('0x19')]({'title':_0x28e522[a1_0x2571('0x9')]});process[a1_0x2571('0x14')](0x1);}});}[a1_0x2571('0x1')](_0x432acb){var _0xadbca2;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x2ab5a0=(0x0,metric_logger_1[a1_0x2571('0x7')])(a1_0x2571('0x5'));try{const _0x477e21=yield(0x0,axios_1['axiosMultipleTries'])(()=>this[a1_0x2571('0x0')]['post'](a1_0x2571('0x13'),{'runGroup':_0x432acb}));_0x2ab5a0[a1_0x2571('0x1a')]((0x0,metric_logger_1[a1_0x2571('0xa')])(_0x477e21));}catch(_0x1084ee){_0x2ab5a0[a1_0x2571('0x1a')](((_0xadbca2=_0x1084ee===null||_0x1084ee===void 0x0?void 0x0:_0x1084ee[a1_0x2571('0x16')])===null||_0xadbca2===void 0x0?void 0x0:_0xadbca2[a1_0x2571('0x17')])?(0x0,metric_logger_1[a1_0x2571('0xa')])(_0x1084ee['axiosException'][a1_0x2571('0x17')]):metric_logger_1['RUNNER_FAILURE_PERF_ENTRY']);output[a1_0x2571('0x19')]({'title':_0x1084ee[a1_0x2571('0x9')]});process[a1_0x2571('0x14')](0x1);}});}}exports[a1_0x2571('0x10')]=RunGroupApi;
@@ -26,17 +26,7 @@ function runCommandAndStoreInCloud() {
26
26
  const outputObfuscator = new output_obfuscator_1.OutputObfuscator(taskRunnerOptions.maskedProperties);
27
27
  const branch = (0, environment_1.getBranch)();
28
28
  const runGroup = (0, environment_1.getRunGroup)();
29
- let userCommandAndArgs;
30
- const commandStartIndex = process.argv.findIndex((arg) => arg === 'record') + 1;
31
- if (commandStartIndex < process.argv.length) {
32
- // Different package managers may remove not the "--" from the command automatically, so account for that
33
- const sliceOffset = process.argv[commandStartIndex] === '--' ? 1 : 0;
34
- userCommandAndArgs = process.argv.slice(commandStartIndex + sliceOffset);
35
- }
36
- else {
37
- console.log('Invalid command. Use `nx-cloud record [my command] [my arg1] [my arg...]`');
38
- process.exit(1);
39
- }
29
+ const userCommandAndArgs = parseCommandAndFlags(process.argv);
40
30
  const [userCommand, ...userArgs] = userCommandAndArgs;
41
31
  const startTime = new Date().toISOString();
42
32
  const { statusCode, terminalOutput } = yield spawnUserCommandAndCaptureOutput(userCommand, userArgs);
@@ -65,6 +55,20 @@ function getTaskRunnerOptions() {
65
55
  throw new Error('Unable to locate task runner options.');
66
56
  }
67
57
  }
58
+ function parseCommandAndFlags(args) {
59
+ let commandStartIndex = args.findIndex((arg) => arg === 'record') + 1;
60
+ let userCommandAndArgs;
61
+ if (commandStartIndex < process.argv.length) {
62
+ // Different package managers may remove not the "--" from the command automatically, so account for that
63
+ const sliceOffset = process.argv[commandStartIndex] === '--' ? 1 : 0;
64
+ userCommandAndArgs = process.argv.slice(commandStartIndex + sliceOffset);
65
+ }
66
+ else {
67
+ console.log('Invalid command. Use `nx-cloud record [my command] [my arg1] [my arg...]`');
68
+ process.exit(1);
69
+ }
70
+ return userCommandAndArgs;
71
+ }
68
72
  function spawnUserCommandAndCaptureOutput(command, args) {
69
73
  return new Promise((res, rej) => {
70
74
  try {
@@ -139,7 +143,9 @@ function endRecordOutputRun(axios, obfuscator, taskRunnerOptions, params) {
139
143
  const endRunResp = yield (0, axios_1.axiosMultipleTries)(() => axios.post('/nx-cloud/runs/end', compressedBuffer, {
140
144
  headers: Object.assign(Object.assign({}, axios.defaults.headers), { 'Content-Encoding': 'gzip', 'Content-Type': 'application/octet-stream' }),
141
145
  }));
142
- printRecordOutputRunEndMessage(endRunResp.data.runUrl);
146
+ if (process.env.NX_CLOUD_SILENT_RECORD !== 'true') {
147
+ printRecordOutputRunEndMessage(endRunResp.data.runUrl);
148
+ }
143
149
  });
144
150
  }
145
151
  function printRecordOutputRunEndMessage(runUrl) {
@@ -1 +1 @@
1
- {"version":3,"file":"record-output.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/commands/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,GAAG,MAAM,IAAA,0BAAkB,EAAC,GAAG,EAAE,CAC/C,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE,gBAAgB,EAAE;YACjD,OAAO,kCACF,KAAK,CAAC,QAAQ,CAAC,OAAO,KACzB,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,0BAA0B,GAC3C;SACF,CAAC,CACH,CAAC;QAEF,8BAA8B,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;CAAA;AAED,SAAS,8BAA8B,CAAC,MAAc;IACpD,MAAM,CAAC,oBAAoB,EAAE,CAAC;IAC9B,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gDAAgD,EAAE,CAAC,CAAC;IACzE,IAAA,4BAAY,EAAC,iDAAiD,MAAM,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,0DAA0D;AAC1D,kDAAkD;AAClD;;;;GAIG;AACH,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,GAAG,GAAG,CAAC,CAAC;IACxC,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,GAAG,GAAG,CAAC,CAAC;IACxC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,GAAG,GAAG,EAAE,CAAC;IAC1C,OAAO,GAAG,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"record-output.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/commands/record-output.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,6DAKqC;AAErC,iDAG+B;AAC/B,+BAAiC;AACjC,+BAA4B;AAE5B,4EAAwE;AACxE,iEAA6D;AAE7D,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAYxE,MAAM,6BAA6B,GAAG,MAAO,CAAC;AAE9C,SAAsB,yBAAyB;;QAC7C,MAAM,iBAAiB,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MAAM,EAC1B,cAAc,EAAE,0BAA0B,GAC3C;SACF,CAAC,CACH,CAAC;QACF,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,MAAM,EAAE;YACjD,8BAA8B,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACxD;IACH,CAAC;CAAA;AAED,SAAS,8BAA8B,CAAC,MAAc;IACpD,MAAM,CAAC,oBAAoB,EAAE,CAAC;IAC9B,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gDAAgD,EAAE,CAAC,CAAC;IACzE,IAAA,4BAAY,EAAC,iDAAiD,MAAM,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,0DAA0D;AAC1D,kDAAkD;AAClD;;;;GAIG;AACH,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,GAAG,GAAG,CAAC,CAAC;IACxC,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,GAAG,GAAG,CAAC,CAAC;IACxC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,GAAG,GAAG,EAAE,CAAC;IAC1C,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -15,4 +15,5 @@ export declare class FileStorage {
15
15
  private createFile;
16
16
  private uploadFile;
17
17
  private generateMD5;
18
+ private getFileUploadHeaders;
18
19
  }
@@ -175,15 +175,12 @@ class FileStorage {
175
175
  const recorder = (0, metric_logger_1.createMetricRecorder)('storeFile');
176
176
  const tarData = (0, fs_1.readFileSync)(tgz);
177
177
  const tarHash = this.generateMD5(tarData);
178
+ const headers = this.getFileUploadHeaders(url, tarHash);
178
179
  try {
179
180
  const resp = yield (0, axios_1.axiosMultipleTries)(() => axios(url, {
180
181
  method: 'PUT',
181
182
  data: tarData,
182
- headers: {
183
- 'Content-Type': 'application/octet-stream',
184
- // 'Content-MD5': tarHash,
185
- 'x-ms-blob-type': 'BlockBlob',
186
- },
183
+ headers: headers,
187
184
  maxContentLength: environment_1.NX_CLOUD_NO_TIMEOUTS
188
185
  ? environment_1.UNLIMITED_FILE_SIZE
189
186
  : environment_1.DEFAULT_FILE_SIZE_LIMIT,
@@ -207,6 +204,17 @@ class FileStorage {
207
204
  hasher.update(data);
208
205
  return hasher.digest('base64');
209
206
  }
207
+ getFileUploadHeaders(url, tarHash) {
208
+ const privateCloudFileServer = url.includes('/file/');
209
+ const headers = {
210
+ 'Content-Type': 'application/octet-stream',
211
+ 'x-ms-blob-type': 'BlockBlob',
212
+ };
213
+ if (privateCloudFileServer) {
214
+ headers['Content-MD5'] = tarHash;
215
+ }
216
+ return headers;
217
+ }
210
218
  }
211
219
  exports.FileStorage = FileStorage;
212
220
  //# sourceMappingURL=file-storage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-storage.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/file-storage/file-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAA6B;AAC7B,6DAMqC;AACrC,iDAA2D;AAE3D,2BAMY;AACZ,mDAA8C;AAC9C,iEAIuC;AAEvC,mCAAoC;AAEpC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAEzD,MAAa,WAAW;IACtB,YACmB,UAAyB,EACzB,aAA+B,EAC/B,8BAAuC;QAFvC,eAAU,GAAV,UAAU,CAAe;QACzB,kBAAa,GAAb,aAAa,CAAkB;QAC/B,mCAA8B,GAA9B,8BAA8B,CAAS;IACvD,CAAC;IAEE,QAAQ,CACZ,IAAY,EACZ,GAAW,EACX,cAAsB;;YAEtB,IAAI,6BAAe,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,yBAAyB,IAAI,EAAE;oBACtC,SAAS,EAAE,CAAC,kBAAkB,GA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AAC;aACT;;KACF;IAEO,WAAW,CAAC,IAAY;QAC9B,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;CACF;AAtND,kCAsNC"}
1
+ {"version":3,"file":"file-storage.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/file-storage/file-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAA6B;AAC7B,6DAMqC;AACrC,iDAA2D;AAE3D,2BAMY;AACZ,mDAA8C;AAC9C,iEAIuC;AAEvC,mCAAoC;AAEpC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAEzD,MAAa,WAAW;IACtB,YACmB,UAAyB,EACzB,aAA+B,EAC/B,8BAAuC;QAFvC,eAAU,GAAV,UAAU,CAAe;QACzB,kBAAa,GAAb,aAAa,CAAkB;QAC/B,mCAA8B,GAA9B,8BAA8B,CAAS;IACvD,CAAC;IAEE,QAAQ,CACZ,IAAY,EACZ,GAAW,EACX,cAAsB;;YAEtB,IAAI,6BAAe,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,yBAAyB,IAAI,EAAE;oBACtC,SAAS,EAAE,CAAC,kBAAkB,GAAG,EAAE,CAAC;iBACrC,CAAC,CAAC;aACJ;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;YACtD,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;YACvE,IAAI;gBACF,MAAM,IAA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AEO,oBAAoB,CAAC,GAAW,EAAE,OAAe;QACvD,MAAM,sBAAsB,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG;YACd,cAAc,EAAE,0BAA0B;YAC1C,gBAAgB,EAAE,WAAW;SAC9B,CAAC;QAEF,IAAI,sBAAsB,EAAE;YAC1B,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC;SAClC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAjOD,kCAiOC"}
@@ -1,138 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CloudEnabledLifeCycle = void 0;
4
- const path = require("path");
5
- const path_1 = require("path");
6
- const fs_1 = require("fs");
7
- const environment_1 = require("../../../utilities/environment");
8
- const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
9
- const { workspaceRoot } = require('../../../utilities/nx-imports');
10
- class CloudEnabledLifeCycle {
11
- constructor(runContext, cacheDirectory, skipNxCache, collectTerminalOutput, cacheableOperations, outputObfuscator, tasks) {
12
- this.runContext = runContext;
13
- this.cacheDirectory = cacheDirectory;
14
- this.skipNxCache = skipNxCache;
15
- this.collectTerminalOutput = collectTerminalOutput;
16
- this.cacheableOperations = cacheableOperations;
17
- this.outputObfuscator = outputObfuscator;
18
- this.tasks = tasks;
19
- }
20
- scheduleTask(task) {
21
- this.runContext.scheduledTasks.push(task);
22
- }
23
- startTask(task) {
24
- this.tasks.push({
25
- taskId: task.id,
26
- startTime: new Date().toISOString(),
27
- target: task.target.target,
28
- projectName: task.target.project,
29
- hash: task.hash,
30
- hashDetails: this.cleanUpHashDetails(task.hashDetails),
31
- params: (0, serializer_overrides_1.serializeOverrides)(task),
32
- });
33
- }
34
- // Used for older version for Nx. Remove in Dec 2022
35
- endTask(task, code) {
36
- let cacheStatus;
37
- if (this.runContext.statuses[task.hash]) {
38
- cacheStatus = this.runContext.statuses[task.hash];
39
- }
40
- else {
41
- if (this.cacheableOperations.indexOf(task.target.target) > -1 &&
42
- !this.skipNxCache) {
43
- cacheStatus = 'local-cache-hit';
44
- }
45
- else {
46
- cacheStatus = 'cache-miss';
47
- }
48
- }
49
- this.updateStartedTask(task, code, cacheStatus);
50
- }
51
- endTasks(tasks) {
52
- for (let t of tasks) {
53
- const status = t.status === 'remote-cache'
54
- ? 'remote-cache-hit'
55
- : t.status === 'local-cache' ||
56
- t.status === 'local-cache-kept-existing'
57
- ? 'local-cache-hit'
58
- : 'cache-miss';
59
- this.updateStartedTask(t.task, t.code, status);
60
- }
61
- }
62
- endCommand() { }
63
- updateStartedTask(task, code, cacheStatus) {
64
- const startedTask = this.tasks.find((t) => t.taskId === task.id);
65
- if (!startedTask) {
66
- throw new Error(`Cannot find task ${task.id}`);
67
- }
68
- startedTask.endTime = new Date().toISOString();
69
- startedTask.status = code;
70
- startedTask.params = this.outputObfuscator.obfuscate(startedTask.params);
71
- startedTask.cacheStatus = cacheStatus;
72
- if (this.collectTerminalOutput) {
73
- startedTask.terminalOutput = this.getTerminalOutput(task.hash, startedTask.cacheStatus, code);
74
- }
75
- }
76
- getTerminalOutput(hash, cacheStatus, code) {
77
- let dir;
78
- if (this.cacheDirectory) {
79
- if (this.cacheDirectory.startsWith('./')) {
80
- dir = (0, path_1.join)(workspaceRoot, this.cacheDirectory);
81
- }
82
- else {
83
- dir = this.cacheDirectory;
84
- }
85
- }
86
- else {
87
- dir = (0, path_1.join)(workspaceRoot, 'node_modules', '.cache', 'nx');
88
- }
89
- try {
90
- const taskOutput = this.readTerminalOutputFile(dir, hash);
91
- const taskOutputSanitized = this.outputObfuscator.obfuscate(taskOutput);
92
- if (environment_1.NX_CLOUD_UNLIMITED_OUTPUT)
93
- return taskOutputSanitized;
94
- const maxCharacters = cacheStatus === 'cache-miss'
95
- ? code === 0
96
- ? CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK
97
- : CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK
98
- : CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK;
99
- return taskOutputSanitized.length > maxCharacters
100
- ? `TRUNCATED\n\n${taskOutputSanitized.slice(taskOutputSanitized.length - maxCharacters)}`
101
- : taskOutputSanitized;
102
- }
103
- catch (e) {
104
- return '';
105
- }
106
- }
107
- cleanUpHashDetails(hashDetails) {
108
- const nodes = {};
109
- Object.keys(hashDetails.nodes)
110
- .filter((k) => !k.startsWith('npm:'))
111
- .forEach((k) => {
112
- nodes[k] = hashDetails.nodes[k];
113
- });
114
- return {
115
- nodes,
116
- runtime: hashDetails.runtime,
117
- implicitDeps: hashDetails.implicitDeps,
118
- };
119
- }
120
- readTerminalOutputFile(dir, hash) {
121
- try {
122
- return (0, fs_1.readFileSync)(path.join(dir, 'terminalOutputs', hash)).toString();
123
- }
124
- catch (_a) {
125
- try {
126
- return (0, fs_1.readFileSync)(path.join(dir, hash, 'terminalOutput')).toString();
127
- }
128
- catch (_b) {
129
- return '';
130
- }
131
- }
132
- }
133
- }
134
- exports.CloudEnabledLifeCycle = CloudEnabledLifeCycle;
135
- CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK = 200000;
136
- CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK = 20000;
137
- CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK = 20000;
138
- //# sourceMappingURL=cloud-enabled-life-cycle.js.map
1
+ const a0_0x1244=['runContext','MAX_CHARACTERS_FAILED_TASK','serializeOverrides','endCommand','scheduledTasks','CloudEnabledLifeCycle','cacheStatus','forEach','endTasks','length','readFileSync','status','statuses','push','../../../utilities/environment','Cannot\x20find\x20task\x20','path','defineProperty','filter','cacheDirectory','obfuscate','slice','MAX_CHARACTERS_SUCCESSFUL_TASK','local-cache','toString','params','local-cache-kept-existing','__esModule','skipNxCache','getTerminalOutput','updateStartedTask','nodes','collectTerminalOutput','node_modules','cleanUpHashDetails','cache-miss','cacheableOperations','toISOString','implicitDeps','../../../utilities/serializer-overrides','join','remote-cache-hit','find','terminalOutput','startsWith','tasks','hash','startTask','indexOf','.cache','project','local-cache-hit','target','readTerminalOutputFile','MAX_CHARACTERS_CACHED_TASK','endTask','keys','TRUNCATED\x0a\x0a','task','endTime','outputObfuscator','taskId','terminalOutputs'];(function(_0x271cc7,_0x124436){const _0x3aa533=function(_0x3dbfbd){while(--_0x3dbfbd){_0x271cc7['push'](_0x271cc7['shift']());}};_0x3aa533(++_0x124436);}(a0_0x1244,0x108));const a0_0x3aa5=function(_0x271cc7,_0x124436){_0x271cc7=_0x271cc7-0x0;let _0x3aa533=a0_0x1244[_0x271cc7];return _0x3aa533;};'use strict';Object[a0_0x3aa5('0x5')](exports,a0_0x3aa5('0xf'),{'value':!![]});exports[a0_0x3aa5('0x38')]=void 0x0;const path=require(a0_0x3aa5('0x4'));const path_1=require(a0_0x3aa5('0x4'));const fs_1=require('fs');const environment_1=require(a0_0x3aa5('0x2'));const serializer_overrides_1=require(a0_0x3aa5('0x1b'));const {workspaceRoot}=require('../../../utilities/nx-imports');class CloudEnabledLifeCycle{constructor(_0x16d72c,_0x2c336f,_0x529f08,_0x6f8fb9,_0x4ea57a,_0x32d7dc,_0x48d3f0){this[a0_0x3aa5('0x33')]=_0x16d72c;this['cacheDirectory']=_0x2c336f;this[a0_0x3aa5('0x10')]=_0x529f08;this['collectTerminalOutput']=_0x6f8fb9;this[a0_0x3aa5('0x18')]=_0x4ea57a;this[a0_0x3aa5('0x30')]=_0x32d7dc;this[a0_0x3aa5('0x21')]=_0x48d3f0;}['scheduleTask'](_0x2f1b7f){this['runContext'][a0_0x3aa5('0x37')][a0_0x3aa5('0x1')](_0x2f1b7f);}[a0_0x3aa5('0x23')](_0x4be3a1){this[a0_0x3aa5('0x21')][a0_0x3aa5('0x1')]({'taskId':_0x4be3a1['id'],'startTime':new Date()[a0_0x3aa5('0x19')](),'target':_0x4be3a1[a0_0x3aa5('0x28')][a0_0x3aa5('0x28')],'projectName':_0x4be3a1[a0_0x3aa5('0x28')][a0_0x3aa5('0x26')],'hash':_0x4be3a1[a0_0x3aa5('0x22')],'hashDetails':this[a0_0x3aa5('0x16')](_0x4be3a1['hashDetails']),'params':(0x0,serializer_overrides_1[a0_0x3aa5('0x35')])(_0x4be3a1)});}[a0_0x3aa5('0x2b')](_0x2d947b,_0x1c5570){let _0x45ab55;if(this[a0_0x3aa5('0x33')][a0_0x3aa5('0x0')][_0x2d947b['hash']]){_0x45ab55=this[a0_0x3aa5('0x33')][a0_0x3aa5('0x0')][_0x2d947b[a0_0x3aa5('0x22')]];}else{if(this[a0_0x3aa5('0x18')][a0_0x3aa5('0x24')](_0x2d947b[a0_0x3aa5('0x28')][a0_0x3aa5('0x28')])>-0x1&&!this['skipNxCache']){_0x45ab55=a0_0x3aa5('0x27');}else{_0x45ab55=a0_0x3aa5('0x17');}}this[a0_0x3aa5('0x12')](_0x2d947b,_0x1c5570,_0x45ab55);}[a0_0x3aa5('0x3b')](_0x37fe33){for(let _0xe5981d of _0x37fe33){const _0x25bd42=_0xe5981d['status']==='remote-cache'?a0_0x3aa5('0x1d'):_0xe5981d[a0_0x3aa5('0x3e')]===a0_0x3aa5('0xb')||_0xe5981d['status']===a0_0x3aa5('0xe')?a0_0x3aa5('0x27'):'cache-miss';this['updateStartedTask'](_0xe5981d[a0_0x3aa5('0x2e')],_0xe5981d['code'],_0x25bd42);}}[a0_0x3aa5('0x36')](){}[a0_0x3aa5('0x12')](_0x2b6d48,_0x3c6122,_0x522f29){const _0x1e39b4=this[a0_0x3aa5('0x21')][a0_0x3aa5('0x1e')](_0x418e30=>_0x418e30[a0_0x3aa5('0x31')]===_0x2b6d48['id']);if(!_0x1e39b4){throw new Error(a0_0x3aa5('0x3')+_0x2b6d48['id']);}_0x1e39b4[a0_0x3aa5('0x2f')]=new Date()[a0_0x3aa5('0x19')]();_0x1e39b4['status']=_0x3c6122;_0x1e39b4[a0_0x3aa5('0xd')]=this[a0_0x3aa5('0x30')][a0_0x3aa5('0x8')](_0x1e39b4[a0_0x3aa5('0xd')]);_0x1e39b4['cacheStatus']=_0x522f29;if(this[a0_0x3aa5('0x14')]){_0x1e39b4[a0_0x3aa5('0x1f')]=this[a0_0x3aa5('0x11')](_0x2b6d48[a0_0x3aa5('0x22')],_0x1e39b4[a0_0x3aa5('0x39')],_0x3c6122);}}[a0_0x3aa5('0x11')](_0x3bd8d1,_0x42cbe3,_0x34af47){let _0x367123;if(this[a0_0x3aa5('0x7')]){if(this[a0_0x3aa5('0x7')]['startsWith']('./')){_0x367123=(0x0,path_1[a0_0x3aa5('0x1c')])(workspaceRoot,this[a0_0x3aa5('0x7')]);}else{_0x367123=this[a0_0x3aa5('0x7')];}}else{_0x367123=(0x0,path_1[a0_0x3aa5('0x1c')])(workspaceRoot,a0_0x3aa5('0x15'),a0_0x3aa5('0x25'),'nx');}try{const _0x7b70d3=this[a0_0x3aa5('0x29')](_0x367123,_0x3bd8d1);const _0xe0c762=this[a0_0x3aa5('0x30')][a0_0x3aa5('0x8')](_0x7b70d3);if(environment_1['NX_CLOUD_UNLIMITED_OUTPUT'])return _0xe0c762;const _0x48ace2=_0x42cbe3==='cache-miss'?_0x34af47===0x0?CloudEnabledLifeCycle[a0_0x3aa5('0xa')]:CloudEnabledLifeCycle[a0_0x3aa5('0x34')]:CloudEnabledLifeCycle[a0_0x3aa5('0x2a')];return _0xe0c762['length']>_0x48ace2?a0_0x3aa5('0x2d')+_0xe0c762[a0_0x3aa5('0x9')](_0xe0c762[a0_0x3aa5('0x3c')]-_0x48ace2):_0xe0c762;}catch(_0x43b22c){return'';}}[a0_0x3aa5('0x16')](_0x25c3ed){const _0x4c8222={};Object[a0_0x3aa5('0x2c')](_0x25c3ed[a0_0x3aa5('0x13')])[a0_0x3aa5('0x6')](_0x3ca45b=>!_0x3ca45b[a0_0x3aa5('0x20')]('npm:'))[a0_0x3aa5('0x3a')](_0x1dfeb3=>{_0x4c8222[_0x1dfeb3]=_0x25c3ed[a0_0x3aa5('0x13')][_0x1dfeb3];});return{'nodes':_0x4c8222,'runtime':_0x25c3ed['runtime'],'implicitDeps':_0x25c3ed[a0_0x3aa5('0x1a')]};}[a0_0x3aa5('0x29')](_0x1c5025,_0x1c87b3){try{return(0x0,fs_1[a0_0x3aa5('0x3d')])(path['join'](_0x1c5025,a0_0x3aa5('0x32'),_0x1c87b3))[a0_0x3aa5('0xc')]();}catch(_0x53c448){try{return(0x0,fs_1[a0_0x3aa5('0x3d')])(path['join'](_0x1c5025,_0x1c87b3,a0_0x3aa5('0x1f')))[a0_0x3aa5('0xc')]();}catch(_0x3dd5a1){return'';}}}}exports[a0_0x3aa5('0x38')]=CloudEnabledLifeCycle;CloudEnabledLifeCycle[a0_0x3aa5('0x34')]=0x30d40;CloudEnabledLifeCycle[a0_0x3aa5('0xa')]=0x4e20;CloudEnabledLifeCycle[a0_0x3aa5('0x2a')]=0x4e20;
@@ -1,169 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.cloudEnabledTasksRunner = void 0;
13
- const message_reporter_1 = require("../../terminal-output/message-reporter");
14
- const end_of_run_message_1 = require("../../terminal-output/end-of-run-message");
15
- const output_obfuscator_1 = require("../../terminal-output/output-obfuscator");
16
- const cloud_enabled_life_cycle_1 = require("./cloud-enabled-life-cycle");
17
- const file_storage_1 = require("../../file-storage/file-storage");
18
- const e2e_encryption_1 = require("../../file-storage/e2e-encryption");
19
- const environment_1 = require("../../../utilities/environment");
20
- const cloud_remote_cache_1 = require("./cloud-remote-cache");
21
- const cloud_run_api_1 = require("./cloud-run.api");
22
- const fs_1 = require("fs");
23
- const path = require("path");
24
- const metric_logger_1 = require("../../../utilities/metric-logger");
25
- const error_reporter_api_1 = require("../../api/error-reporter.api");
26
- const { tasksRunner, output } = require('../../../utilities/nx-imports');
27
- function createApi(errors, options, runContext) {
28
- const machineInfo = (0, environment_1.getMachineInfo)(options);
29
- return new cloud_run_api_1.CloudRunApi(errors, runContext, options, machineInfo);
30
- }
31
- function storeTaskHashes(taskExecutions, directory, distributedExecutionId) {
32
- const hashes = JSON.stringify(taskExecutions.map((t) => ({
33
- taskId: t.taskId,
34
- hash: t.hash,
35
- })));
36
- if (environment_1.VERBOSE_LOGGING) {
37
- output.note({
38
- title: `Executed tasks with hashes: ${hashes}`,
39
- });
40
- }
41
- (0, fs_1.writeFileSync)(path.join(directory, `tasks-hashes-${distributedExecutionId}`), hashes);
42
- }
43
- function onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- const runEndTime = new Date().toISOString();
46
- if (environment_1.AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION) {
47
- storeTaskHashes(taskExecutions, options.cacheDirectory || './node_modules/.cache/nx', environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID);
48
- }
49
- const branch = (0, environment_1.getBranch)();
50
- const endRequest = yield Promise.all([
51
- remoteCache.waitForStoreRequestsToComplete(),
52
- api.endRun({
53
- command: outputObfuscator.obfuscate((0, environment_1.parseCommand)()),
54
- startTime: runStartTime,
55
- endTime: runEndTime,
56
- distributedExecutionId: environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID,
57
- branch: branch,
58
- scan: true,
59
- runGroup: (0, environment_1.getRunGroup)(),
60
- // only set sha if branch is set because we invoke a separate process,
61
- // which adds a few millis
62
- sha: branch ? (0, environment_1.extractGitSha)() : undefined,
63
- inner: inner,
64
- }, taskExecutions),
65
- ]);
66
- // this workaround is required because prior to Nx 13.3 we printed
67
- // the end message after the runner completes, so we need to wait for the
68
- // message to appear in the right place
69
- if (versionOfNxBefore133) {
70
- setTimeout(() => {
71
- messages.printMessages();
72
- if (!messages.anyErrors && !inner) {
73
- endOfRunMessage.printCacheHitsMessage();
74
- }
75
- }, 0);
76
- }
77
- else {
78
- messages.printMessages();
79
- if (!messages.anyErrors && !inner) {
80
- endOfRunMessage.printCacheHitsMessage();
81
- }
82
- }
83
- if (environment_1.AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION) {
84
- if (!endRequest[0]) {
85
- output.error({
86
- title: `Agent wasn't able to store artifacts`,
87
- });
88
- messages.printMessages();
89
- process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
90
- }
91
- if (!endRequest[1]) {
92
- output.error({
93
- title: `Agent wasn't able to record its run`,
94
- });
95
- messages.printMessages();
96
- process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
97
- }
98
- }
99
- yield (0, metric_logger_1.submitRunMetrics)(options);
100
- });
101
- }
102
- function createLifeCycle(runContext, options, outputObfuscator, tasks) {
103
- const cloudEnabledLifeCycle = new cloud_enabled_life_cycle_1.CloudEnabledLifeCycle(runContext, options.cacheDirectory, !!options.skipNxCache, options.scan === undefined ? true : options.scan, options.cacheableOperations || [], outputObfuscator, tasks);
104
- try {
105
- const { CompositeLifeCycle } = require('../../../utilities/nx-imports');
106
- if (!CompositeLifeCycle)
107
- return cloudEnabledLifeCycle;
108
- return new CompositeLifeCycle([options.lifeCycle, cloudEnabledLifeCycle]);
109
- }
110
- catch (e) {
111
- return cloudEnabledLifeCycle;
112
- }
113
- }
114
- function cloudEnabledTasksRunner(tasks, options, context, inner = false) {
115
- const runContext = {
116
- statuses: {},
117
- scheduledTasks: [],
118
- requests: {},
119
- allTasks: tasks,
120
- };
121
- const versionOfNxBefore133 = options.lifeCycle === undefined;
122
- const taskExecutions = [];
123
- const messages = new message_reporter_1.MessageReporter(options);
124
- const api = createApi(messages, options, runContext);
125
- const endOfRunMessage = new end_of_run_message_1.EndOfRunMessage(runContext, taskExecutions);
126
- const outputObfuscator = new output_obfuscator_1.OutputObfuscator(options.maskedProperties);
127
- const hashes = tasks.map((t) => t.hash).filter((h) => !!h);
128
- const startRunRequest = api.startRun(environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID, hashes);
129
- hashes.forEach((hash) => {
130
- runContext.requests[hash] = startRunRequest;
131
- });
132
- const runStartTime = new Date().toISOString();
133
- const lifeCycle = createLifeCycle(runContext, options, outputObfuscator, taskExecutions);
134
- const encryption = new e2e_encryption_1.E2EEncryption(environment_1.ENCRYPTION_KEY || options.encryptionKey);
135
- const errorApi = new error_reporter_api_1.ErrorReporterApi(options);
136
- const fileStorage = new file_storage_1.FileStorage(encryption, errorApi, false);
137
- const remoteCache = new cloud_remote_cache_1.CloudRemoteCache(messages, api, runContext, fileStorage);
138
- // have to reset it so we don't capture inner tasks
139
- delete process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_ID;
140
- const res = tasksRunner(tasks, Object.assign(Object.assign({}, options), { remoteCache, lifeCycle }), context);
141
- // observable -> legacy
142
- if (res.subscribe) {
143
- const { Subject } = require('rxjs/internal/Subject');
144
- const wrappedRes = new Subject();
145
- res.subscribe({
146
- next: (value) => wrappedRes.next(value),
147
- error: (err) => wrappedRes.error(err),
148
- complete: () => __awaiter(this, void 0, void 0, function* () {
149
- yield onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner);
150
- wrappedRes.complete();
151
- }),
152
- });
153
- return wrappedRes;
154
- // promise
155
- }
156
- else {
157
- return res
158
- .then((r) => __awaiter(this, void 0, void 0, function* () {
159
- yield onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner);
160
- return r;
161
- }))
162
- .catch((e) => __awaiter(this, void 0, void 0, function* () {
163
- yield onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner);
164
- throw e;
165
- }));
166
- }
167
- }
168
- exports.cloudEnabledTasksRunner = cloudEnabledTasksRunner;
169
- //# sourceMappingURL=cloud-enabled.runner.js.map
1
+ const a1_0x65c0=['throw','CloudRemoteCache','skipNxCache','next','printCacheHitsMessage','error','MessageReporter','./cloud-enabled-life-cycle','maskedProperties','../../api/error-reporter.api','AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION','cloudEnabledTasksRunner','encryptionKey','exit','note','CloudEnabledLifeCycle','obfuscate','env','complete','NX_CLOUD_DISTRIBUTED_EXECUTION_ID','ErrorReporterApi','value','Agent\x20wasn\x27t\x20able\x20to\x20record\x20its\x20run','getBranch','getMachineInfo','rxjs/internal/Subject','catch','__awaiter','forEach','E2EEncryption','__esModule','../../file-storage/file-storage','Agent\x20wasn\x27t\x20able\x20to\x20store\x20artifacts','cacheableOperations','VERBOSE_LOGGING','FileStorage','endRun','./cloud-remote-cache','join','DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE','Executed\x20tasks\x20with\x20hashes:\x20','cacheDirectory','getRunGroup','startRun','stringify','./node_modules/.cache/nx','assign','map','taskId','EndOfRunMessage','defineProperty','subscribe','lifeCycle','then','printMessages','parseCommand','done','../../../utilities/nx-imports','anyErrors','path','../../file-storage/e2e-encryption','scan','filter','hash','OutputObfuscator','tasks-hashes-','apply'];(function(_0x38011e,_0x65c05d){const _0x448c36=function(_0x15a8e3){while(--_0x15a8e3){_0x38011e['push'](_0x38011e['shift']());}};_0x448c36(++_0x65c05d);}(a1_0x65c0,0x72));const a1_0x448c=function(_0x38011e,_0x65c05d){_0x38011e=_0x38011e-0x0;let _0x448c36=a1_0x65c0[_0x38011e];return _0x448c36;};'use strict';var __awaiter=this&&this[a1_0x448c('0x2f')]||function(_0xbf4e04,_0x1ba017,_0x51b7e8,_0x5c8ab9){function _0x39ebb4(_0x445241){return _0x445241 instanceof _0x51b7e8?_0x445241:new _0x51b7e8(function(_0x4448e5){_0x4448e5(_0x445241);});}return new(_0x51b7e8||(_0x51b7e8=Promise))(function(_0x4d10d3,_0x588665){function _0x405001(_0x445338){try{_0x4f194c(_0x5c8ab9[a1_0x448c('0x17')](_0x445338));}catch(_0x557412){_0x588665(_0x557412);}}function _0x4c6a85(_0x1c0c63){try{_0x4f194c(_0x5c8ab9[a1_0x448c('0x14')](_0x1c0c63));}catch(_0x23b55a){_0x588665(_0x23b55a);}}function _0x4f194c(_0x53511f){_0x53511f[a1_0x448c('0x9')]?_0x4d10d3(_0x53511f['value']):_0x39ebb4(_0x53511f[a1_0x448c('0x29')])[a1_0x448c('0x6')](_0x405001,_0x4c6a85);}_0x4f194c((_0x5c8ab9=_0x5c8ab9[a1_0x448c('0x13')](_0xbf4e04,_0x1ba017||[]))['next']());});};Object[a1_0x448c('0x3')](exports,a1_0x448c('0x32'),{'value':!![]});exports[a1_0x448c('0x1f')]=void 0x0;const message_reporter_1=require('../../terminal-output/message-reporter');const end_of_run_message_1=require('../../terminal-output/end-of-run-message');const output_obfuscator_1=require('../../terminal-output/output-obfuscator');const cloud_enabled_life_cycle_1=require(a1_0x448c('0x1b'));const file_storage_1=require(a1_0x448c('0x33'));const e2e_encryption_1=require(a1_0x448c('0xd'));const environment_1=require('../../../utilities/environment');const cloud_remote_cache_1=require(a1_0x448c('0x39'));const cloud_run_api_1=require('./cloud-run.api');const fs_1=require('fs');const path=require(a1_0x448c('0xc'));const metric_logger_1=require('../../../utilities/metric-logger');const error_reporter_api_1=require(a1_0x448c('0x1d'));const {tasksRunner,output}=require(a1_0x448c('0xa'));function createApi(_0x57fdd2,_0x3d7a0e,_0x42ed63){const _0x3ef726=(0x0,environment_1[a1_0x448c('0x2c')])(_0x3d7a0e);return new cloud_run_api_1['CloudRunApi'](_0x57fdd2,_0x42ed63,_0x3d7a0e,_0x3ef726);}function storeTaskHashes(_0x406a10,_0x5688c5,_0x1cbe8b){const _0x445149=JSON[a1_0x448c('0x40')](_0x406a10['map'](_0x49019f=>({'taskId':_0x49019f[a1_0x448c('0x1')],'hash':_0x49019f[a1_0x448c('0x10')]})));if(environment_1[a1_0x448c('0x36')]){output[a1_0x448c('0x22')]({'title':a1_0x448c('0x3c')+_0x445149});}(0x0,fs_1['writeFileSync'])(path[a1_0x448c('0x3a')](_0x5688c5,a1_0x448c('0x12')+_0x1cbe8b),_0x445149);}function onComplete(_0x2a8f4d,_0x5b8b9e,_0x80810a,_0x32eedb,_0x29ba07,_0x46830a,_0x39f055,_0x4a4b57,_0x208e3f,_0x54bbbb,_0x401dc9){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x4a3286=new Date()['toISOString']();if(environment_1[a1_0x448c('0x1e')]){storeTaskHashes(_0x208e3f,_0x5b8b9e['cacheDirectory']||a1_0x448c('0x41'),environment_1['NX_CLOUD_DISTRIBUTED_EXECUTION_ID']);}const _0x43617d=(0x0,environment_1[a1_0x448c('0x2b')])();const _0xea59d0=yield Promise['all']([_0x80810a['waitForStoreRequestsToComplete'](),_0x32eedb[a1_0x448c('0x38')]({'command':_0x29ba07[a1_0x448c('0x24')]((0x0,environment_1[a1_0x448c('0x8')])()),'startTime':_0x46830a,'endTime':_0x4a3286,'distributedExecutionId':environment_1[a1_0x448c('0x27')],'branch':_0x43617d,'scan':!![],'runGroup':(0x0,environment_1[a1_0x448c('0x3e')])(),'sha':_0x43617d?(0x0,environment_1['extractGitSha'])():undefined,'inner':_0x401dc9},_0x208e3f)]);if(_0x54bbbb){setTimeout(()=>{_0x39f055[a1_0x448c('0x7')]();if(!_0x39f055[a1_0x448c('0xb')]&&!_0x401dc9){_0x4a4b57[a1_0x448c('0x18')]();}},0x0);}else{_0x39f055[a1_0x448c('0x7')]();if(!_0x39f055[a1_0x448c('0xb')]&&!_0x401dc9){_0x4a4b57['printCacheHitsMessage']();}}if(environment_1[a1_0x448c('0x1e')]){if(!_0xea59d0[0x0]){output[a1_0x448c('0x19')]({'title':a1_0x448c('0x34')});_0x39f055[a1_0x448c('0x7')]();process[a1_0x448c('0x21')](environment_1[a1_0x448c('0x3b')]);}if(!_0xea59d0[0x1]){output[a1_0x448c('0x19')]({'title':a1_0x448c('0x2a')});_0x39f055['printMessages']();process[a1_0x448c('0x21')](environment_1[a1_0x448c('0x3b')]);}}yield(0x0,metric_logger_1['submitRunMetrics'])(_0x5b8b9e);});}function createLifeCycle(_0x326076,_0x13bbf2,_0x3bb284,_0x5921de){const _0x58d082=new cloud_enabled_life_cycle_1[(a1_0x448c('0x23'))](_0x326076,_0x13bbf2[a1_0x448c('0x3d')],!!_0x13bbf2[a1_0x448c('0x16')],_0x13bbf2[a1_0x448c('0xe')]===undefined?!![]:_0x13bbf2['scan'],_0x13bbf2[a1_0x448c('0x35')]||[],_0x3bb284,_0x5921de);try{const {CompositeLifeCycle}=require(a1_0x448c('0xa'));if(!CompositeLifeCycle)return _0x58d082;return new CompositeLifeCycle([_0x13bbf2[a1_0x448c('0x5')],_0x58d082]);}catch(_0x25df5d){return _0x58d082;}}function cloudEnabledTasksRunner(_0x5e4fc6,_0x47b1a7,_0x17fb77,_0x4a69a6=![]){const _0x7f6e93={'statuses':{},'scheduledTasks':[],'requests':{},'allTasks':_0x5e4fc6};const _0x47f534=_0x47b1a7[a1_0x448c('0x5')]===undefined;const _0x385a05=[];const _0x35dacb=new message_reporter_1[(a1_0x448c('0x1a'))](_0x47b1a7);const _0x256995=createApi(_0x35dacb,_0x47b1a7,_0x7f6e93);const _0x5eda78=new end_of_run_message_1[(a1_0x448c('0x2'))](_0x7f6e93,_0x385a05);const _0x36c05e=new output_obfuscator_1[(a1_0x448c('0x11'))](_0x47b1a7[a1_0x448c('0x1c')]);const _0x3311ed=_0x5e4fc6[a1_0x448c('0x0')](_0x73b72=>_0x73b72['hash'])[a1_0x448c('0xf')](_0x33eba6=>!!_0x33eba6);const _0x4aa1fc=_0x256995[a1_0x448c('0x3f')](environment_1[a1_0x448c('0x27')],_0x3311ed);_0x3311ed[a1_0x448c('0x30')](_0x1e47c3=>{_0x7f6e93['requests'][_0x1e47c3]=_0x4aa1fc;});const _0x4c87ae=new Date()['toISOString']();const _0x3d798b=createLifeCycle(_0x7f6e93,_0x47b1a7,_0x36c05e,_0x385a05);const _0x2c6f6d=new e2e_encryption_1[(a1_0x448c('0x31'))](environment_1['ENCRYPTION_KEY']||_0x47b1a7[a1_0x448c('0x20')]);const _0x51c152=new error_reporter_api_1[(a1_0x448c('0x28'))](_0x47b1a7);const _0x5dd017=new file_storage_1[(a1_0x448c('0x37'))](_0x2c6f6d,_0x51c152,![]);const _0x184768=new cloud_remote_cache_1[(a1_0x448c('0x15'))](_0x35dacb,_0x256995,_0x7f6e93,_0x5dd017);delete process[a1_0x448c('0x25')][a1_0x448c('0x27')];const _0x3935ee=tasksRunner(_0x5e4fc6,Object['assign'](Object[a1_0x448c('0x42')]({},_0x47b1a7),{'remoteCache':_0x184768,'lifeCycle':_0x3d798b}),_0x17fb77);if(_0x3935ee[a1_0x448c('0x4')]){const {Subject}=require(a1_0x448c('0x2d'));const _0x42e01c=new Subject();_0x3935ee[a1_0x448c('0x4')]({'next':_0x4d040b=>_0x42e01c[a1_0x448c('0x17')](_0x4d040b),'error':_0x59b1ec=>_0x42e01c[a1_0x448c('0x19')](_0x59b1ec),'complete':()=>__awaiter(this,void 0x0,void 0x0,function*(){yield onComplete(_0x3d798b,_0x47b1a7,_0x184768,_0x256995,_0x36c05e,_0x4c87ae,_0x35dacb,_0x5eda78,_0x385a05,_0x47f534,_0x4a69a6);_0x42e01c[a1_0x448c('0x26')]();})});return _0x42e01c;}else{return _0x3935ee[a1_0x448c('0x6')](_0x2ff8e1=>__awaiter(this,void 0x0,void 0x0,function*(){yield onComplete(_0x3d798b,_0x47b1a7,_0x184768,_0x256995,_0x36c05e,_0x4c87ae,_0x35dacb,_0x5eda78,_0x385a05,_0x47f534,_0x4a69a6);return _0x2ff8e1;}))[a1_0x448c('0x2e')](_0x26b44f=>__awaiter(this,void 0x0,void 0x0,function*(){yield onComplete(_0x3d798b,_0x47b1a7,_0x184768,_0x256995,_0x36c05e,_0x4c87ae,_0x35dacb,_0x5eda78,_0x385a05,_0x47f534,_0x4a69a6);throw _0x26b44f;}));}}exports[a1_0x448c('0x1f')]=cloudEnabledTasksRunner;