@nrwl/nx-cloud 15.3.1-beta.1 → 15.3.1

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_0x1018=['throw','ErrorReporterApi','next','value','warn','../../utilities/axios','reportError','__esModule','apply','apiAxiosInstance','__awaiter','Unable\x20to\x20record\x20the\x20following\x20error:\x20\x27','done','then'];(function(_0x3061e1,_0x1018c3){const _0xa698d0=function(_0x345f5a){while(--_0x345f5a){_0x3061e1['push'](_0x3061e1['shift']());}};_0xa698d0(++_0x1018c3);}(a0_0x1018,0x12f));const a0_0xa698=function(_0x3061e1,_0x1018c3){_0x3061e1=_0x3061e1-0x0;let _0xa698d0=a0_0x1018[_0x3061e1];return _0xa698d0;};'use strict';var __awaiter=this&&this[a0_0xa698('0x1')]||function(_0x38cfea,_0xbc35c,_0x4e85bd,_0xbc1ed){function _0x2dc691(_0x1ea147){return _0x1ea147 instanceof _0x4e85bd?_0x1ea147:new _0x4e85bd(function(_0x320572){_0x320572(_0x1ea147);});}return new(_0x4e85bd||(_0x4e85bd=Promise))(function(_0x16b06f,_0x374aab){function _0x19e4a3(_0x593259){try{_0xe4ce73(_0xbc1ed[a0_0xa698('0x7')](_0x593259));}catch(_0x5e3d95){_0x374aab(_0x5e3d95);}}function _0x3a359b(_0x44e578){try{_0xe4ce73(_0xbc1ed[a0_0xa698('0x5')](_0x44e578));}catch(_0x1c4146){_0x374aab(_0x1c4146);}}function _0xe4ce73(_0x89b657){_0x89b657[a0_0xa698('0x3')]?_0x16b06f(_0x89b657[a0_0xa698('0x8')]):_0x2dc691(_0x89b657[a0_0xa698('0x8')])[a0_0xa698('0x4')](_0x19e4a3,_0x3a359b);}_0xe4ce73((_0xbc1ed=_0xbc1ed[a0_0xa698('0xd')](_0x38cfea,_0xbc35c||[]))[a0_0xa698('0x7')]());});};Object['defineProperty'](exports,a0_0xa698('0xc'),{'value':!![]});exports[a0_0xa698('0x6')]=void 0x0;const axios_1=require(a0_0xa698('0xa'));const {output}=require('../../utilities/nx-imports');class ErrorReporterApi{constructor(_0x9c02e3){this[a0_0xa698('0x0')]=(0x0,axios_1['createApiAxiosInstance'])(_0x9c02e3);}[a0_0xa698('0xb')](_0x21098e){return __awaiter(this,void 0x0,void 0x0,function*(){try{yield(0x0,axios_1['axiosMultipleTries'])(()=>this[a0_0xa698('0x0')]['post']('/nx-cloud/report-client-error',{'message':_0x21098e}));}catch(_0x1b2ece){output[a0_0xa698('0x9')]({'title':a0_0xa698('0x2')+_0x21098e+'\x27','bodyLines':[_0x1b2ece['message']]});}});}}exports[a0_0xa698('0x6')]=ErrorReporterApi;
@@ -1,73 +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, ciExecutionId, ciExecutionEnv, stopAgentsOnFailure, agentCount, stopAgentsAfter) {
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,
27
- runGroup,
28
- ciExecutionId,
29
- ciExecutionEnv,
30
- stopAgentsOnFailure,
31
- agentCount,
32
- stopAgentsAfter,
33
- }));
34
- recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
35
- }
36
- catch (e) {
37
- recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
38
- ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
39
- : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
40
- output.error({
41
- title: e.message,
42
- });
43
- process.exit(1);
44
- }
45
- });
46
- }
47
- completeRunGroup(branch, runGroup, ciExecutionId, ciExecutionEnv) {
48
- var _a;
49
- return __awaiter(this, void 0, void 0, function* () {
50
- const recorder = (0, metric_logger_1.createMetricRecorder)('createRunGroup');
51
- try {
52
- const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
53
- branch,
54
- runGroup,
55
- ciExecutionId,
56
- ciExecutionEnv,
57
- }));
58
- recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
59
- }
60
- catch (e) {
61
- recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
62
- ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
63
- : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
64
- output.error({
65
- title: e.message,
66
- });
67
- process.exit(1);
68
- }
69
- });
70
- }
71
- }
72
- exports.RunGroupApi = RunGroupApi;
73
- //# sourceMappingURL=run-group.api.js.map
1
+ const a1_0x5932=['value','../../utilities/metric-logger','createRunGroup','axiosException','axiosMultipleTries','createApiAxiosInstance','apply','next','../../utilities/axios','RUNNER_FAILURE_PERF_ENTRY','../../utilities/nx-imports','mapRespToPerfEntry','recordMetric','completeRunGroup','/nx-cloud/executions/complete-run-group','done','error','message','exit','defineProperty','throw','createMetricRecorder','response','apiAxiosInstance'];(function(_0x397401,_0x59329d){const _0x586617=function(_0x59e04a){while(--_0x59e04a){_0x397401['push'](_0x397401['shift']());}};_0x586617(++_0x59329d);}(a1_0x5932,0x155));const a1_0x5866=function(_0x397401,_0x59329d){_0x397401=_0x397401-0x0;let _0x586617=a1_0x5932[_0x397401];return _0x586617;};'use strict';var __awaiter=this&&this['__awaiter']||function(_0x6260ef,_0x180710,_0x372622,_0x582dec){function _0x1d9a90(_0x321899){return _0x321899 instanceof _0x372622?_0x321899:new _0x372622(function(_0x57d73b){_0x57d73b(_0x321899);});}return new(_0x372622||(_0x372622=Promise))(function(_0x951dd2,_0x525db5){function _0x1265ca(_0x1d5904){try{_0x4339fb(_0x582dec[a1_0x5866('0x2')](_0x1d5904));}catch(_0x485c0c){_0x525db5(_0x485c0c);}}function _0x336e19(_0x354984){try{_0x4339fb(_0x582dec[a1_0x5866('0xf')](_0x354984));}catch(_0x7d5625){_0x525db5(_0x7d5625);}}function _0x4339fb(_0x15d9d2){_0x15d9d2[a1_0x5866('0xa')]?_0x951dd2(_0x15d9d2[a1_0x5866('0x13')]):_0x1d9a90(_0x15d9d2['value'])['then'](_0x1265ca,_0x336e19);}_0x4339fb((_0x582dec=_0x582dec[a1_0x5866('0x1')](_0x6260ef,_0x180710||[]))[a1_0x5866('0x2')]());});};Object[a1_0x5866('0xe')](exports,'__esModule',{'value':!![]});exports['RunGroupApi']=void 0x0;const axios_1=require(a1_0x5866('0x3'));const metric_logger_1=require(a1_0x5866('0x14'));const {output}=require(a1_0x5866('0x5'));class RunGroupApi{constructor(_0x47151d){this[a1_0x5866('0x12')]=(0x0,axios_1[a1_0x5866('0x0')])(_0x47151d);}[a1_0x5866('0x15')](_0x184ca6,_0x58f809,_0x4d02ff,_0x21b959,_0x29859f,_0x4ef557,_0xcb8c87){var _0x369e21;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x3f637a=(0x0,metric_logger_1['createMetricRecorder'])(a1_0x5866('0x15'));try{const _0x2bcb42=yield(0x0,axios_1['axiosMultipleTries'])(()=>this['apiAxiosInstance']['post']('/nx-cloud/executions/create-run-group',{'branch':_0x184ca6,'runGroup':_0x58f809,'ciExecutionId':_0x4d02ff,'ciExecutionEnv':_0x21b959,'stopAgentsOnFailure':_0x29859f,'agentCount':_0x4ef557,'stopAgentsAfter':_0xcb8c87}));_0x3f637a['recordMetric']((0x0,metric_logger_1['mapRespToPerfEntry'])(_0x2bcb42));}catch(_0x52b243){_0x3f637a['recordMetric'](((_0x369e21=_0x52b243===null||_0x52b243===void 0x0?void 0x0:_0x52b243['axiosException'])===null||_0x369e21===void 0x0?void 0x0:_0x369e21[a1_0x5866('0x11')])?(0x0,metric_logger_1[a1_0x5866('0x6')])(_0x52b243[a1_0x5866('0x16')]['response']):metric_logger_1[a1_0x5866('0x4')]);output[a1_0x5866('0xb')]({'title':_0x52b243[a1_0x5866('0xc')]});process[a1_0x5866('0xd')](0x1);}});}[a1_0x5866('0x8')](_0x5b3841,_0x4b59c3,_0x58fa15,_0x45f2ee){var _0x2c0a91;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x43a073=(0x0,metric_logger_1[a1_0x5866('0x10')])(a1_0x5866('0x15'));try{const _0x3bd4b8=yield(0x0,axios_1[a1_0x5866('0x17')])(()=>this[a1_0x5866('0x12')]['post'](a1_0x5866('0x9'),{'branch':_0x5b3841,'runGroup':_0x4b59c3,'ciExecutionId':_0x58fa15,'ciExecutionEnv':_0x45f2ee}));_0x43a073['recordMetric']((0x0,metric_logger_1['mapRespToPerfEntry'])(_0x3bd4b8));}catch(_0x337a2f){_0x43a073[a1_0x5866('0x7')](((_0x2c0a91=_0x337a2f===null||_0x337a2f===void 0x0?void 0x0:_0x337a2f[a1_0x5866('0x16')])===null||_0x2c0a91===void 0x0?void 0x0:_0x2c0a91[a1_0x5866('0x11')])?(0x0,metric_logger_1[a1_0x5866('0x6')])(_0x337a2f[a1_0x5866('0x16')][a1_0x5866('0x11')]):metric_logger_1[a1_0x5866('0x4')]);output[a1_0x5866('0xb')]({'title':_0x337a2f[a1_0x5866('0xc')]});process['exit'](0x1);}});}}exports['RunGroupApi']=RunGroupApi;
@@ -1,93 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CloudEnabledLifeCycle = void 0;
4
- const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
5
- const read_task_terminal_output_1 = require("../../terminal-output/read-task-terminal-output");
6
- class CloudEnabledLifeCycle {
7
- constructor(runContext, cacheDirectory, collectTerminalOutput, cacheableOperations, outputObfuscator, tasks) {
8
- this.runContext = runContext;
9
- this.cacheDirectory = cacheDirectory;
10
- this.collectTerminalOutput = collectTerminalOutput;
11
- this.cacheableOperations = cacheableOperations;
12
- this.outputObfuscator = outputObfuscator;
13
- this.tasks = tasks;
14
- }
15
- scheduleTask(task) {
16
- this.runContext.scheduledTasks.push(task);
17
- }
18
- // this gets called for every tasks that starts.
19
- startTask(task) {
20
- this.tasks.push({
21
- taskId: task.id,
22
- startTime: new Date().toISOString(),
23
- target: task.target.target,
24
- projectName: task.target.project,
25
- hash: task.hash,
26
- hashDetails: this.cleanUpHashDetails(task.hashDetails),
27
- params: (0, serializer_overrides_1.serializeOverrides)(task),
28
- uploadedToStorage: false,
29
- });
30
- }
31
- endTasks(tasks) {
32
- // this can be called multiple times changing this time.
33
- for (let t of tasks) {
34
- let cacheStatus;
35
- const taskIsRemoteCacheHit = t.status === 'remote-cache';
36
- const taskIsLocalCacheHitPreNx135 = t.status === 'cache';
37
- const taskIsLocalCacheHit = t.status === 'local-cache' ||
38
- t.status === 'local-cache-kept-existing' ||
39
- taskIsLocalCacheHitPreNx135;
40
- if (this.runContext.statuses[t.task.hash]) {
41
- cacheStatus = this.runContext.statuses[t.task.hash];
42
- }
43
- else if (taskIsRemoteCacheHit) {
44
- cacheStatus = 'remote-cache-hit';
45
- }
46
- else if (taskIsLocalCacheHit) {
47
- cacheStatus = 'local-cache-hit';
48
- }
49
- else {
50
- cacheStatus = 'cache-miss';
51
- }
52
- this.updateStartedTask(t, cacheStatus);
53
- }
54
- }
55
- endCommand() { }
56
- updateStartedTask(result, cacheStatus) {
57
- const startedTask = this.tasks.find((t) => t.taskId === result.task.id);
58
- if (!startedTask) {
59
- throw new Error(`Cannot find task ${result.task.id}`);
60
- }
61
- if ((result === null || result === void 0 ? void 0 : result.startTime) && (result === null || result === void 0 ? void 0 : result.endTime)) {
62
- startedTask.startTime = new Date(result.startTime).toISOString();
63
- startedTask.endTime = new Date(result.endTime).toISOString();
64
- }
65
- else {
66
- startedTask.endTime = new Date().toISOString();
67
- }
68
- startedTask.status = result.code;
69
- startedTask.params = this.outputObfuscator.obfuscate(startedTask.params);
70
- startedTask.cacheStatus = cacheStatus;
71
- if (this.collectTerminalOutput) {
72
- startedTask.terminalOutput = this.getTerminalOutput(result.task.hash, startedTask.cacheStatus, result.code);
73
- }
74
- }
75
- getTerminalOutput(hash, cacheStatus, code) {
76
- return (0, read_task_terminal_output_1.readTaskTerminalOutput)(this.cacheDirectory, this.outputObfuscator, hash, cacheStatus, code);
77
- }
78
- cleanUpHashDetails(hashDetails) {
79
- const nodes = {};
80
- Object.keys(hashDetails.nodes)
81
- .filter((k) => !k.startsWith('npm:'))
82
- .forEach((k) => {
83
- nodes[k] = hashDetails.nodes[k];
84
- });
85
- return {
86
- nodes,
87
- runtime: hashDetails.runtime,
88
- implicitDeps: hashDetails.implicitDeps,
89
- };
90
- }
91
- }
92
- exports.CloudEnabledLifeCycle = CloudEnabledLifeCycle;
93
- //# sourceMappingURL=cloud-enabled-life-cycle.js.map
1
+ const a0_0x4326=['defineProperty','getTerminalOutput','code','scheduleTask','Cannot\x20find\x20task\x20','runContext','scheduledTasks','../../terminal-output/read-task-terminal-output','forEach','endTasks','terminalOutput','endCommand','target','npm:','filter','obfuscate','cacheStatus','updateStartedTask','local-cache','params','outputObfuscator','CloudEnabledLifeCycle','task','../../../utilities/serializer-overrides','cacheableOperations','__esModule','cleanUpHashDetails','tasks','hashDetails','toISOString','nodes','hash','local-cache-kept-existing','cache','startTime','taskId','push','remote-cache','implicitDeps','startTask','statuses','status','cacheDirectory','endTime','collectTerminalOutput','find'];(function(_0x5d8364,_0x4326b7){const _0x5512b8=function(_0x2bb547){while(--_0x2bb547){_0x5d8364['push'](_0x5d8364['shift']());}};_0x5512b8(++_0x4326b7);}(a0_0x4326,0x1ed));const a0_0x5512=function(_0x5d8364,_0x4326b7){_0x5d8364=_0x5d8364-0x0;let _0x5512b8=a0_0x4326[_0x5d8364];return _0x5512b8;};'use strict';Object[a0_0x5512('0xd')](exports,a0_0x5512('0x26'),{'value':!![]});exports[a0_0x5512('0x22')]=void 0x0;const serializer_overrides_1=require(a0_0x5512('0x24'));const read_task_terminal_output_1=require(a0_0x5512('0x14'));class CloudEnabledLifeCycle{constructor(_0x349361,_0xcc8d7,_0x2ff58f,_0x32ced2,_0x4e3efb,_0x236601){this[a0_0x5512('0x12')]=_0x349361;this[a0_0x5512('0x9')]=_0xcc8d7;this['collectTerminalOutput']=_0x2ff58f;this[a0_0x5512('0x25')]=_0x32ced2;this[a0_0x5512('0x21')]=_0x4e3efb;this[a0_0x5512('0x28')]=_0x236601;}[a0_0x5512('0x10')](_0x13d10b){this[a0_0x5512('0x12')][a0_0x5512('0x13')][a0_0x5512('0x3')](_0x13d10b);}[a0_0x5512('0x6')](_0x51a303){this[a0_0x5512('0x28')][a0_0x5512('0x3')]({'taskId':_0x51a303['id'],'startTime':new Date()[a0_0x5512('0x2a')](),'target':_0x51a303[a0_0x5512('0x19')][a0_0x5512('0x19')],'projectName':_0x51a303['target']['project'],'hash':_0x51a303['hash'],'hashDetails':this[a0_0x5512('0x27')](_0x51a303[a0_0x5512('0x29')]),'params':(0x0,serializer_overrides_1['serializeOverrides'])(_0x51a303),'uploadedToStorage':![]});}[a0_0x5512('0x16')](_0x1060e6){for(let _0x428dcd of _0x1060e6){let _0x391b73;const _0x429743=_0x428dcd[a0_0x5512('0x8')]===a0_0x5512('0x4');const _0x3f0299=_0x428dcd[a0_0x5512('0x8')]===a0_0x5512('0x0');const _0x523dcc=_0x428dcd['status']===a0_0x5512('0x1f')||_0x428dcd[a0_0x5512('0x8')]===a0_0x5512('0x2d')||_0x3f0299;if(this[a0_0x5512('0x12')][a0_0x5512('0x7')][_0x428dcd[a0_0x5512('0x23')]['hash']]){_0x391b73=this[a0_0x5512('0x12')][a0_0x5512('0x7')][_0x428dcd['task']['hash']];}else if(_0x429743){_0x391b73='remote-cache-hit';}else if(_0x523dcc){_0x391b73='local-cache-hit';}else{_0x391b73='cache-miss';}this['updateStartedTask'](_0x428dcd,_0x391b73);}}[a0_0x5512('0x18')](){}[a0_0x5512('0x1e')](_0x22e15f,_0x570175){const _0x57c18a=this['tasks'][a0_0x5512('0xc')](_0x16da04=>_0x16da04[a0_0x5512('0x2')]===_0x22e15f['task']['id']);if(!_0x57c18a){throw new Error(a0_0x5512('0x11')+_0x22e15f[a0_0x5512('0x23')]['id']);}if((_0x22e15f===null||_0x22e15f===void 0x0?void 0x0:_0x22e15f[a0_0x5512('0x1')])&&(_0x22e15f===null||_0x22e15f===void 0x0?void 0x0:_0x22e15f[a0_0x5512('0xa')])){_0x57c18a['startTime']=new Date(_0x22e15f['startTime'])[a0_0x5512('0x2a')]();_0x57c18a['endTime']=new Date(_0x22e15f[a0_0x5512('0xa')])[a0_0x5512('0x2a')]();}else{_0x57c18a[a0_0x5512('0xa')]=new Date()[a0_0x5512('0x2a')]();}_0x57c18a[a0_0x5512('0x8')]=_0x22e15f[a0_0x5512('0xf')];_0x57c18a[a0_0x5512('0x20')]=this[a0_0x5512('0x21')][a0_0x5512('0x1c')](_0x57c18a[a0_0x5512('0x20')]);_0x57c18a[a0_0x5512('0x1d')]=_0x570175;if(this[a0_0x5512('0xb')]){_0x57c18a[a0_0x5512('0x17')]=this[a0_0x5512('0xe')](_0x22e15f[a0_0x5512('0x23')][a0_0x5512('0x2c')],_0x57c18a['cacheStatus'],_0x22e15f[a0_0x5512('0xf')]);}}[a0_0x5512('0xe')](_0x4b9e21,_0x34e549,_0x32f025){return(0x0,read_task_terminal_output_1['readTaskTerminalOutput'])(this[a0_0x5512('0x9')],this['outputObfuscator'],_0x4b9e21,_0x34e549,_0x32f025);}[a0_0x5512('0x27')](_0x520f27){const _0x5dfaf0={};Object['keys'](_0x520f27[a0_0x5512('0x2b')])[a0_0x5512('0x1b')](_0x24b4df=>!_0x24b4df['startsWith'](a0_0x5512('0x1a')))[a0_0x5512('0x15')](_0x5919fd=>{_0x5dfaf0[_0x5919fd]=_0x520f27[a0_0x5512('0x2b')][_0x5919fd];});return{'nodes':_0x5dfaf0,'runtime':_0x520f27['runtime'],'implicitDeps':_0x520f27[a0_0x5512('0x5')]};}}exports['CloudEnabledLifeCycle']=CloudEnabledLifeCycle;
@@ -1,320 +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 path_1 = require("path");
25
- const metric_logger_1 = require("../../../utilities/metric-logger");
26
- const error_reporter_api_1 = require("../../api/error-reporter.api");
27
- const fs_extra_1 = require("fs-extra");
28
- const id_generator_1 = require("./id-generator");
29
- const { tasksRunner, output } = require('../../../utilities/nx-imports');
30
- function createApi(errors, options, runContext) {
31
- const machineInfo = (0, environment_1.getMachineInfo)(options);
32
- return new cloud_run_api_1.CloudRunApi(errors, runContext, options, machineInfo);
33
- }
34
- function storeTaskHashes(taskExecutions, directory, distributedExecutionId) {
35
- const hashes = JSON.stringify(taskExecutions.map((t) => ({
36
- taskId: t.taskId,
37
- hash: t.hash,
38
- })));
39
- if (environment_1.VERBOSE_LOGGING) {
40
- output.note({
41
- title: `Executed tasks with hashes: ${hashes}`,
42
- });
43
- }
44
- (0, fs_1.writeFileSync)(path.join(directory, `tasks-hashes-${distributedExecutionId}`), hashes);
45
- }
46
- /*
47
- * It can happen that a task is executed multiple times on an agent, say for DTE1 and DTE2.
48
- * When it runs for DTE2, it will be a local cache hit, so it will be marked as completed.
49
- * However, Nx won't upload an artifact to S3 in this case. Usually this isn't a problem,
50
- * cause the first DTE would have uploaded it. But if you are using a DTE, with a read-only token,
51
- * the uploaded artifact will have a different scoped hash.
52
- *
53
- * To address this: we are finding all local cache hits, and upload everything that has a put url.
54
- */
55
- function storeLocalCacheHits(taskExecutions, remoteCache, nxCacheDirectory) {
56
- const hashes = taskExecutions
57
- .filter((t) => t.cacheStatus === 'local-cache-hit')
58
- .map((t) => t.hash);
59
- hashes.forEach((hash) => remoteCache.store(hash, nxCacheDirectory));
60
- }
61
- function onComplete({ daemon, options, fileStorage, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner, encryptionKey, storeInCurrentProcess, distributedExecutionId, runContext, }) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- const runEndTime = new Date().toISOString();
64
- const branch = (0, environment_1.getBranch)();
65
- const runData = {
66
- command: outputObfuscator.obfuscate((0, environment_1.parseCommand)()),
67
- startTime: runStartTime,
68
- endTime: runEndTime,
69
- distributedExecutionId,
70
- branch: branch,
71
- runGroup: (0, environment_1.getRunGroup)(),
72
- // only set sha if branch is set because we invoke a separate process,
73
- // which adds a few millis
74
- sha: branch ? (0, environment_1.extractGitSha)() : undefined,
75
- inner: inner,
76
- };
77
- const ciExecutionContext = {
78
- branch: branch,
79
- runGroup: (0, environment_1.getRunGroup)(),
80
- ciExecutionId: (0, environment_1.getCIExecutionId)(),
81
- ciExecutionEnv: (0, environment_1.getCIExecutionEnv)(),
82
- };
83
- if (storeInCurrentProcess) {
84
- if ((0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId)) {
85
- const nxCacheDirectory = (0, environment_1.getNxCacheDirectory)(options);
86
- storeTaskHashes(taskExecutions, nxCacheDirectory, distributedExecutionId);
87
- storeLocalCacheHits(taskExecutions, remoteCache, nxCacheDirectory);
88
- }
89
- try {
90
- yield remoteCache.waitForStoreRequestsToComplete();
91
- }
92
- catch (e) {
93
- output.error({
94
- title: `Nx Cloud wasn't able to store artifacts.`,
95
- });
96
- messages.printMessages();
97
- return false;
98
- }
99
- for (const hash of fileStorage.storedHashes) {
100
- const matchingTask = taskExecutions.find((t) => t.hash === hash);
101
- if (!matchingTask) {
102
- throw new Error(`Task with hash ${hash} isn't recorded`);
103
- }
104
- matchingTask.uploadedToStorage = true;
105
- }
106
- try {
107
- yield api.endRun(runData, taskExecutions, ciExecutionContext);
108
- }
109
- catch (e) {
110
- output.error({
111
- title: `Nx Cloud wasn't able to record its run.`,
112
- });
113
- messages.printMessages();
114
- return false;
115
- }
116
- yield (0, metric_logger_1.submitRunMetrics)(options);
117
- }
118
- else {
119
- try {
120
- const accessToken = environment_1.ACCESS_TOKEN ? environment_1.ACCESS_TOKEN : options.accessToken;
121
- const linkId = (0, id_generator_1.generateUniqueLinkId)();
122
- yield daemon.processInBackground('@nrwl/nx-cloud/lib/daemon/process-run-end', {
123
- encryptionKey,
124
- runnerOptions: Object.assign(Object.assign({}, options), { accessToken }),
125
- delayedStoreRequests: remoteCache.delayedStoreRequests,
126
- ciExecutionContext,
127
- runEnd: {
128
- runData,
129
- taskExecutions,
130
- linkId,
131
- },
132
- });
133
- runContext.runUrl = `${options.url || 'https://nx.app'}/runs/${linkId}`;
134
- }
135
- catch (e) {
136
- output.warn({
137
- title: `Nx Cloud Problems`,
138
- bodyLines: [e.message || e.toString()],
139
- });
140
- return false;
141
- }
142
- }
143
- // this workaround is required because prior to Nx 13.3 we printed
144
- // the end message after the runner completes, so we need to wait for the
145
- // message to appear in the right place
146
- if (versionOfNxBefore133) {
147
- setTimeout(() => {
148
- messages.printMessages();
149
- if (!messages.anyErrors && !inner) {
150
- endOfRunMessage.printCacheHitsMessage();
151
- }
152
- }, 0);
153
- }
154
- else {
155
- messages.printMessages();
156
- if (!messages.anyErrors && !inner) {
157
- endOfRunMessage.printCacheHitsMessage();
158
- }
159
- }
160
- return true;
161
- });
162
- }
163
- function createLifeCycle(runContext, options, outputObfuscator, tasks) {
164
- const cloudEnabledLifeCycle = new cloud_enabled_life_cycle_1.CloudEnabledLifeCycle(runContext, (0, environment_1.getNxCacheDirectory)(options), true, options.cacheableOperations || [], outputObfuscator, tasks);
165
- try {
166
- const { CompositeLifeCycle } = require('../../../utilities/nx-imports');
167
- if (!CompositeLifeCycle)
168
- return cloudEnabledLifeCycle;
169
- return new CompositeLifeCycle([options.lifeCycle, cloudEnabledLifeCycle]);
170
- }
171
- catch (e) {
172
- return cloudEnabledLifeCycle;
173
- }
174
- }
175
- function fetchUrlsForKnownHashesUpfront(api, runContext, tasks, options, distributedExecutionId) {
176
- return __awaiter(this, void 0, void 0, function* () {
177
- if (options.skipNxCache)
178
- return;
179
- let hashes = tasks.map((t) => t.hash).filter((h) => !!h);
180
- const cachePath = (0, environment_1.getNxCacheDirectory)(options);
181
- // filter out the urls that don't have artifact stored locally
182
- const exists = yield Promise.all(hashes.map((hash) => {
183
- const tdCommit = (0, path_1.join)(cachePath, `${hash}.commit`);
184
- return (0, fs_extra_1.pathExists)(tdCommit);
185
- }));
186
- const missingHashes = [];
187
- for (let i = 0; i < exists.length; ++i) {
188
- if (!exists[i]) {
189
- missingHashes.push(hashes[i]);
190
- }
191
- }
192
- if (missingHashes.length > 0) {
193
- const startRunRequest = api.startRun(distributedExecutionId, missingHashes);
194
- for (const hash of missingHashes) {
195
- runContext.requests[hash] = startRunRequest;
196
- }
197
- }
198
- });
199
- }
200
- function cloudEnabledTasksRunner(tasks, options, context, inner = false) {
201
- var _a;
202
- const distributedExecutionId = process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_ID;
203
- const runContext = {
204
- statuses: {},
205
- scheduledTasks: [],
206
- requests: {},
207
- allTasks: tasks,
208
- };
209
- const versionOfNxBefore133 = options.lifeCycle === undefined;
210
- const taskExecutions = [];
211
- const messages = new message_reporter_1.MessageReporter(options);
212
- const api = createApi(messages, options, runContext);
213
- const endOfRunMessage = new end_of_run_message_1.EndOfRunMessage(runContext, taskExecutions, distributedExecutionId);
214
- const outputObfuscator = new output_obfuscator_1.OutputObfuscator(options.maskedProperties);
215
- const runStartTime = new Date().toISOString();
216
- const lifeCycle = createLifeCycle(runContext, options, outputObfuscator, taskExecutions);
217
- const encryptionKey = environment_1.ENCRYPTION_KEY || options.encryptionKey;
218
- const encryption = new e2e_encryption_1.E2EEncryption(encryptionKey);
219
- const errorApi = new error_reporter_api_1.ErrorReporterApi(options);
220
- const storeInCurrentProcess = (0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId) ||
221
- !((_a = context.daemon) === null || _a === void 0 ? void 0 : _a.enabled());
222
- const fileStorage = new file_storage_1.FileStorage(encryption, errorApi, options, 'cloud-enabled-runner');
223
- const remoteCache = new cloud_remote_cache_1.CloudRemoteCache(messages, api, runContext, fileStorage, distributedExecutionId, storeInCurrentProcess);
224
- // we don't await for it cause this step is optional
225
- fetchUrlsForKnownHashesUpfront(api, runContext, tasks, options, distributedExecutionId);
226
- // have to reset it so we don't capture inner tasks
227
- delete process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_ID;
228
- const res = tasksRunner(tasks, Object.assign(Object.assign({}, options), { remoteCache, lifeCycle }), context);
229
- // observable -> legacy
230
- if (res.subscribe) {
231
- const { Subject } = require('rxjs/internal/Subject');
232
- const wrappedRes = new Subject();
233
- res.subscribe({
234
- next: (value) => wrappedRes.next(value),
235
- error: (err) => wrappedRes.error(err),
236
- complete: () => __awaiter(this, void 0, void 0, function* () {
237
- const success = yield onComplete({
238
- daemon: context.daemon,
239
- options,
240
- fileStorage,
241
- remoteCache,
242
- api,
243
- outputObfuscator,
244
- runStartTime,
245
- messages,
246
- endOfRunMessage,
247
- taskExecutions,
248
- versionOfNxBefore133,
249
- inner,
250
- encryptionKey,
251
- storeInCurrentProcess,
252
- runContext,
253
- distributedExecutionId,
254
- });
255
- if (!success &&
256
- (0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId)) {
257
- process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
258
- }
259
- wrappedRes.complete();
260
- }),
261
- });
262
- return wrappedRes;
263
- // promise
264
- }
265
- else {
266
- return res
267
- .then((r) => __awaiter(this, void 0, void 0, function* () {
268
- const success = yield onComplete({
269
- daemon: context.daemon,
270
- options,
271
- fileStorage,
272
- remoteCache,
273
- api,
274
- outputObfuscator,
275
- runStartTime,
276
- messages,
277
- endOfRunMessage,
278
- taskExecutions,
279
- versionOfNxBefore133,
280
- inner,
281
- encryptionKey,
282
- storeInCurrentProcess,
283
- runContext,
284
- distributedExecutionId,
285
- });
286
- if (!success &&
287
- (0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId)) {
288
- process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
289
- }
290
- return r;
291
- }))
292
- .catch((e) => __awaiter(this, void 0, void 0, function* () {
293
- const success = yield onComplete({
294
- daemon: context.daemon,
295
- options,
296
- fileStorage,
297
- remoteCache,
298
- api,
299
- outputObfuscator,
300
- runStartTime,
301
- messages,
302
- endOfRunMessage,
303
- taskExecutions,
304
- versionOfNxBefore133,
305
- inner,
306
- encryptionKey,
307
- storeInCurrentProcess,
308
- runContext,
309
- distributedExecutionId,
310
- });
311
- if (!success &&
312
- (0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId)) {
313
- process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
314
- }
315
- throw e;
316
- }));
317
- }
318
- }
319
- exports.cloudEnabledTasksRunner = cloudEnabledTasksRunner;
320
- //# sourceMappingURL=cloud-enabled.runner.js.map
1
+ const a1_0x3598=['runUrl','generateUniqueLinkId','__awaiter','warn','.commit','filter','getNxCacheDirectory','toString','ENCRYPTION_KEY','EndOfRunMessage','toISOString','CloudRemoteCache','ACCESS_TOKEN','taskId','subscribe','next','https://nx.app','agentRunningInDistributedExecution','../../terminal-output/message-reporter','store','join','cloud-enabled-runner','anyErrors','complete','DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE','../../file-storage/file-storage','./cloud-enabled-life-cycle','daemon','find','../../terminal-output/end-of-run-message','@nrwl/nx-cloud/lib/daemon/process-run-end','rxjs/internal/Subject','Task\x20with\x20hash\x20','VERBOSE_LOGGING','storedHashes','pathExists','waitForStoreRequestsToComplete','OutputObfuscator','all','tasks-hashes-','MessageReporter','message','\x20isn\x27t\x20recorded','../../../utilities/nx-imports','../../terminal-output/output-obfuscator','obfuscate','path','exit','getCIExecutionEnv','url','NX_CLOUD_DISTRIBUTED_EXECUTION_ID','Executed\x20tasks\x20with\x20hashes:\x20','/runs/','../../api/error-reporter.api','__esModule','Nx\x20Cloud\x20wasn\x27t\x20able\x20to\x20record\x20its\x20run.','getCIExecutionId','Nx\x20Cloud\x20Problems','env','stringify','endRun','getRunGroup','printMessages','./cloud-remote-cache','defineProperty','printCacheHitsMessage','ErrorReporterApi','skipNxCache','map','hash','startRun','assign','submitRunMetrics','delayedStoreRequests','local-cache-hit','CloudRunApi','lifeCycle','done','extractGitSha','cloudEnabledTasksRunner','Nx\x20Cloud\x20wasn\x27t\x20able\x20to\x20store\x20artifacts.','cacheStatus','FileStorage','parseCommand','getMachineInfo','error','../../../utilities/environment','push','requests','writeFileSync','forEach','CloudEnabledLifeCycle'];(function(_0x2df648,_0x3598d7){const _0x22bee6=function(_0x14476c){while(--_0x14476c){_0x2df648['push'](_0x2df648['shift']());}};_0x22bee6(++_0x3598d7);}(a1_0x3598,0x125));const a1_0x22be=function(_0x2df648,_0x3598d7){_0x2df648=_0x2df648-0x0;let _0x22bee6=a1_0x3598[_0x2df648];return _0x22bee6;};'use strict';var __awaiter=this&&this[a1_0x22be('0x4d')]||function(_0x15a58d,_0x3ca47e,_0xfc3ca5,_0x384c85){function _0x29382f(_0x5f0e09){return _0x5f0e09 instanceof _0xfc3ca5?_0x5f0e09:new _0xfc3ca5(function(_0x2d07ee){_0x2d07ee(_0x5f0e09);});}return new(_0xfc3ca5||(_0xfc3ca5=Promise))(function(_0x3c4ad2,_0x4a8b1e){function _0x2f6afd(_0x1c4e62){try{_0x1583f9(_0x384c85[a1_0x22be('0x5a')](_0x1c4e62));}catch(_0xa72699){_0x4a8b1e(_0xa72699);}}function _0x4a4c64(_0x178091){try{_0x1583f9(_0x384c85['throw'](_0x178091));}catch(_0x53571d){_0x4a8b1e(_0x53571d);}}function _0x1583f9(_0x51b76e){_0x51b76e[a1_0x22be('0x3c')]?_0x3c4ad2(_0x51b76e['value']):_0x29382f(_0x51b76e['value'])['then'](_0x2f6afd,_0x4a4c64);}_0x1583f9((_0x384c85=_0x384c85['apply'](_0x15a58d,_0x3ca47e||[]))[a1_0x22be('0x5a')]());});};Object[a1_0x22be('0x2f')](exports,a1_0x22be('0x25'),{'value':!![]});exports[a1_0x22be('0x3e')]=void 0x0;const message_reporter_1=require(a1_0x22be('0x1'));const end_of_run_message_1=require(a1_0x22be('0xc'));const output_obfuscator_1=require(a1_0x22be('0x1b'));const cloud_enabled_life_cycle_1=require(a1_0x22be('0x9'));const file_storage_1=require(a1_0x22be('0x8'));const e2e_encryption_1=require('../../file-storage/e2e-encryption');const environment_1=require(a1_0x22be('0x45'));const cloud_remote_cache_1=require(a1_0x22be('0x2e'));const cloud_run_api_1=require('./cloud-run.api');const fs_1=require('fs');const path=require(a1_0x22be('0x1d'));const path_1=require(a1_0x22be('0x1d'));const metric_logger_1=require('../../../utilities/metric-logger');const error_reporter_api_1=require(a1_0x22be('0x24'));const fs_extra_1=require('fs-extra');const id_generator_1=require('./id-generator');const {tasksRunner,output}=require(a1_0x22be('0x1a'));function createApi(_0x1fee84,_0x43d303,_0x5c0cfe){const _0x5eee67=(0x0,environment_1[a1_0x22be('0x43')])(_0x43d303);return new cloud_run_api_1[(a1_0x22be('0x3a'))](_0x1fee84,_0x5c0cfe,_0x43d303,_0x5eee67);}function storeTaskHashes(_0x2544b1,_0x1d984c,_0x267995){const _0xe0654e=JSON[a1_0x22be('0x2a')](_0x2544b1['map'](_0xe85e94=>({'taskId':_0xe85e94[a1_0x22be('0x58')],'hash':_0xe85e94['hash']})));if(environment_1[a1_0x22be('0x10')]){output['note']({'title':a1_0x22be('0x22')+_0xe0654e});}(0x0,fs_1[a1_0x22be('0x48')])(path[a1_0x22be('0x3')](_0x1d984c,a1_0x22be('0x16')+_0x267995),_0xe0654e);}function storeLocalCacheHits(_0x118be1,_0xf0ea36,_0x4a626e){const _0x112b04=_0x118be1['filter'](_0xb5b8c4=>_0xb5b8c4[a1_0x22be('0x40')]===a1_0x22be('0x39'))[a1_0x22be('0x33')](_0x2db97b=>_0x2db97b[a1_0x22be('0x34')]);_0x112b04[a1_0x22be('0x49')](_0x69d905=>_0xf0ea36[a1_0x22be('0x2')](_0x69d905,_0x4a626e));}function onComplete({daemon,options,fileStorage,remoteCache,api,outputObfuscator,runStartTime,messages,endOfRunMessage,taskExecutions,versionOfNxBefore133,inner,encryptionKey,storeInCurrentProcess,distributedExecutionId,runContext}){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x1002f9=new Date()[a1_0x22be('0x55')]();const _0x5fa396=(0x0,environment_1['getBranch'])();const _0xcb8d4a={'command':outputObfuscator[a1_0x22be('0x1c')]((0x0,environment_1[a1_0x22be('0x42')])()),'startTime':runStartTime,'endTime':_0x1002f9,'distributedExecutionId':distributedExecutionId,'branch':_0x5fa396,'runGroup':(0x0,environment_1[a1_0x22be('0x2c')])(),'sha':_0x5fa396?(0x0,environment_1[a1_0x22be('0x3d')])():undefined,'inner':inner};const _0x5421af={'branch':_0x5fa396,'runGroup':(0x0,environment_1['getRunGroup'])(),'ciExecutionId':(0x0,environment_1[a1_0x22be('0x27')])(),'ciExecutionEnv':(0x0,environment_1[a1_0x22be('0x1f')])()};if(storeInCurrentProcess){if((0x0,environment_1['agentRunningInDistributedExecution'])(distributedExecutionId)){const _0xf281bf=(0x0,environment_1[a1_0x22be('0x51')])(options);storeTaskHashes(taskExecutions,_0xf281bf,distributedExecutionId);storeLocalCacheHits(taskExecutions,remoteCache,_0xf281bf);}try{yield remoteCache[a1_0x22be('0x13')]();}catch(_0x138f41){output[a1_0x22be('0x44')]({'title':a1_0x22be('0x3f')});messages[a1_0x22be('0x2d')]();return![];}for(const _0x211dba of fileStorage[a1_0x22be('0x11')]){const _0x5c21f2=taskExecutions[a1_0x22be('0xb')](_0x3b3a48=>_0x3b3a48[a1_0x22be('0x34')]===_0x211dba);if(!_0x5c21f2){throw new Error(a1_0x22be('0xf')+_0x211dba+a1_0x22be('0x19'));}_0x5c21f2['uploadedToStorage']=!![];}try{yield api[a1_0x22be('0x2b')](_0xcb8d4a,taskExecutions,_0x5421af);}catch(_0x5c25d2){output[a1_0x22be('0x44')]({'title':a1_0x22be('0x26')});messages[a1_0x22be('0x2d')]();return![];}yield(0x0,metric_logger_1[a1_0x22be('0x37')])(options);}else{try{const _0x4a32fa=environment_1[a1_0x22be('0x57')]?environment_1[a1_0x22be('0x57')]:options['accessToken'];const _0x47b6af=(0x0,id_generator_1[a1_0x22be('0x4c')])();yield daemon['processInBackground'](a1_0x22be('0xd'),{'encryptionKey':encryptionKey,'runnerOptions':Object[a1_0x22be('0x36')](Object[a1_0x22be('0x36')]({},options),{'accessToken':_0x4a32fa}),'delayedStoreRequests':remoteCache[a1_0x22be('0x38')],'ciExecutionContext':_0x5421af,'runEnd':{'runData':_0xcb8d4a,'taskExecutions':taskExecutions,'linkId':_0x47b6af}});runContext[a1_0x22be('0x4b')]=(options[a1_0x22be('0x20')]||a1_0x22be('0x5b'))+a1_0x22be('0x23')+_0x47b6af;}catch(_0x184a1c){output[a1_0x22be('0x4e')]({'title':a1_0x22be('0x28'),'bodyLines':[_0x184a1c[a1_0x22be('0x18')]||_0x184a1c[a1_0x22be('0x52')]()]});return![];}}if(versionOfNxBefore133){setTimeout(()=>{messages[a1_0x22be('0x2d')]();if(!messages[a1_0x22be('0x5')]&&!inner){endOfRunMessage[a1_0x22be('0x30')]();}},0x0);}else{messages['printMessages']();if(!messages['anyErrors']&&!inner){endOfRunMessage[a1_0x22be('0x30')]();}}return!![];});}function createLifeCycle(_0x213e10,_0x2fe2cf,_0x23a0b4,_0x2c89bd){const _0x514133=new cloud_enabled_life_cycle_1[(a1_0x22be('0x4a'))](_0x213e10,(0x0,environment_1[a1_0x22be('0x51')])(_0x2fe2cf),!![],_0x2fe2cf['cacheableOperations']||[],_0x23a0b4,_0x2c89bd);try{const {CompositeLifeCycle}=require(a1_0x22be('0x1a'));if(!CompositeLifeCycle)return _0x514133;return new CompositeLifeCycle([_0x2fe2cf[a1_0x22be('0x3b')],_0x514133]);}catch(_0x196e8b){return _0x514133;}}function fetchUrlsForKnownHashesUpfront(_0xa67940,_0x4b5b57,_0x45466e,_0x18691d,_0x2d6232){return __awaiter(this,void 0x0,void 0x0,function*(){if(_0x18691d[a1_0x22be('0x32')])return;let _0x4cd039=_0x45466e[a1_0x22be('0x33')](_0x1e2709=>_0x1e2709[a1_0x22be('0x34')])[a1_0x22be('0x50')](_0x3e7858=>!!_0x3e7858);const _0x424523=(0x0,environment_1['getNxCacheDirectory'])(_0x18691d);const _0x1123f2=yield Promise[a1_0x22be('0x15')](_0x4cd039[a1_0x22be('0x33')](_0x582525=>{const _0x37b46a=(0x0,path_1['join'])(_0x424523,_0x582525+a1_0x22be('0x4f'));return(0x0,fs_extra_1[a1_0x22be('0x12')])(_0x37b46a);}));const _0x4fc15b=[];for(let _0x2da5c5=0x0;_0x2da5c5<_0x1123f2['length'];++_0x2da5c5){if(!_0x1123f2[_0x2da5c5]){_0x4fc15b[a1_0x22be('0x46')](_0x4cd039[_0x2da5c5]);}}if(_0x4fc15b['length']>0x0){const _0x1c4365=_0xa67940[a1_0x22be('0x35')](_0x2d6232,_0x4fc15b);for(const _0x213e72 of _0x4fc15b){_0x4b5b57[a1_0x22be('0x47')][_0x213e72]=_0x1c4365;}}});}function cloudEnabledTasksRunner(_0x2c4feb,_0x2fecec,_0x4d5b0d,_0x273c5b=![]){var _0x4128af;const _0x48570b=process[a1_0x22be('0x29')][a1_0x22be('0x21')];const _0x38d418={'statuses':{},'scheduledTasks':[],'requests':{},'allTasks':_0x2c4feb};const _0x26f8da=_0x2fecec['lifeCycle']===undefined;const _0x49e91d=[];const _0x1a1225=new message_reporter_1[(a1_0x22be('0x17'))](_0x2fecec);const _0x2d3a0f=createApi(_0x1a1225,_0x2fecec,_0x38d418);const _0x1b4762=new end_of_run_message_1[(a1_0x22be('0x54'))](_0x38d418,_0x49e91d,_0x48570b);const _0x528499=new output_obfuscator_1[(a1_0x22be('0x14'))](_0x2fecec['maskedProperties']);const _0x19e63f=new Date()['toISOString']();const _0x39be7e=createLifeCycle(_0x38d418,_0x2fecec,_0x528499,_0x49e91d);const _0x34eff7=environment_1[a1_0x22be('0x53')]||_0x2fecec['encryptionKey'];const _0x4881af=new e2e_encryption_1['E2EEncryption'](_0x34eff7);const _0x9fe864=new error_reporter_api_1[(a1_0x22be('0x31'))](_0x2fecec);const _0x542c59=(0x0,environment_1[a1_0x22be('0x0')])(_0x48570b)||!((_0x4128af=_0x4d5b0d[a1_0x22be('0xa')])===null||_0x4128af===void 0x0?void 0x0:_0x4128af['enabled']());const _0x512f1f=new file_storage_1[(a1_0x22be('0x41'))](_0x4881af,_0x9fe864,_0x2fecec,a1_0x22be('0x4'));const _0x4f838b=new cloud_remote_cache_1[(a1_0x22be('0x56'))](_0x1a1225,_0x2d3a0f,_0x38d418,_0x512f1f,_0x48570b,_0x542c59);fetchUrlsForKnownHashesUpfront(_0x2d3a0f,_0x38d418,_0x2c4feb,_0x2fecec,_0x48570b);delete process['env'][a1_0x22be('0x21')];const _0x4ccef6=tasksRunner(_0x2c4feb,Object[a1_0x22be('0x36')](Object[a1_0x22be('0x36')]({},_0x2fecec),{'remoteCache':_0x4f838b,'lifeCycle':_0x39be7e}),_0x4d5b0d);if(_0x4ccef6[a1_0x22be('0x59')]){const {Subject}=require(a1_0x22be('0xe'));const _0x49137e=new Subject();_0x4ccef6[a1_0x22be('0x59')]({'next':_0x1b78fd=>_0x49137e[a1_0x22be('0x5a')](_0x1b78fd),'error':_0x35510e=>_0x49137e[a1_0x22be('0x44')](_0x35510e),'complete':()=>__awaiter(this,void 0x0,void 0x0,function*(){const _0xee27cf=yield onComplete({'daemon':_0x4d5b0d['daemon'],'options':_0x2fecec,'fileStorage':_0x512f1f,'remoteCache':_0x4f838b,'api':_0x2d3a0f,'outputObfuscator':_0x528499,'runStartTime':_0x19e63f,'messages':_0x1a1225,'endOfRunMessage':_0x1b4762,'taskExecutions':_0x49e91d,'versionOfNxBefore133':_0x26f8da,'inner':_0x273c5b,'encryptionKey':_0x34eff7,'storeInCurrentProcess':_0x542c59,'runContext':_0x38d418,'distributedExecutionId':_0x48570b});if(!_0xee27cf&&(0x0,environment_1[a1_0x22be('0x0')])(_0x48570b)){process['exit'](environment_1[a1_0x22be('0x7')]);}_0x49137e[a1_0x22be('0x6')]();})});return _0x49137e;}else{return _0x4ccef6['then'](_0x3fbe28=>__awaiter(this,void 0x0,void 0x0,function*(){const _0x4aa8d7=yield onComplete({'daemon':_0x4d5b0d['daemon'],'options':_0x2fecec,'fileStorage':_0x512f1f,'remoteCache':_0x4f838b,'api':_0x2d3a0f,'outputObfuscator':_0x528499,'runStartTime':_0x19e63f,'messages':_0x1a1225,'endOfRunMessage':_0x1b4762,'taskExecutions':_0x49e91d,'versionOfNxBefore133':_0x26f8da,'inner':_0x273c5b,'encryptionKey':_0x34eff7,'storeInCurrentProcess':_0x542c59,'runContext':_0x38d418,'distributedExecutionId':_0x48570b});if(!_0x4aa8d7&&(0x0,environment_1['agentRunningInDistributedExecution'])(_0x48570b)){process[a1_0x22be('0x1e')](environment_1[a1_0x22be('0x7')]);}return _0x3fbe28;}))['catch'](_0xa76176=>__awaiter(this,void 0x0,void 0x0,function*(){const _0x4ff253=yield onComplete({'daemon':_0x4d5b0d[a1_0x22be('0xa')],'options':_0x2fecec,'fileStorage':_0x512f1f,'remoteCache':_0x4f838b,'api':_0x2d3a0f,'outputObfuscator':_0x528499,'runStartTime':_0x19e63f,'messages':_0x1a1225,'endOfRunMessage':_0x1b4762,'taskExecutions':_0x49e91d,'versionOfNxBefore133':_0x26f8da,'inner':_0x273c5b,'encryptionKey':_0x34eff7,'storeInCurrentProcess':_0x542c59,'runContext':_0x38d418,'distributedExecutionId':_0x48570b});if(!_0x4ff253&&(0x0,environment_1['agentRunningInDistributedExecution'])(_0x48570b)){process[a1_0x22be('0x1e')](environment_1[a1_0x22be('0x7')]);}throw _0xa76176;}));}}exports[a1_0x22be('0x3e')]=cloudEnabledTasksRunner;