@nrwl/nx-cloud 12.5.0-beta.2 → 12.5.3

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.
Files changed (52) hide show
  1. package/bin/nx-cloud.js +4 -4
  2. package/bin/nx-cloud.js.map +1 -1
  3. package/lib/core/api/run-group.api.d.ts +1 -1
  4. package/lib/core/api/run-group.api.js +1 -52
  5. package/lib/core/api/run-group.api.js.map +1 -1
  6. package/lib/core/commands/clean-up-agents.js +2 -2
  7. package/lib/core/commands/clean-up-agents.js.map +1 -1
  8. package/lib/core/commands/start-ci-run.js +4 -4
  9. package/lib/core/commands/start-ci-run.js.map +1 -1
  10. package/lib/core/commands/stop-all-agents.js +3 -3
  11. package/lib/core/commands/stop-all-agents.js.map +1 -1
  12. package/lib/core/file-storage/e2e-encryption.js +7 -7
  13. package/lib/core/file-storage/e2e-encryption.js.map +1 -1
  14. package/lib/core/file-storage/file-storage.js +43 -24
  15. package/lib/core/file-storage/file-storage.js.map +1 -1
  16. package/lib/core/models/run-data.model.d.ts +1 -1
  17. package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +1 -125
  18. package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js.map +1 -1
  19. package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +1 -113
  20. package/lib/core/runners/cloud-enabled/cloud-remote-cache.js.map +1 -1
  21. package/lib/core/runners/cloud-enabled/cloud-run.api.js +1 -128
  22. package/lib/core/runners/cloud-enabled/cloud-run.api.js.map +1 -1
  23. package/lib/core/runners/cloud-enabled/task-runner-life-cycle.js +1 -119
  24. package/lib/core/runners/cloud-enabled/task-runner-life-cycle.js.map +1 -1
  25. package/lib/core/runners/distributed-agent/distributed-agent.api.js +1 -61
  26. package/lib/core/runners/distributed-agent/distributed-agent.api.js.map +1 -1
  27. package/lib/core/runners/distributed-agent/distributed-agent.runner.js +1 -227
  28. package/lib/core/runners/distributed-agent/distributed-agent.runner.js.map +1 -1
  29. package/lib/core/runners/distributed-execution/distributed-execution.api.d.ts +1 -1
  30. package/lib/core/runners/distributed-execution/distributed-execution.api.js +1 -85
  31. package/lib/core/runners/distributed-execution/distributed-execution.api.js.map +1 -1
  32. package/lib/core/runners/distributed-execution/distributed-execution.runner.js +1 -268
  33. package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +1 -1
  34. package/lib/core/terminal-output/end-of-run-message.js +1 -1
  35. package/lib/core/terminal-output/end-of-run-message.js.map +1 -1
  36. package/lib/core/terminal-output/message-reporter.js +1 -1
  37. package/lib/core/terminal-output/message-reporter.js.map +1 -1
  38. package/lib/core/terminal-output/output-obfuscator.js +1 -1
  39. package/lib/core/terminal-output/output-obfuscator.js.map +1 -1
  40. package/lib/generators/init/init.js +1 -1
  41. package/lib/generators/init/init.js.map +1 -1
  42. package/lib/nx-cloud-tasks-runner.js +7 -7
  43. package/lib/nx-cloud-tasks-runner.js.map +1 -1
  44. package/lib/utilities/axios.js +1 -1
  45. package/lib/utilities/axios.js.map +1 -1
  46. package/lib/utilities/environment.d.ts +2 -1
  47. package/lib/utilities/environment.js +7 -6
  48. package/lib/utilities/environment.js.map +1 -1
  49. package/lib/utilities/metric-logger.d.ts +34 -0
  50. package/lib/utilities/metric-logger.js +72 -0
  51. package/lib/utilities/metric-logger.js.map +1 -0
  52. package/package.json +1 -1
@@ -1,227 +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.startAgent = void 0;
13
- const output_1 = require("@nrwl/workspace/src/utilities/output");
14
- const child_process_1 = require("child_process");
15
- const stripJsonComments = require("strip-json-comments");
16
- const distributed_agent_api_1 = require("./distributed-agent.api");
17
- const waiter_1 = require("../../../utilities/waiter");
18
- const environment_1 = require("../../../utilities/environment");
19
- const print_run_group_error_1 = require("../../error/print-run-group-error");
20
- const create_no_new_messages_timeout_1 = require("../../../utilities/create-no-new-messages-timeout");
21
- const fs_1 = require("fs");
22
- function executeTasks(options, api) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- let completedStatusCode = 0;
25
- let apiResponse = null;
26
- const failIfSameTasksIn30Mins = create_no_new_messages_timeout_1.createNoNewMessagesTimeout();
27
- const waiter = new waiter_1.Waiter();
28
- let completedTasks = [];
29
- const startTime = new Date();
30
- let executedAnyTasks = false;
31
- while (true) {
32
- if (environment_1.VERBOSE_LOGGING) {
33
- output_1.output.note({
34
- title: 'Fetching tasks...',
35
- });
36
- }
37
- apiResponse = yield api.tasks(apiResponse ? apiResponse.executionId : null, completedStatusCode, completedTasks);
38
- if (environment_1.VERBOSE_LOGGING) {
39
- output_1.output.note({
40
- title: 'API Response',
41
- bodyLines: [
42
- `completed: ${apiResponse.completed}`,
43
- `retryDuring: ${apiResponse.retryDuring}`,
44
- `executionId: ${apiResponse.executionId}`,
45
- `number of tasks: ${apiResponse.tasks.length}`,
46
- `error: ${apiResponse.criticalErrorMessage}`,
47
- `maxParallel: ${apiResponse.maxParallel}`,
48
- ],
49
- });
50
- }
51
- if (apiResponse.criticalErrorMessage) {
52
- output_1.output.error({
53
- title: 'Distributed Execution Terminated',
54
- bodyLines: ['Error:', apiResponse.criticalErrorMessage],
55
- });
56
- process.exit(0);
57
- }
58
- // run group is completed but it might be a rerun
59
- // we will try several times before going further and
60
- // completed the response
61
- // we only do it if we haven't executed any tasks
62
- if ((apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.retryDuring) &&
63
- (apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.retryDuring) !== 0 &&
64
- !executedAnyTasks &&
65
- new Date().getTime() - startTime.getTime() > apiResponse.retryDuring) {
66
- yield waiter.wait();
67
- continue;
68
- }
69
- if (apiResponse.completed)
70
- return;
71
- failIfSameTasksIn30Mins(apiResponse.tasks.map((t) => t.taskId).join(''));
72
- if (!apiResponse.executionId) {
73
- if (environment_1.VERBOSE_LOGGING) {
74
- output_1.output.note({
75
- title: 'Waiting...',
76
- });
77
- }
78
- yield waiter.wait();
79
- completedStatusCode = 0;
80
- completedTasks = [];
81
- continue;
82
- }
83
- waiter.reset();
84
- executedAnyTasks = true;
85
- const r = invokeTasksUsingRunMany(options, apiResponse.executionId, apiResponse.tasks, apiResponse.maxParallel);
86
- completedStatusCode = r.completedStatusCode;
87
- completedTasks = r.completedTasks;
88
- }
89
- });
90
- }
91
- function readCompletedTasks(options) {
92
- try {
93
- const cacheDirectory = options.cacheDirectory || './node_modules/.cache/nx';
94
- return JSON.parse(fs_1.readFileSync(`${cacheDirectory}/tasks-hashes`).toString());
95
- }
96
- catch (e) {
97
- output_1.output.error({
98
- title: "Command execution failed. Tasks hashes haven't been recorded.",
99
- });
100
- return [];
101
- }
102
- }
103
- function invokeTasksUsingRunMany(options, executionId, tasks, maxParallel) {
104
- let completedStatusCode = 0;
105
- const completedTasks = [];
106
- for (const g of groupByTarget(tasks)) {
107
- const config = g.configuration ? `--configuration=${g.configuration}` : ``;
108
- const parallel = maxParallel > 1 ? ` --parallel --max-parallel=${maxParallel}` : ``;
109
- // TODO use pnpx or yarn when needed
110
- const command = `npx nx run-many --target=${g.target} ${config} --projects=${g.projects.join(',')} ${g.params}${parallel}`;
111
- if (environment_1.VERBOSE_LOGGING) {
112
- output_1.output.note({
113
- title: `Executing: '${command}'`,
114
- });
115
- }
116
- try {
117
- child_process_1.execSync(command, {
118
- stdio: ['inherit', 'inherit', 'inherit'],
119
- env: Object.assign(Object.assign({}, process.env), { NX_CACHE_FAILURES: 'true', NX_CLOUD_DISTRIBUTED_EXECUTION_ID: executionId }),
120
- });
121
- }
122
- catch (e) {
123
- if (e.status === environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE) {
124
- throw e;
125
- }
126
- else {
127
- completedStatusCode = 1;
128
- }
129
- }
130
- finally {
131
- completedTasks.push(...readCompletedTasks(options));
132
- }
133
- }
134
- return { completedStatusCode, completedTasks };
135
- }
136
- function groupByTarget(tasks) {
137
- const res = [];
138
- tasks.forEach((t) => {
139
- const r = res.find((rr) => rr.target === t.target && rr.configuration === t.configuration);
140
- if (r) {
141
- r.projects.push(t.projectName);
142
- }
143
- else {
144
- res.push({
145
- target: t.target,
146
- projects: [t.projectName],
147
- params: t.params,
148
- configuration: t.configuration,
149
- });
150
- }
151
- });
152
- return res;
153
- }
154
- function getAgentName() {
155
- if (process.env.NX_AGENT_NAME !== undefined) {
156
- return process.env.NX_AGENT_NAME;
157
- }
158
- else if (process.env.CIRCLECI !== undefined) {
159
- return process.env.CIRCLE_STAGE;
160
- }
161
- else {
162
- return `Agent ${Math.floor(Math.random() * 100000)}`;
163
- }
164
- }
165
- function createAgentLockfile(options, agentName) {
166
- const cacheDirectory = options.cacheDirectory || './node_modules/.cache/nx';
167
- const lockFileDirectory = `${cacheDirectory}/lockfiles`;
168
- const lockFilePath = `${lockFileDirectory}/${agentName}.lock`;
169
- if (!fs_1.existsSync(`${lockFileDirectory}`)) {
170
- fs_1.mkdirSync(`${lockFileDirectory}`, { recursive: true });
171
- }
172
- // Check for other agents' lockfiles and warn if exist
173
- const lockFiles = fs_1.readdirSync(`${lockFileDirectory}`);
174
- if (lockFiles.length) {
175
- // Check to make sure the current agent name is not in use (only 1/100000 ^ 2 chance of this)
176
- if (lockFiles.includes(`${agentName}.lock`)) {
177
- output_1.output.error({
178
- title: 'Duplicate Agent ID Detected',
179
- bodyLines: [
180
- 'We have detected another agent with this ID running in this workspace. This should not happen.',
181
- '',
182
- 'End all currently running agents, run "npx nx-cloud clean-up-agents", and try again.',
183
- ],
184
- });
185
- process.exit(1);
186
- }
187
- output_1.output.warn({
188
- title: 'Other Nx Cloud Agents Detected',
189
- bodyLines: [
190
- 'We have detected other agents running in this workspace. This can cause unexpected behavior.',
191
- '',
192
- 'This can also be a false positive caused by agents that did not shut down correctly.',
193
- 'If you believe this is the case, run "npx nx-cloud clean-up-agents".',
194
- ],
195
- });
196
- }
197
- fs_1.writeFileSync(`${lockFilePath}`, '');
198
- process.on('exit', () => cleanupAgentLockfile(lockFilePath));
199
- process.on('SIGINT', () => cleanupAgentLockfile(lockFilePath));
200
- }
201
- function cleanupAgentLockfile(lockFilePath) {
202
- if (fs_1.existsSync(`${lockFilePath}`)) {
203
- fs_1.rmSync(`${lockFilePath}`);
204
- }
205
- }
206
- function startAgent() {
207
- return __awaiter(this, void 0, void 0, function* () {
208
- const runGroup = environment_1.getRunGroup();
209
- if (!runGroup) {
210
- print_run_group_error_1.printRunGroupError();
211
- return process.exit(1);
212
- }
213
- output_1.output.note({
214
- title: 'Starting an agent for running Nx tasks',
215
- });
216
- const options = JSON.parse(stripJsonComments(fs_1.readFileSync('nx.json').toString())).tasksRunnerOptions.default.options;
217
- const agentName = getAgentName();
218
- createAgentLockfile(options, agentName);
219
- const api = new distributed_agent_api_1.DistributedAgentApi(options, runGroup, agentName);
220
- return executeTasks(options, api).catch((e) => __awaiter(this, void 0, void 0, function* () {
221
- yield api.completeRunGroupWithError(`Critical Error in Agent: "${e.message}"`);
222
- throw e;
223
- }));
224
- });
225
- }
226
- exports.startAgent = startAgent;
227
- //# sourceMappingURL=distributed-agent.runner.js.map
1
+ const a5_0x4ab1=['0x18','This\x20can\x20also\x20be\x20a\x20false\x20positive\x20caused\x20by\x20agents\x20that\x20did\x20not\x20shut\x20down\x20correctly.','Executing:\x20\x27','0x35','0x1a','0x27','inherit','0x39','./node_modules/.cache/nx','retryDuring','completedStatusCode','../../error/print-run-group-error','reset','../../../utilities/metric-logger','Distributed\x20Execution\x20Terminated','Critical\x20Error\x20in\x20Agent:\x20\x22','0x24','throw','cacheDirectory','Error:','value','0x1e','0x4f','0x11','CIRCLE_STAGE','error:\x20','Starting\x20an\x20agent\x20for\x20running\x20Nx\x20tasks','__awaiter','0x4e','0x21','NX_AGENT_NAME','number\x20of\x20tasks:\x20','../../../utilities/environment','executionId','0x13','0xf','0x2a','/tasks-hashes','0x1f','criticalErrorMessage','0x28','0x2d','random','0x3','@nrwl/workspace/src/utilities/output','0x40','We\x20have\x20detected\x20another\x20agent\x20with\x20this\x20ID\x20running\x20in\x20this\x20workspace.\x20This\x20should\x20not\x20happen.','0x3a','/lockfiles','readdirSync','0x51','0xc','0x16','0x4b','nx.json','CIRCLECI','Waiting...','0x4d','message','0x47','0x7','completedTasks','0x3e','0x1d','0x2c','0x32','0x22','completeRunGroupWithError','0x9','__esModule','0x52','0x46','0x30','\x20--projects=','0x19','then','0x4a','forEach','--configuration=','status','0x23','error','length','Command\x20execution\x20failed.\x20Tasks\x20hashes\x20haven\x27t\x20been\x20recorded.','0x50','apply','floor','0x42','catch','../../../utilities/create-no-new-messages-timeout','strip-json-comments','0x8','0x38','startAgent','.lock','0x12','target','parse','0x49','\x20--parallel\x20--max-parallel=','default','maxParallel','0x31','env','VERBOSE_LOGGING','0x36','0x10','next','printRunGroupError','Other\x20Nx\x20Cloud\x20Agents\x20Detected','0x34','done','0x5','0x2b','0xb','taskId','configuration','0x3c','tasks','DistributedAgentApi','0x43','existsSync','Duplicate\x20Agent\x20ID\x20Detected','getTime','0x29','0xe','push','shift','mkdirSync','projectName','0x48','toString','0x44','0x26','We\x20have\x20detected\x20other\x20agents\x20running\x20in\x20this\x20workspace.\x20This\x20can\x20cause\x20unexpected\x20behavior.','find','warn','0x2f','maxParallel:\x20','params','note','writeFileSync','output','executionId:\x20','retryDuring:\x20','API\x20Response','readFileSync','join','true','0x20','0x25','DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE'];(function(_0x4353c4,_0x4ab121){const _0x25d747=function(_0x13b543){while(--_0x13b543){_0x4353c4['push'](_0x4353c4['shift']());}};_0x25d747(++_0x4ab121);}(a5_0x4ab1,0x17f));const a5_0x25d7=function(_0x4353c4,_0x4ab121){_0x4353c4=_0x4353c4-0x0;let _0x25d747=a5_0x4ab1[_0x4353c4];return _0x25d747;};const a5_0x3116=[a5_0x25d7('0x75'),a5_0x25d7('0x4a'),'exit',a5_0x25d7('0x70'),a5_0x25d7('0x5a'),a5_0x25d7('0x61'),'projects',a5_0x25d7('0x69'),a5_0x25d7('0x34'),a5_0x25d7('0x3b'),a5_0x25d7('0x56'),'assign',a5_0x25d7('0x6a'),'If\x20you\x20believe\x20this\x20is\x20the\x20case,\x20run\x20\x22npx\x20nx-cloud\x20clean-up-agents\x22.','execSync',a5_0x25d7('0x2a'),a5_0x25d7('0x12'),a5_0x25d7('0x7f'),a5_0x25d7('0x11'),a5_0x25d7('0x5c'),'completed:\x20',a5_0x25d7('0x2b'),a5_0x25d7('0x2c'),'getRunGroup','completed','push',a5_0x25d7('0x77'),a5_0x25d7('0x80'),a5_0x25d7('0x28'),a5_0x25d7('0x6'),a5_0x25d7('0x40'),a5_0x25d7('0x51'),a5_0x25d7('0x86'),'child_process',a5_0x25d7('0x39'),'./distributed-agent.api',a5_0x25d7('0x55'),a5_0x25d7('0x4b'),a5_0x25d7('0x31'),a5_0x25d7('0x7a'),a5_0x25d7('0x43'),a5_0x25d7('0x92'),'wait','End\x20all\x20currently\x20running\x20agents,\x20run\x20\x22npx\x20nx-cloud\x20clean-up-agents\x22,\x20and\x20try\x20again.',a5_0x25d7('0x1c'),a5_0x25d7('0x62'),'Fetching\x20tasks...',a5_0x25d7('0x83'),'npx\x20nx\x20run-many\x20--target=',a5_0x25d7('0x3c'),a5_0x25d7('0x48'),a5_0x25d7('0x25'),a5_0x25d7('0x52'),a5_0x25d7('0x94'),a5_0x25d7('0x42'),a5_0x25d7('0x96'),a5_0x25d7('0x7'),'VERBOSE_LOGGING','length',a5_0x25d7('0xf'),a5_0x25d7('0x63'),a5_0x25d7('0x5d'),a5_0x25d7('0x9'),a5_0x25d7('0x81'),a5_0x25d7('0x0'),a5_0x25d7('0x5b'),'createNoNewMessagesTimeout',a5_0x25d7('0x67'),a5_0x25d7('0x58'),a5_0x25d7('0x38'),a5_0x25d7('0x2'),a5_0x25d7('0x18'),a5_0x25d7('0xb'),a5_0x25d7('0x27'),a5_0x25d7('0x79'),'unlinkSync',a5_0x25d7('0x97'),'startAgent',a5_0x25d7('0x3f'),'maxParallel',a5_0x25d7('0x32'),a5_0x25d7('0x20'),a5_0x25d7('0x44'),'includes'];(function(_0x4b969f,_0x2194e4){const _0x58ce77=function(_0x3c4bdc){while(--_0x3c4bdc){_0x4b969f[a5_0x25d7('0x2f')](_0x4b969f[a5_0x25d7('0x30')]());}};_0x58ce77(++_0x2194e4);}(a5_0x3116,0xaf));const a5_0x2e94=function(_0x245b2,_0x4accda){_0x245b2=_0x245b2-0x0;let _0x30fa61=a5_0x3116[_0x245b2];return _0x30fa61;};'use\x20strict';var __awaiter=this&&this[a5_0x25d7('0x64')]||function(_0x3dae36,_0x4c0eda,_0x58b6db,_0x1b6891){function _0x45f597(_0x5349ef){return _0x5349ef instanceof _0x58b6db?_0x5349ef:new _0x58b6db(function(_0x2d3d45){_0x2d3d45(_0x5349ef);});}return new(_0x58b6db||(_0x58b6db=Promise))(function(_0x5ce360,_0x5d774a){function _0x5d187e(_0x3128f5){try{_0x478975(_0x1b6891[a5_0x2e94(a5_0x25d7('0x47'))](_0x3128f5));}catch(_0x25dee7){_0x5d774a(_0x25dee7);}}function _0x37b3c9(_0x1a4e3c){try{_0x478975(_0x1b6891[a5_0x2e94(a5_0x25d7('0x7b'))](_0x1a4e3c));}catch(_0xce4f45){_0x5d774a(_0xce4f45);}}function _0x478975(_0x201336){_0x201336[a5_0x2e94(a5_0x25d7('0x95'))]?_0x5ce360(_0x201336[a5_0x25d7('0x5d')]):_0x45f597(_0x201336[a5_0x2e94(a5_0x25d7('0x1a'))])[a5_0x2e94('0x2e')](_0x5d187e,_0x37b3c9);}_0x478975((_0x1b6891=_0x1b6891[a5_0x2e94(a5_0x25d7('0x7d'))](_0x3dae36,_0x4c0eda||[]))[a5_0x2e94('0x25')]());});};Object['defineProperty'](exports,a5_0x25d7('0x8e'),{'value':!![]});exports[a5_0x25d7('0xe')]=void 0x0;const output_1=require(a5_0x2e94(a5_0x25d7('0x82')));const child_process_1=require(a5_0x2e94(a5_0x25d7('0x4d')));const stripJsonComments=require(a5_0x2e94('0x41'));const distributed_agent_api_1=require(a5_0x2e94('0x1c'));const waiter_1=require('../../../utilities/waiter');const environment_1=require(a5_0x2e94('0x0'));const print_run_group_error_1=require(a5_0x25d7('0x54'));const create_no_new_messages_timeout_1=require(a5_0x25d7('0xa'));const fs_1=require('fs');const metric_logger_1=require(a5_0x2e94(a5_0x25d7('0x74')));function executeTasks(_0x5d8b60,_0x53dec5){return __awaiter(this,void 0x0,void 0x0,function*(){let _0x4217c7=0x0;let _0x26cdb9=null;const _0xaa129c=(0x0,create_no_new_messages_timeout_1[a5_0x2e94('0x3b')])();const _0x3c62dc=new waiter_1['Waiter']();let _0x1467c9=[];const _0x9f8b4c=new Date();let _0xc2492a=![];while(!![]){if(environment_1[a5_0x2e94(a5_0x25d7('0x8a'))]){output_1[a5_0x25d7('0x3f')][a5_0x25d7('0x3d')]({'title':a5_0x2e94(a5_0x25d7('0x4e'))});}_0x26cdb9=yield _0x53dec5[a5_0x2e94('0x42')](_0x26cdb9?_0x26cdb9[a5_0x25d7('0x6a')]:null,_0x4217c7,_0x1467c9);if(environment_1[a5_0x25d7('0x19')]){output_1[a5_0x2e94(a5_0x25d7('0x84'))][a5_0x25d7('0x3d')]({'title':a5_0x2e94(a5_0x25d7('0x3a')),'bodyLines':[a5_0x2e94('0xd')+_0x26cdb9[a5_0x2e94('0x11')],a5_0x25d7('0x41')+_0x26cdb9[a5_0x2e94(a5_0x25d7('0x72'))],a5_0x2e94('0x17')+_0x26cdb9[a5_0x2e94(a5_0x25d7('0x21'))],a5_0x25d7('0x68')+_0x26cdb9[a5_0x2e94(a5_0x25d7('0x8'))][a5_0x2e94('0x33')],a5_0x2e94(a5_0x25d7('0x36'))+_0x26cdb9[a5_0x2e94(a5_0x25d7('0x5'))],a5_0x2e94('0x2')+_0x26cdb9[a5_0x2e94(a5_0x25d7('0x33'))]]});}if(_0x26cdb9[a5_0x2e94('0x50')]){output_1[a5_0x2e94(a5_0x25d7('0x84'))][a5_0x25d7('0x2')]({'title':a5_0x25d7('0x57'),'bodyLines':[a5_0x2e94(a5_0x25d7('0x7c')),_0x26cdb9[a5_0x2e94(a5_0x25d7('0x5'))]]});process[a5_0x2e94(a5_0x25d7('0x5f'))](0x0);}if((_0x26cdb9===null||_0x26cdb9===void 0x0?void 0x0:_0x26cdb9[a5_0x2e94(a5_0x25d7('0x72'))])&&(_0x26cdb9===null||_0x26cdb9===void 0x0?void 0x0:_0x26cdb9[a5_0x2e94(a5_0x25d7('0x72'))])!==0x0&&!_0xc2492a&&new Date()[a5_0x2e94(a5_0x25d7('0x6c'))]()-_0x9f8b4c[a5_0x2e94(a5_0x25d7('0x6c'))]()>_0x26cdb9[a5_0x2e94(a5_0x25d7('0x72'))]){yield _0x3c62dc[a5_0x2e94('0x23')]();continue;}if(_0x26cdb9[a5_0x2e94(a5_0x25d7('0x60'))])return;_0xaa129c(_0x26cdb9[a5_0x2e94(a5_0x25d7('0x8'))]['map'](_0x24bccc=>_0x24bccc[a5_0x25d7('0x24')])[a5_0x2e94(a5_0x25d7('0x7e'))](''));if(!_0x26cdb9[a5_0x25d7('0x6a')]){if(environment_1[a5_0x2e94(a5_0x25d7('0x8a'))]){output_1[a5_0x25d7('0x3f')][a5_0x25d7('0x3d')]({'title':a5_0x2e94(a5_0x25d7('0xd'))});}yield _0x3c62dc[a5_0x2e94(a5_0x25d7('0x1'))]();_0x4217c7=0x0;_0x1467c9=[];continue;}_0x3c62dc[a5_0x2e94(a5_0x25d7('0x88'))]();_0xc2492a=!![];const _0x58029d=invokeTasksUsingRunMany(_0x5d8b60,_0x26cdb9[a5_0x2e94(a5_0x25d7('0x21'))],_0x26cdb9[a5_0x2e94(a5_0x25d7('0x8'))],_0x26cdb9[a5_0x25d7('0x16')]);_0x4217c7=_0x58029d[a5_0x25d7('0x53')];_0x1467c9=_0x58029d[a5_0x2e94(a5_0x25d7('0x93'))];}});}function readCompletedTasks(_0x510f3c){try{const _0x28fa09=_0x510f3c[a5_0x2e94(a5_0x25d7('0x78'))]||a5_0x2e94(a5_0x25d7('0x49'));return JSON[a5_0x2e94(a5_0x25d7('0x8d'))]((0x0,fs_1[a5_0x2e94(a5_0x25d7('0x66'))])(_0x28fa09+a5_0x25d7('0x6e'))[a5_0x2e94('0x1')]());}catch(_0x2f6e76){output_1[a5_0x2e94(a5_0x25d7('0x84'))][a5_0x2e94('0x3f')]({'title':a5_0x25d7('0x4')});return[];}}function invokeTasksUsingRunMany(_0x26ac66,_0x4250a1,_0x1d8f51,_0x481b41){let _0x20f551=0x0;const _0x2cf8f3=[];for(const _0x23b845 of groupByTarget(_0x1d8f51)){const _0x1bc807=_0x23b845[a5_0x25d7('0x25')]?a5_0x2e94('0x45')+_0x23b845[a5_0x2e94(a5_0x25d7('0x89'))]:'';const _0x403117=_0x481b41>0x1?a5_0x25d7('0x14')+_0x481b41:'';const _0x151eb4=a5_0x2e94(a5_0x25d7('0x2d'))+_0x23b845[a5_0x2e94(a5_0x25d7('0x23'))]+'\x20'+_0x1bc807+a5_0x2e94(a5_0x25d7('0x8b'))+_0x23b845[a5_0x2e94('0x53')][a5_0x2e94('0x4b')](',')+'\x20'+_0x23b845[a5_0x2e94(a5_0x25d7('0x6d'))]+_0x403117;if(environment_1[a5_0x2e94(a5_0x25d7('0x8a'))]){output_1['output'][a5_0x25d7('0x3d')]({'title':a5_0x2e94(a5_0x25d7('0x5e'))+_0x151eb4+'\x27'});}try{(0x0,child_process_1[a5_0x2e94(a5_0x25d7('0x85'))])(_0x151eb4,{'stdio':['inherit','inherit',a5_0x25d7('0x4f')],'env':Object[a5_0x2e94('0x4')](Object[a5_0x2e94('0x4')]({},process[a5_0x25d7('0x18')]),{'NX_CACHE_FAILURES':a5_0x25d7('0x45'),'NX_CLOUD_DISTRIBUTED_EXECUTION_ID':_0x4250a1})});}catch(_0x4fe9bf){if(_0x4fe9bf[a5_0x2e94(a5_0x25d7('0x50'))]===environment_1[a5_0x2e94(a5_0x25d7('0x22'))]){throw _0x4fe9bf;}else{_0x20f551=0x1;}}finally{_0x2cf8f3[a5_0x25d7('0x2f')](...readCompletedTasks(_0x26ac66));}}return{'completedStatusCode':_0x20f551,'completedTasks':_0x2cf8f3};}function groupByTarget(_0x5c280e){const _0x150b2e=[];_0x5c280e[a5_0x2e94(a5_0x25d7('0x91'))](_0x5773d7=>{const _0xc4801=_0x150b2e[a5_0x2e94(a5_0x25d7('0x87'))](_0x4d0d5f=>_0x4d0d5f[a5_0x2e94(a5_0x25d7('0x23'))]===_0x5773d7[a5_0x2e94(a5_0x25d7('0x23'))]&&_0x4d0d5f[a5_0x25d7('0x25')]===_0x5773d7[a5_0x2e94(a5_0x25d7('0x89'))]);if(_0xc4801){_0xc4801[a5_0x2e94('0x53')][a5_0x2e94(a5_0x25d7('0x10'))](_0x5773d7[a5_0x2e94('0x49')]);}else{_0x150b2e[a5_0x2e94(a5_0x25d7('0x10'))]({'target':_0x5773d7[a5_0x2e94(a5_0x25d7('0x23'))],'projects':[_0x5773d7[a5_0x2e94(a5_0x25d7('0x13'))]],'params':_0x5773d7[a5_0x2e94(a5_0x25d7('0x6d'))],'configuration':_0x5773d7[a5_0x2e94('0x2c')]});}});return _0x150b2e;}function getAgentName(){if(process[a5_0x2e94(a5_0x25d7('0x76'))]['NX_AGENT_NAME']!==undefined){return process[a5_0x2e94(a5_0x25d7('0x76'))][a5_0x2e94(a5_0x25d7('0x26'))];}else if(process[a5_0x2e94('0x40')][a5_0x2e94('0x14')]!==undefined){return process['env'][a5_0x2e94(a5_0x25d7('0x8f'))];}else{return'Agent\x20'+Math[a5_0x2e94(a5_0x25d7('0x17'))](Math[a5_0x25d7('0x73')]()*0x186a0);}}function createAgentLockfile(_0xdfafbd,_0x5a5c35){const _0x79f19d=_0xdfafbd[a5_0x2e94(a5_0x25d7('0x78'))]||a5_0x2e94(a5_0x25d7('0x49'));const _0x214b95=_0x79f19d+a5_0x2e94(a5_0x25d7('0x29'));const _0x10dbe3=_0x214b95+'/'+_0x5a5c35+a5_0x2e94(a5_0x25d7('0x1f'));if(!(0x0,fs_1[a5_0x2e94(a5_0x25d7('0xc'))])(_0x214b95)){(0x0,fs_1[a5_0x2e94(a5_0x25d7('0x6f'))])(_0x214b95,{'recursive':!![]});}const _0x3ab967=(0x0,fs_1[a5_0x2e94(a5_0x25d7('0x46'))])(_0x214b95);if(_0x3ab967[a5_0x25d7('0x3')]){if(_0x3ab967[a5_0x2e94('0x4c')](_0x5a5c35+a5_0x25d7('0xf'))){output_1[a5_0x2e94(a5_0x25d7('0x84'))][a5_0x25d7('0x2')]({'title':a5_0x2e94(a5_0x25d7('0x2e')),'bodyLines':[a5_0x2e94(a5_0x25d7('0x6b')),'',a5_0x2e94(a5_0x25d7('0x59'))]});process[a5_0x2e94(a5_0x25d7('0x5f'))](0x1);}output_1[a5_0x2e94('0x47')][a5_0x2e94('0x1b')]({'title':a5_0x25d7('0x1e'),'bodyLines':[a5_0x25d7('0x37'),'',a5_0x2e94(a5_0x25d7('0x65')),a5_0x2e94('0x6')]});}(0x0,fs_1[a5_0x25d7('0x3e')])(_0x10dbe3,'');process['on'](a5_0x2e94(a5_0x25d7('0x5f')),()=>cleanupAgentLockfile(_0x10dbe3));process['on']('SIGINT',()=>cleanupAgentLockfile(_0x10dbe3));}function cleanupAgentLockfile(_0x289e58){if((0x0,fs_1[a5_0x2e94('0x8')])(_0x289e58)){(0x0,fs_1[a5_0x2e94(a5_0x25d7('0x35'))])(_0x289e58);}}function startAgent(){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x2e979c=(0x0,environment_1[a5_0x2e94(a5_0x25d7('0x1b'))])();if(!_0x2e979c){(0x0,print_run_group_error_1[a5_0x25d7('0x1d')])();return process[a5_0x2e94(a5_0x25d7('0x5f'))](0x1);}output_1[a5_0x2e94(a5_0x25d7('0x84'))][a5_0x25d7('0x3d')]({'title':a5_0x2e94(a5_0x25d7('0x4c'))});const _0x3f1c1b=JSON[a5_0x2e94(a5_0x25d7('0x8d'))](stripJsonComments((0x0,fs_1['readFileSync'])(a5_0x2e94('0xa'))[a5_0x2e94('0x1')]()))['tasksRunnerOptions'][a5_0x25d7('0x15')]['options'];const _0x748c97=getAgentName();createAgentLockfile(_0x3f1c1b,_0x748c97);const _0x2b070a=new distributed_agent_api_1[(a5_0x2e94('0x15'))](_0x3f1c1b,_0x2e979c,_0x748c97);return executeTasks(_0x3f1c1b,_0x2b070a)[a5_0x25d7('0x94')](_0x2eeb15=>__awaiter(this,void 0x0,void 0x0,function*(){yield(0x0,metric_logger_1['submitRunMetrics'])(_0x3f1c1b);return _0x2eeb15;}))[a5_0x2e94('0x37')](_0x4b343c=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x2b070a[a5_0x25d7('0x8c')](a5_0x2e94('0x3d')+_0x4b343c[a5_0x2e94(a5_0x25d7('0x71'))]+'\x22');throw _0x4b343c;}));});}exports[a5_0x2e94(a5_0x25d7('0x90'))]=startAgent;
@@ -1 +1 @@
1
- {"version":3,"file":"distributed-agent.runner.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/src/lib/core/runners/distributed-agent/distributed-agent.runner.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA8D;AAC9D,iDAAyC;AACzC,yDAAyD;AAEzD,mEAA8D;AAM9D,sDAAmD;AACnD,gEAIwC;AACxC,6EAAuE;AACvE,sGAA+F;AAC/F,2BAOY;AAEZ,SAAe,YAAY,CACzB,OAA+B,EAC/B,GAAwB;;QAExB,IAAI,mBAAmB,GAAG,CAAC,CAAC;QAC5B,IAAI,WAAW,GAA4B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AAC,CAAC;AACjE,CAAC;AAED,SAAS,oBAAoB,CAAC,YAAY;IACxC,IAAI,eAAU,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE;QACjC,WAAM,CAAC,GAAG,YAAY,EAAE,CAAC,CAAC;KAC3B;AACH,CAAC;AAED,SAAsB,UAAU;;QAC9B,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ,EAAE;YACb,0CAAkB,EAAE,CAAC;YACrB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACxB;QAED,eAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,wCAAwC;SAChD,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,iBAAiB,CAAC,iBAAY,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,CACtD,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC;QAErC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;QACjC,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAExC,MAAM,GAAG,GAAG,IAAI,2CAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QAElE,OAAO,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAO,CAAC,EAAE,EAAE;YAClD,MAAM,GAAG,CAAC,yBAAyB,CACjC,6BAA6B,CAAC,CAAC,OAAO,GAAG,CAC1C,CAAC;YACF,MAAM,CAAC,CAAC;QACV,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;CAAA;AA1BD,gCA0BC"}
1
+ {"version":3,"file":"distributed-agent.runner.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/src/lib/core/runners/distributed-agent/distributed-agent.runner.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA8D;AAC9D,iDAAyC;AACzC,yDAAyD;AAEzD,mEAA8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yBAAyB,CACjC,6BAA6B,CAAC,CAAC,OAAO,GAAG,CAC1C,CAAC;YACF,MAAM,CAAC,CAAC;QACV,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;CAAA;AA/BD,gCA+BC"}
@@ -9,7 +9,7 @@ export declare class DistributedExecutionApi {
9
9
  }
10
10
  export declare function createStartRequest(runGroup: string, task: Task[][], options: CloudTaskRunnerOptions): {
11
11
  command: string;
12
- branch: string | undefined;
12
+ branch: string | null;
13
13
  runGroup: string;
14
14
  tasks: {
15
15
  taskId: string;
@@ -1,85 +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.createStartRequest = exports.DistributedExecutionApi = void 0;
13
- const output_1 = require("@nrwl/workspace/src/utilities/output");
14
- const axios_1 = require("../../../utilities/axios");
15
- const utils_1 = require("@nrwl/workspace/src/tasks-runner/utils");
16
- const environment_1 = require("../../../utilities/environment");
17
- class DistributedExecutionApi {
18
- constructor(options) {
19
- this.apiAxiosInstance = axios_1.createApiAxiosInstance(options);
20
- }
21
- start(params) {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const resp = yield axios_1.axiosMultipleTries(() => this.apiAxiosInstance.post('/nx-cloud/executions/start', params));
24
- if (!resp.data.enabled) {
25
- throw new Error(`Workspace is disabled. Cannot perform distributed task executions.`);
26
- }
27
- if (resp.data.error) {
28
- throw new Error(resp.data.error);
29
- }
30
- return resp.data.id;
31
- });
32
- }
33
- status(id) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- try {
36
- const resp = yield axios_1.axiosMultipleTries(() => this.apiAxiosInstance.post('/nx-cloud/executions/status', {
37
- id,
38
- }));
39
- return resp.data;
40
- }
41
- catch (e) {
42
- output_1.output.error({
43
- title: e.message,
44
- });
45
- process.exit(1);
46
- }
47
- });
48
- }
49
- completeRunGroupWithError(runGroup, error) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- try {
52
- yield axios_1.axiosMultipleTries(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
53
- runGroup: runGroup,
54
- criticalErrorMessage: error,
55
- }), 3);
56
- }
57
- catch (e) { }
58
- });
59
- }
60
- }
61
- exports.DistributedExecutionApi = DistributedExecutionApi;
62
- function createStartRequest(runGroup, task, options) {
63
- var _a;
64
- const tasksToExecute = task.map((arr) => {
65
- return arr.map((t) => {
66
- return {
67
- taskId: t.id,
68
- hash: t.hash,
69
- projectName: t.target.project,
70
- target: t.target.target,
71
- configuration: t.target.configuration || null,
72
- params: utils_1.unparse(t.overrides).join(' '),
73
- };
74
- });
75
- });
76
- return {
77
- command: environment_1.parseCommand(),
78
- branch: environment_1.getBranch(),
79
- runGroup,
80
- tasks: tasksToExecute,
81
- maxParallel: options.parallel ? (_a = options.maxParallel) !== null && _a !== void 0 ? _a : 3 : 1,
82
- };
83
- }
84
- exports.createStartRequest = createStartRequest;
85
- //# sourceMappingURL=distributed-execution.api.js.map
1
+ const a6_0x345f=['throw','Workspace\x20is\x20disabled.\x20Cannot\x20perform\x20distributed\x20task\x20executions.','createStartRequest','map','error','unparse','done','0x22','0x2','0x1e','@nrwl/workspace/src/tasks-runner/utils','0xf','mapRespToPerfEntry','0x29','0x12','0xa','RUNNER_FAILURE_PERF_ENTRY','parallel','0xd','0x2d','createMetricRecorder','0x18','then','0x2b','0x19','start','../../../utilities/axios','0x4','0x28','0x1d','0x21','0x26','0x27','0x16','0x6','0x13','0x3','overrides','getBranch','0x14','enabled','completeRunGroup','0x1a','message','dteStatus','target','status','post','0x1f','maxParallel','createApiAxiosInstance','../../../utilities/metric-logger','configuration','0x25','DistributedExecutionApi','0x10','0x8','0x1b','0xc','0x23','../../../utilities/environment','exit','0x11','0x7','0x2e','dteStart','number','join','0x9','apiAxiosInstance','0x0','0x1c','next','use\x20strict','0x5','0x2c','output','@nrwl/workspace/src/utilities/output','__awaiter','parseCommand','__esModule','0x2a','0xe','hash','apply','data'];(function(_0x207788,_0x345f95){const _0x12c4a7=function(_0x791f62){while(--_0x791f62){_0x207788['push'](_0x207788['shift']());}};_0x12c4a7(++_0x345f95);}(a6_0x345f,0xec));const a6_0x12c4=function(_0x207788,_0x345f95){_0x207788=_0x207788-0x0;let _0x12c4a7=a6_0x345f[_0x207788];return _0x12c4a7;};const a6_0x5767=[a6_0x12c4('0x53'),'data',a6_0x12c4('0x3b'),a6_0x12c4('0xd'),a6_0x12c4('0x41'),a6_0x12c4('0x44'),a6_0x12c4('0x2f'),'axiosMultipleTries',a6_0x12c4('0x3c'),a6_0x12c4('0x45'),'value',a6_0x12c4('0x26'),'/nx-cloud/executions/start',a6_0x12c4('0x8'),a6_0x12c4('0x48'),a6_0x12c4('0x20'),a6_0x12c4('0x42'),'true',a6_0x12c4('0x3'),a6_0x12c4('0x27'),'project',a6_0x12c4('0x10'),a6_0x12c4('0x4a'),a6_0x12c4('0x2a'),a6_0x12c4('0xe'),'maxParallel','completeRunGroupWithError',a6_0x12c4('0xc'),a6_0x12c4('0x16'),'createStartRequest',a6_0x12c4('0x1'),a6_0x12c4('0x43'),a6_0x12c4('0x2c'),a6_0x12c4('0xf'),a6_0x12c4('0x30'),'/nx-cloud/executions/status',a6_0x12c4('0x3f'),'recordMetric',a6_0x12c4('0x1c'),'error',a6_0x12c4('0x13'),a6_0x12c4('0x17'),a6_0x12c4('0x22'),a6_0x12c4('0x5'),a6_0x12c4('0x19'),a6_0x12c4('0x3e'),a6_0x12c4('0x52')];(function(_0x5c8b7f,_0x443cde){const _0x44daa0=function(_0x1e63f6){while(--_0x1e63f6){_0x5c8b7f['push'](_0x5c8b7f['shift']());}};_0x44daa0(++_0x443cde);}(a6_0x5767,0x17b));const a6_0x5c06=function(_0x617c2a,_0x5e7bfb){_0x617c2a=_0x617c2a-0x0;let _0x5ce48c=a6_0x5767[_0x617c2a];return _0x5ce48c;};a6_0x12c4('0x9');var __awaiter=this&&this[a6_0x5c06('0x15')]||function(_0x533d9f,_0x394c42,_0x23a685,_0x903abb){function _0x29bd7a(_0x3c99a3){return _0x3c99a3 instanceof _0x23a685?_0x3c99a3:new _0x23a685(function(_0x1f90ca){_0x1f90ca(_0x3c99a3);});}return new(_0x23a685||(_0x23a685=Promise))(function(_0x1a18f8,_0x57f911){function _0x2a78bb(_0x4c9380){try{_0x1d94a7(_0x903abb[a6_0x5c06(a6_0x12c4('0x25'))](_0x4c9380));}catch(_0x38fa47){_0x57f911(_0x38fa47);}}function _0x26d4e6(_0x467d73){try{_0x1d94a7(_0x903abb[a6_0x5c06(a6_0x12c4('0x2e'))](_0x467d73));}catch(_0x41d6a5){_0x57f911(_0x41d6a5);}}function _0x1d94a7(_0x55d00b){_0x55d00b[a6_0x5c06(a6_0x12c4('0x51'))]?_0x1a18f8(_0x55d00b['value']):_0x29bd7a(_0x55d00b[a6_0x5c06(a6_0x12c4('0x55'))])[a6_0x5c06(a6_0x12c4('0x33'))](_0x2a78bb,_0x26d4e6);}_0x1d94a7((_0x903abb=_0x903abb[a6_0x12c4('0x14')](_0x533d9f,_0x394c42||[]))[a6_0x5c06(a6_0x12c4('0x25'))]());});};Object['defineProperty'](exports,a6_0x5c06(a6_0x12c4('0x24')),{'value':!![]});exports[a6_0x5c06(a6_0x12c4('0x40'))]=exports[a6_0x12c4('0x4c')]=void 0x0;const output_1=require(a6_0x5c06(a6_0x12c4('0x6')));const axios_1=require(a6_0x5c06(a6_0x12c4('0x46')));const utils_1=require(a6_0x5c06(a6_0x12c4('0x50')));const environment_1=require(a6_0x5c06(a6_0x12c4('0x2d')));const metric_logger_1=require(a6_0x12c4('0x49'));class DistributedExecutionApi{constructor(_0x37689d){this[a6_0x5c06(a6_0x12c4('0x32'))]=(0x0,axios_1[a6_0x5c06('0xb')])(_0x37689d);}[a6_0x5c06(a6_0x12c4('0x3a'))](_0x1d8c23){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x5e28ca=(0x0,metric_logger_1[a6_0x5c06(a6_0x12c4('0x3d'))])(a6_0x5c06(a6_0x12c4('0x4f')));let _0x2f77da;try{_0x2f77da=yield(0x0,axios_1[a6_0x5c06('0x4')])(()=>this[a6_0x5c06(a6_0x12c4('0x32'))]['post'](a6_0x5c06(a6_0x12c4('0x4')),_0x1d8c23));_0x5e28ca[a6_0x5c06(a6_0x12c4('0x1d'))]((0x0,metric_logger_1[a6_0x5c06(a6_0x12c4('0x36'))])(_0x2f77da));}catch(_0x2fd1d9){_0x5e28ca['recordMetric'](metric_logger_1['RUNNER_FAILURE_PERF_ENTRY']);throw _0x2fd1d9;}if(!_0x2f77da[a6_0x5c06(a6_0x12c4('0x29'))][a6_0x5c06(a6_0x12c4('0x11'))]){throw new Error(a6_0x5c06(a6_0x12c4('0x35')));}if(_0x2f77da[a6_0x5c06(a6_0x12c4('0x29'))][a6_0x12c4('0x1a')]){throw new Error(_0x2f77da[a6_0x5c06(a6_0x12c4('0x29'))][a6_0x5c06('0x24')]);}return _0x2f77da[a6_0x5c06('0x2d')]['id'];});}[a6_0x5c06(a6_0x12c4('0x1e'))](_0x166594){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x1d32e7=(0x0,metric_logger_1[a6_0x5c06(a6_0x12c4('0x3d'))])(a6_0x5c06(a6_0x12c4('0x28')));try{const _0x1e85e7=yield(0x0,axios_1['axiosMultipleTries'])(()=>this[a6_0x12c4('0x5')][a6_0x12c4('0x45')](a6_0x5c06('0x20'),{'id':_0x166594}));_0x1d32e7[a6_0x5c06('0x22')]((0x0,metric_logger_1['mapRespToPerfEntry'])(_0x1e85e7));return _0x1e85e7[a6_0x12c4('0x15')];}catch(_0x5c8c4d){_0x1d32e7[a6_0x5c06(a6_0x12c4('0x1d'))](metric_logger_1[a6_0x5c06(a6_0x12c4('0x4e'))]);output_1[a6_0x5c06(a6_0x12c4('0x2b'))][a6_0x5c06('0x24')]({'title':_0x5c8c4d[a6_0x5c06('0x1')]});process[a6_0x5c06(a6_0x12c4('0xb'))](0x1);}});}[a6_0x5c06('0x17')](_0x2d7b99,_0x52cc16){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x50f371=(0x0,metric_logger_1[a6_0x12c4('0x2a')])(a6_0x5c06(a6_0x12c4('0x34')));try{const _0xa9739b=yield(0x0,axios_1[a6_0x5c06(a6_0x12c4('0x31'))])(()=>this[a6_0x5c06(a6_0x12c4('0x32'))][a6_0x5c06(a6_0x12c4('0x38'))]('/nx-cloud/executions/complete-run-group',{'runGroup':_0x2d7b99,'criticalErrorMessage':_0x52cc16}),0x3);_0x50f371[a6_0x5c06('0x22')]((0x0,metric_logger_1[a6_0x12c4('0x22')])(_0xa9739b));}catch(_0x53c913){_0x50f371[a6_0x5c06(a6_0x12c4('0x1d'))](metric_logger_1[a6_0x5c06(a6_0x12c4('0x4e'))]);}});}}exports[a6_0x12c4('0x4c')]=DistributedExecutionApi;function createStartRequest(_0x4cd807,_0x53e286,_0x2714df){const _0x2ca564=_0x53e286[a6_0x5c06(a6_0x12c4('0x23'))](_0x4c6c09=>{return _0x4c6c09[a6_0x12c4('0x19')](_0xa23a71=>{return{'taskId':_0xa23a71['id'],'hash':_0xa23a71[a6_0x5c06(a6_0x12c4('0x4b'))],'projectName':_0xa23a71[a6_0x5c06('0x1c')][a6_0x5c06(a6_0x12c4('0x54'))],'target':_0xa23a71[a6_0x12c4('0x43')][a6_0x5c06('0x1c')],'configuration':_0xa23a71[a6_0x5c06(a6_0x12c4('0x7'))][a6_0x5c06(a6_0x12c4('0x39'))]||null,'params':(0x0,utils_1[a6_0x12c4('0x1b')])(_0xa23a71[a6_0x5c06(a6_0x12c4('0x0'))])[a6_0x5c06(a6_0x12c4('0x21'))]('\x20')};});});return{'command':(0x0,environment_1[a6_0x5c06(a6_0x12c4('0x1f'))])(),'branch':(0x0,environment_1[a6_0x5c06(a6_0x12c4('0xa'))])(),'runGroup':_0x4cd807,'tasks':_0x2ca564,'maxParallel':calculateMaxParallel(_0x2714df)};}exports[a6_0x12c4('0x18')]=createStartRequest;function calculateMaxParallel(_0x48d728){if(_0x48d728[a6_0x12c4('0x47')]){return Number(_0x48d728[a6_0x5c06(a6_0x12c4('0x37'))]);}else if(_0x48d728[a6_0x5c06(a6_0x12c4('0x4d'))]===a6_0x5c06(a6_0x12c4('0x12'))||_0x48d728[a6_0x12c4('0x27')]===!![]||_0x48d728[a6_0x5c06(a6_0x12c4('0x4d'))]===''){return 0x3;}else if(typeof Number(_0x48d728[a6_0x5c06(a6_0x12c4('0x4d'))])===a6_0x12c4('0x2')){return Number(_0x48d728[a6_0x12c4('0x27')]);}else{return 0x1;}}
@@ -1 +1 @@
1
- {"version":3,"file":"distributed-execution.api.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/src/lib/core/runners/distributed-execution/distributed-execution.api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA8D;AAE9D,oDAGkC;AAElC,kEAAiE;AACjE,gEAAyE;AAEzE,MAAa,uBAAuB;IAGlC,YAAY,OAA+B;QACzC,IAAI,CAAC,gBAAgB,GAAG,8BAAsB,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAEK,KAAK,CAAC,MAAW;;YACrB,MAAM,IAAI,GAAG,MAAM,0BAAkB,CAAC,GAAG,EAAE,CACzC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,EAAE,MAAM,CAAC,CACjE,CAAC;YACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACtB,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE,CAAC;aACH;YACD,IAAI,IAAI,CAAC,I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,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM;gBACvB,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,IAAI,IAAI;gBAC7C,MAAM,EAAE,eAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;aACvC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,0BAAY,EAAE;QACvB,MAAM,EAAE,uBAAS,EAAE;QACnB,QAAQ;QACR,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7D,CAAC;AACJ,CAAC;AAzBD,gDAyBC"}
1
+ {"version":3,"file":"distributed-execution.api.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/src/lib/core/runners/distributed-execution/distributed-execution.api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA8D;AAE9D,oDAGkC;AAElC,kEAAiE;AACjE,gEAAyE;AACzE,oEAI0C;AAE1C,MAAa,uBAAuB;IAGlC,YAAY,OAA+B;QACzC,IAAI,CAAC,gBAAgB,GAAG,IAAA,8BAAsB,EAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAEK,KAAK,CAAC,MAAW;;YACrB,MAAM,QAAQ,GAAG,IAAA,oCAAoB,EAAC,UAAU,CAAC,CAAC;YAClD,IAAI,IAAI,CAAC;YAET,IAAI;gBACF,IAAI,GAAG,MAAM,IAAA,0BAAkB,EAAC,GAAG,EAAE,CACnC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,EAAE,MAAM,CAAC,CACjE,CAAC;gBACF,QAAQ,CAAC,YAAY,CAAC,IAAA,kCAAkB,EAAC,IAAI,CAAC,CAAC,CAAC;aACjD;YAAC,OAAO,CAAC,EAAE;gBACV,QAAQ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