@red-hat-developer-hub/backstage-plugin-orchestrator-backend 4.1.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.
- package/CHANGELOG.md +740 -0
- package/README.md +5 -0
- package/app-config.yaml +3 -0
- package/dist/helpers/errorBuilder.cjs.js +36 -0
- package/dist/helpers/errorBuilder.cjs.js.map +1 -0
- package/dist/helpers/filterBuilder.cjs.js +197 -0
- package/dist/helpers/filterBuilder.cjs.js.map +1 -0
- package/dist/helpers/queryBuilder.cjs.js +40 -0
- package/dist/helpers/queryBuilder.cjs.js.map +1 -0
- package/dist/index.cjs.js +10 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/package.json.cjs.js +6 -0
- package/dist/package.json.cjs.js.map +1 -0
- package/dist/plugin.cjs.js +45 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/routerWrapper/index.cjs.js +31 -0
- package/dist/routerWrapper/index.cjs.js.map +1 -0
- package/dist/service/DataIndexService.cjs.js +405 -0
- package/dist/service/DataIndexService.cjs.js.map +1 -0
- package/dist/service/DataInputSchemaService.cjs.js +12 -0
- package/dist/service/DataInputSchemaService.cjs.js.map +1 -0
- package/dist/service/DevModeService.cjs.js +144 -0
- package/dist/service/DevModeService.cjs.js.map +1 -0
- package/dist/service/GitService.cjs.js +72 -0
- package/dist/service/GitService.cjs.js.map +1 -0
- package/dist/service/GitWrapper/git.cjs.js +219 -0
- package/dist/service/GitWrapper/git.cjs.js.map +1 -0
- package/dist/service/Helper.cjs.js +66 -0
- package/dist/service/Helper.cjs.js.map +1 -0
- package/dist/service/OrchestratorService.cjs.js +119 -0
- package/dist/service/OrchestratorService.cjs.js.map +1 -0
- package/dist/service/ScaffolderService.cjs.js +94 -0
- package/dist/service/ScaffolderService.cjs.js.map +1 -0
- package/dist/service/SonataFlowService.cjs.js +188 -0
- package/dist/service/SonataFlowService.cjs.js.map +1 -0
- package/dist/service/WorkflowCacheService.cjs.js +91 -0
- package/dist/service/WorkflowCacheService.cjs.js.map +1 -0
- package/dist/service/api/mapping/V2Mappings.cjs.js +150 -0
- package/dist/service/api/mapping/V2Mappings.cjs.js.map +1 -0
- package/dist/service/api/v2.cjs.js +187 -0
- package/dist/service/api/v2.cjs.js.map +1 -0
- package/dist/service/constants.cjs.js +10 -0
- package/dist/service/constants.cjs.js.map +1 -0
- package/dist/service/router.cjs.js +626 -0
- package/dist/service/router.cjs.js.map +1 -0
- package/dist/types/pagination.cjs.js +30 -0
- package/dist/types/pagination.cjs.js.map +1 -0
- package/package.json +110 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@urql/core');
|
|
4
|
+
var backstagePluginOrchestratorCommon = require('@red-hat-developer-hub/backstage-plugin-orchestrator-common');
|
|
5
|
+
var errorBuilder = require('../helpers/errorBuilder.cjs.js');
|
|
6
|
+
var filterBuilder = require('../helpers/filterBuilder.cjs.js');
|
|
7
|
+
var queryBuilder = require('../helpers/queryBuilder.cjs.js');
|
|
8
|
+
var constants = require('./constants.cjs.js');
|
|
9
|
+
|
|
10
|
+
class DataIndexService {
|
|
11
|
+
constructor(dataIndexUrl, logger) {
|
|
12
|
+
this.dataIndexUrl = dataIndexUrl;
|
|
13
|
+
this.logger = logger;
|
|
14
|
+
if (!dataIndexUrl.length) {
|
|
15
|
+
throw errorBuilder.ErrorBuilder.GET_NO_DATA_INDEX_URL_ERR();
|
|
16
|
+
}
|
|
17
|
+
this.client = this.getNewGraphQLClient();
|
|
18
|
+
}
|
|
19
|
+
client;
|
|
20
|
+
processDefinitionArguments = [];
|
|
21
|
+
processInstanceArguments = [];
|
|
22
|
+
getNewGraphQLClient() {
|
|
23
|
+
const diURL = `${this.dataIndexUrl}/graphql`;
|
|
24
|
+
return new core.Client({
|
|
25
|
+
url: diURL,
|
|
26
|
+
exchanges: [core.fetchExchange]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async initInputProcessDefinitionArgs() {
|
|
30
|
+
if (this.processDefinitionArguments.length === 0) {
|
|
31
|
+
this.processDefinitionArguments = await this.inspectInputArgument(
|
|
32
|
+
"ProcessDefinition"
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return this.processDefinitionArguments;
|
|
36
|
+
}
|
|
37
|
+
graphQLArgumentQuery(type) {
|
|
38
|
+
return `query ${type}Argument {
|
|
39
|
+
__type(name: "${type}Argument") {
|
|
40
|
+
kind
|
|
41
|
+
name
|
|
42
|
+
inputFields {
|
|
43
|
+
name
|
|
44
|
+
type {
|
|
45
|
+
kind
|
|
46
|
+
name
|
|
47
|
+
ofType {
|
|
48
|
+
kind
|
|
49
|
+
name
|
|
50
|
+
ofType {
|
|
51
|
+
kind
|
|
52
|
+
name
|
|
53
|
+
ofType {
|
|
54
|
+
kind
|
|
55
|
+
name
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}`;
|
|
63
|
+
}
|
|
64
|
+
async inspectInputArgument(type) {
|
|
65
|
+
const result = await this.client.query(this.graphQLArgumentQuery(type), {});
|
|
66
|
+
this.logger.debug(`Introspection query result: ${JSON.stringify(result)}`);
|
|
67
|
+
if (result?.error) {
|
|
68
|
+
this.logger.error(`Error executing introspection query ${result.error}`);
|
|
69
|
+
throw result.error;
|
|
70
|
+
}
|
|
71
|
+
const pairs = [];
|
|
72
|
+
if (result?.data?.__type?.inputFields) {
|
|
73
|
+
for (const field of result.data.__type.inputFields) {
|
|
74
|
+
if (field.name !== "and" && field.name !== "or" && field.name !== "not") {
|
|
75
|
+
pairs.push({
|
|
76
|
+
name: field.name,
|
|
77
|
+
type: {
|
|
78
|
+
name: field.type.name,
|
|
79
|
+
kind: field.type.kind,
|
|
80
|
+
ofType: field.type.ofType
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return pairs;
|
|
87
|
+
}
|
|
88
|
+
async abortWorkflowInstance(instanceId) {
|
|
89
|
+
this.logger.info(`Aborting workflow instance ${instanceId}`);
|
|
90
|
+
const ProcessInstanceAbortMutationDocument = core.gql`
|
|
91
|
+
mutation ProcessInstanceAbortMutation($id: String) {
|
|
92
|
+
ProcessInstanceAbort(id: $id)
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
const result = await this.client.mutation(
|
|
96
|
+
ProcessInstanceAbortMutationDocument,
|
|
97
|
+
{ id: instanceId }
|
|
98
|
+
);
|
|
99
|
+
this.logger.debug(
|
|
100
|
+
`Abort workflow instance result: ${JSON.stringify(result)}`
|
|
101
|
+
);
|
|
102
|
+
if (result.error) {
|
|
103
|
+
throw new Error(
|
|
104
|
+
`Error aborting workflow instance ${instanceId}: ${result.error}`
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
this.logger.debug(`Successfully aborted workflow instance ${instanceId}`);
|
|
108
|
+
}
|
|
109
|
+
async fetchWorkflowInfo(definitionId) {
|
|
110
|
+
const graphQlQuery = `{ ProcessDefinitions ( where: {id: {equal: "${definitionId}" } } ) { id, name, version, type, endpoint, serviceUrl, source } }`;
|
|
111
|
+
const result = await this.client.query(graphQlQuery, {});
|
|
112
|
+
this.logger.debug(
|
|
113
|
+
`Get workflow definition result: ${JSON.stringify(result)}`
|
|
114
|
+
);
|
|
115
|
+
if (result.error) {
|
|
116
|
+
this.logger.error(`Error fetching workflow definition ${result.error}`);
|
|
117
|
+
throw result.error;
|
|
118
|
+
}
|
|
119
|
+
const processDefinitions = result.data.ProcessDefinitions;
|
|
120
|
+
if (processDefinitions.length === 0) {
|
|
121
|
+
this.logger.info(`No workflow definition found for ${definitionId}`);
|
|
122
|
+
return void 0;
|
|
123
|
+
}
|
|
124
|
+
return processDefinitions[0];
|
|
125
|
+
}
|
|
126
|
+
async fetchWorkflowServiceUrls() {
|
|
127
|
+
const graphQlQuery = `{ ProcessDefinitions { id, serviceUrl } }`;
|
|
128
|
+
const result = await this.client.query(graphQlQuery, {});
|
|
129
|
+
this.logger.debug(
|
|
130
|
+
`Get workflow service urls result: ${JSON.stringify(result)}`
|
|
131
|
+
);
|
|
132
|
+
if (result.error) {
|
|
133
|
+
this.logger.error(`Error fetching workflow service urls ${result.error}`);
|
|
134
|
+
throw result.error;
|
|
135
|
+
}
|
|
136
|
+
const processDefinitions = result.data.ProcessDefinitions;
|
|
137
|
+
return processDefinitions.filter((definition) => definition.serviceUrl).map((definition) => ({ [definition.id]: definition.serviceUrl })).reduce((acc, curr) => ({ ...acc, ...curr }), {});
|
|
138
|
+
}
|
|
139
|
+
async fetchWorkflowInfos(args) {
|
|
140
|
+
this.logger.info(`fetchWorkflowInfos() called: ${this.dataIndexUrl}`);
|
|
141
|
+
const { definitionIds, pagination, filter } = args;
|
|
142
|
+
const definitionIdsCondition = definitionIds !== void 0 && definitionIds.length > 0 ? `id: {in: ${JSON.stringify(definitionIds)}}` : void 0;
|
|
143
|
+
const filterCondition = filter ? filterBuilder.buildFilterCondition(
|
|
144
|
+
await this.initInputProcessDefinitionArgs(),
|
|
145
|
+
"ProcessDefinition",
|
|
146
|
+
filter
|
|
147
|
+
) : void 0;
|
|
148
|
+
let whereClause;
|
|
149
|
+
if (definitionIds && filter) {
|
|
150
|
+
whereClause = `and: [{${definitionIdsCondition}}, {${filterCondition}}]`;
|
|
151
|
+
} else if (definitionIdsCondition || filterCondition) {
|
|
152
|
+
whereClause = definitionIdsCondition ?? filterCondition;
|
|
153
|
+
} else {
|
|
154
|
+
whereClause = void 0;
|
|
155
|
+
}
|
|
156
|
+
const graphQlQuery = queryBuilder.buildGraphQlQuery({
|
|
157
|
+
type: "ProcessDefinitions",
|
|
158
|
+
queryBody: "id, name, version, type, endpoint, serviceUrl, source",
|
|
159
|
+
whereClause,
|
|
160
|
+
pagination
|
|
161
|
+
});
|
|
162
|
+
this.logger.debug(`GraphQL query: ${graphQlQuery}`);
|
|
163
|
+
const result = await this.client.query(graphQlQuery, {});
|
|
164
|
+
this.logger.debug(
|
|
165
|
+
`Get workflow definitions result: ${JSON.stringify(result)}`
|
|
166
|
+
);
|
|
167
|
+
if (result.error) {
|
|
168
|
+
this.logger.error(
|
|
169
|
+
`Error fetching data index swf results ${result.error}`
|
|
170
|
+
);
|
|
171
|
+
throw result.error;
|
|
172
|
+
}
|
|
173
|
+
return result.data.ProcessDefinitions;
|
|
174
|
+
}
|
|
175
|
+
async fetchInstances(args) {
|
|
176
|
+
const { pagination, definitionIds, filter } = args;
|
|
177
|
+
if (pagination) pagination.sortField ??= constants.FETCH_PROCESS_INSTANCES_SORT_FIELD;
|
|
178
|
+
const processIdNotNullCondition = "processId: {isNull: false}";
|
|
179
|
+
const definitionIdsCondition = definitionIds ? `processId: {in: ${JSON.stringify(definitionIds)}}` : void 0;
|
|
180
|
+
const type = "ProcessInstance";
|
|
181
|
+
const filterCondition = filter ? filterBuilder.buildFilterCondition(
|
|
182
|
+
await this.inspectInputArgument(type),
|
|
183
|
+
type,
|
|
184
|
+
filter
|
|
185
|
+
) : "";
|
|
186
|
+
let whereClause = "";
|
|
187
|
+
const conditions = [];
|
|
188
|
+
{
|
|
189
|
+
conditions.push(`{${processIdNotNullCondition}}`);
|
|
190
|
+
}
|
|
191
|
+
if (definitionIdsCondition) {
|
|
192
|
+
conditions.push(`{${definitionIdsCondition}}`);
|
|
193
|
+
}
|
|
194
|
+
if (filter) {
|
|
195
|
+
conditions.push(`{${filterCondition}}`);
|
|
196
|
+
}
|
|
197
|
+
if (conditions.length === 0) {
|
|
198
|
+
whereClause = processIdNotNullCondition;
|
|
199
|
+
} else if (conditions.length === 1) {
|
|
200
|
+
whereClause = conditions[0].slice(1, -1);
|
|
201
|
+
} else if (conditions.length > 1) {
|
|
202
|
+
whereClause = `and: [${conditions.join(", ")}]`;
|
|
203
|
+
}
|
|
204
|
+
const graphQlQuery = queryBuilder.buildGraphQlQuery({
|
|
205
|
+
type: "ProcessInstances",
|
|
206
|
+
queryBody: "id, processName, processId, businessKey, state, start, end, nodes { id }, variables, parentProcessInstance {id, processName, businessKey}",
|
|
207
|
+
whereClause,
|
|
208
|
+
pagination
|
|
209
|
+
});
|
|
210
|
+
this.logger.debug(`GraphQL query: ${graphQlQuery}`);
|
|
211
|
+
const result = await this.client.query(graphQlQuery, {});
|
|
212
|
+
this.logger.debug(
|
|
213
|
+
`Fetch process instances result: ${JSON.stringify(result)}`
|
|
214
|
+
);
|
|
215
|
+
const processInstancesSrc = result.data.ProcessInstances;
|
|
216
|
+
const processInstances = await Promise.all(
|
|
217
|
+
processInstancesSrc.map(async (instance) => {
|
|
218
|
+
return await this.getWorkflowDefinitionFromInstance(instance);
|
|
219
|
+
})
|
|
220
|
+
);
|
|
221
|
+
return processInstances;
|
|
222
|
+
}
|
|
223
|
+
async fetchInstancesTotalCount(definitionIds, filter) {
|
|
224
|
+
const definitionIdsCondition = definitionIds ? `processId: {in: ${JSON.stringify(definitionIds)}}` : void 0;
|
|
225
|
+
this.initInputProcessDefinitionArgs();
|
|
226
|
+
const filterCondition = filter ? filterBuilder.buildFilterCondition(
|
|
227
|
+
await this.inspectInputArgument("ProcessInstance"),
|
|
228
|
+
"ProcessInstance",
|
|
229
|
+
filter
|
|
230
|
+
) : "";
|
|
231
|
+
let whereClause;
|
|
232
|
+
if (definitionIds && filter) {
|
|
233
|
+
whereClause = `and: [{${definitionIdsCondition}}, {${filterCondition}}]`;
|
|
234
|
+
} else if (definitionIdsCondition || filterCondition) {
|
|
235
|
+
whereClause = definitionIdsCondition ?? filterCondition;
|
|
236
|
+
}
|
|
237
|
+
const graphQlQuery = queryBuilder.buildGraphQlQuery({
|
|
238
|
+
type: "ProcessInstances",
|
|
239
|
+
queryBody: "id",
|
|
240
|
+
whereClause
|
|
241
|
+
});
|
|
242
|
+
this.logger.debug(`GraphQL query: ${graphQlQuery}`);
|
|
243
|
+
const result = await this.client.query(graphQlQuery, {});
|
|
244
|
+
if (result.error) {
|
|
245
|
+
this.logger.error(
|
|
246
|
+
`Error when fetching instances total count: ${result.error}`
|
|
247
|
+
);
|
|
248
|
+
throw result.error;
|
|
249
|
+
}
|
|
250
|
+
const idArr = result.data.ProcessInstances;
|
|
251
|
+
return idArr.length;
|
|
252
|
+
}
|
|
253
|
+
async getWorkflowDefinitionFromInstance(instance) {
|
|
254
|
+
const workflowInfo = await this.fetchWorkflowInfo(instance.processId);
|
|
255
|
+
if (!workflowInfo?.source) {
|
|
256
|
+
throw new Error(
|
|
257
|
+
`Workflow defintion is required to fetch instance ${instance.id}`
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
const workflowDefinitionSrc = backstagePluginOrchestratorCommon.fromWorkflowSource(
|
|
261
|
+
workflowInfo.source
|
|
262
|
+
);
|
|
263
|
+
if (workflowInfo) {
|
|
264
|
+
instance.category = backstagePluginOrchestratorCommon.getWorkflowCategory(workflowDefinitionSrc);
|
|
265
|
+
instance.description = workflowInfo.description;
|
|
266
|
+
}
|
|
267
|
+
return instance;
|
|
268
|
+
}
|
|
269
|
+
async fetchWorkflowSource(definitionId) {
|
|
270
|
+
const graphQlQuery = `{ ProcessDefinitions ( where: {id: {equal: "${definitionId}" } } ) { id, source } }`;
|
|
271
|
+
const result = await this.client.query(graphQlQuery, {});
|
|
272
|
+
this.logger.debug(
|
|
273
|
+
`Fetch workflow source result: ${JSON.stringify(result)}`
|
|
274
|
+
);
|
|
275
|
+
if (result.error) {
|
|
276
|
+
this.logger.error(`Error when fetching workflow source: ${result.error}`);
|
|
277
|
+
return void 0;
|
|
278
|
+
}
|
|
279
|
+
const processDefinitions = result.data.ProcessDefinitions;
|
|
280
|
+
if (processDefinitions.length === 0) {
|
|
281
|
+
this.logger.info(`No workflow source found for ${definitionId}`);
|
|
282
|
+
return void 0;
|
|
283
|
+
}
|
|
284
|
+
return processDefinitions[0].source;
|
|
285
|
+
}
|
|
286
|
+
async fetchInstancesByDefinitionId(args) {
|
|
287
|
+
const graphQlQuery = `{ ProcessInstances(where: {processId: {equal: "${args.definitionId}" } }, pagination: {limit: ${args.limit}, offset: ${args.offset}}) { id, processName, state, start, end } }`;
|
|
288
|
+
const result = await this.client.query(graphQlQuery, {});
|
|
289
|
+
this.logger.debug(
|
|
290
|
+
`Fetch workflow instances result: ${JSON.stringify(result)}`
|
|
291
|
+
);
|
|
292
|
+
if (result.error) {
|
|
293
|
+
this.logger.error(
|
|
294
|
+
`Error when fetching workflow instances: ${result.error}`
|
|
295
|
+
);
|
|
296
|
+
throw result.error;
|
|
297
|
+
}
|
|
298
|
+
return result.data.ProcessInstances;
|
|
299
|
+
}
|
|
300
|
+
async fetchInstanceVariables(instanceId) {
|
|
301
|
+
const graphQlQuery = `{ ProcessInstances (where: { id: {equal: "${instanceId}" } } ) { variables } }`;
|
|
302
|
+
const result = await this.client.query(graphQlQuery, {});
|
|
303
|
+
this.logger.debug(
|
|
304
|
+
`Fetch process instance variables result: ${JSON.stringify(result)}`
|
|
305
|
+
);
|
|
306
|
+
if (result.error) {
|
|
307
|
+
this.logger.error(
|
|
308
|
+
`Error when fetching process instance variables: ${result.error}`
|
|
309
|
+
);
|
|
310
|
+
throw result.error;
|
|
311
|
+
}
|
|
312
|
+
const processInstances = result.data.ProcessInstances;
|
|
313
|
+
if (processInstances.length === 0) {
|
|
314
|
+
return void 0;
|
|
315
|
+
}
|
|
316
|
+
return backstagePluginOrchestratorCommon.parseWorkflowVariables(processInstances[0].variables);
|
|
317
|
+
}
|
|
318
|
+
async fetchDefinitionIdByInstanceId(instanceId) {
|
|
319
|
+
const graphQlQuery = `{ ProcessInstances (where: { id: {equal: "${instanceId}" } } ) { processId } }`;
|
|
320
|
+
const result = await this.client.query(graphQlQuery, {});
|
|
321
|
+
this.logger.debug(
|
|
322
|
+
`Fetch process id from instance result: ${JSON.stringify(result)}`
|
|
323
|
+
);
|
|
324
|
+
if (result.error) {
|
|
325
|
+
this.logger.error(
|
|
326
|
+
`Error when fetching process id from instance: ${result.error}`
|
|
327
|
+
);
|
|
328
|
+
throw result.error;
|
|
329
|
+
}
|
|
330
|
+
const processInstances = result.data.ProcessInstances;
|
|
331
|
+
if (processInstances.length === 0) {
|
|
332
|
+
return void 0;
|
|
333
|
+
}
|
|
334
|
+
return processInstances[0].processId;
|
|
335
|
+
}
|
|
336
|
+
async fetchInstance(instanceId) {
|
|
337
|
+
const FindProcessInstanceQuery = core.gql`
|
|
338
|
+
query FindProcessInstanceQuery($instanceId: String!) {
|
|
339
|
+
ProcessInstances(where: { id: { equal: $instanceId } }) {
|
|
340
|
+
id
|
|
341
|
+
processName
|
|
342
|
+
processId
|
|
343
|
+
serviceUrl
|
|
344
|
+
businessKey
|
|
345
|
+
state
|
|
346
|
+
start
|
|
347
|
+
end
|
|
348
|
+
nodes {
|
|
349
|
+
id
|
|
350
|
+
nodeId
|
|
351
|
+
definitionId
|
|
352
|
+
type
|
|
353
|
+
name
|
|
354
|
+
enter
|
|
355
|
+
exit
|
|
356
|
+
}
|
|
357
|
+
variables
|
|
358
|
+
parentProcessInstance {
|
|
359
|
+
id
|
|
360
|
+
processName
|
|
361
|
+
businessKey
|
|
362
|
+
}
|
|
363
|
+
error {
|
|
364
|
+
nodeDefinitionId
|
|
365
|
+
message
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
`;
|
|
370
|
+
const result = await this.client.query(FindProcessInstanceQuery, {
|
|
371
|
+
instanceId
|
|
372
|
+
});
|
|
373
|
+
this.logger.debug(
|
|
374
|
+
`Fetch process instance result: ${JSON.stringify(result)}`
|
|
375
|
+
);
|
|
376
|
+
if (result.error) {
|
|
377
|
+
this.logger.error(
|
|
378
|
+
`Error when fetching process instances: ${result.error}`
|
|
379
|
+
);
|
|
380
|
+
throw result.error;
|
|
381
|
+
}
|
|
382
|
+
const processInstances = result.data.ProcessInstances;
|
|
383
|
+
if (processInstances.length === 0) {
|
|
384
|
+
return void 0;
|
|
385
|
+
}
|
|
386
|
+
const instance = processInstances[0];
|
|
387
|
+
const workflowInfo = await this.fetchWorkflowInfo(instance.processId);
|
|
388
|
+
if (!workflowInfo?.source) {
|
|
389
|
+
throw new Error(
|
|
390
|
+
`Workflow defintion is required to fetch instance ${instance.id}`
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
const workflowDefinitionSrc = backstagePluginOrchestratorCommon.fromWorkflowSource(
|
|
394
|
+
workflowInfo.source
|
|
395
|
+
);
|
|
396
|
+
if (workflowInfo) {
|
|
397
|
+
instance.category = backstagePluginOrchestratorCommon.getWorkflowCategory(workflowDefinitionSrc);
|
|
398
|
+
instance.description = workflowDefinitionSrc.description;
|
|
399
|
+
}
|
|
400
|
+
return instance;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
exports.DataIndexService = DataIndexService;
|
|
405
|
+
//# sourceMappingURL=DataIndexService.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataIndexService.cjs.js","sources":["../../src/service/DataIndexService.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\nimport { Client, fetchExchange, gql } from '@urql/core';\n\nimport {\n Filter,\n fromWorkflowSource,\n getWorkflowCategory,\n IntrospectionField,\n parseWorkflowVariables,\n ProcessInstance,\n WorkflowDefinition,\n WorkflowInfo,\n} from '@red-hat-developer-hub/backstage-plugin-orchestrator-common';\n\nimport { ErrorBuilder } from '../helpers/errorBuilder';\nimport { buildFilterCondition } from '../helpers/filterBuilder';\nimport { buildGraphQlQuery } from '../helpers/queryBuilder';\nimport { Pagination } from '../types/pagination';\nimport { FETCH_PROCESS_INSTANCES_SORT_FIELD } from './constants';\n\nexport class DataIndexService {\n private readonly client: Client;\n public processDefinitionArguments: IntrospectionField[] = [];\n public processInstanceArguments: IntrospectionField[] = [];\n\n public constructor(\n private readonly dataIndexUrl: string,\n private readonly logger: LoggerService,\n ) {\n if (!dataIndexUrl.length) {\n throw ErrorBuilder.GET_NO_DATA_INDEX_URL_ERR();\n }\n\n this.client = this.getNewGraphQLClient();\n }\n\n private getNewGraphQLClient(): Client {\n const diURL = `${this.dataIndexUrl}/graphql`;\n return new Client({\n url: diURL,\n exchanges: [fetchExchange],\n });\n }\n\n public async initInputProcessDefinitionArgs(): Promise<IntrospectionField[]> {\n if (this.processDefinitionArguments.length === 0) {\n this.processDefinitionArguments = await this.inspectInputArgument(\n 'ProcessDefinition',\n );\n }\n return this.processDefinitionArguments; // For testing purposes\n }\n\n public graphQLArgumentQuery(type: string): string {\n return `query ${type}Argument {\n __type(name: \"${type}Argument\") {\n kind\n name\n inputFields {\n name\n type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }`;\n }\n\n public async inspectInputArgument(\n type: string,\n ): Promise<IntrospectionField[]> {\n const result = await this.client.query(this.graphQLArgumentQuery(type), {});\n\n this.logger.debug(`Introspection query result: ${JSON.stringify(result)}`);\n\n if (result?.error) {\n this.logger.error(`Error executing introspection query ${result.error}`);\n throw result.error;\n }\n\n const pairs: IntrospectionField[] = [];\n if (result?.data?.__type?.inputFields) {\n for (const field of result.data.__type.inputFields) {\n if (\n field.name !== 'and' &&\n field.name !== 'or' &&\n field.name !== 'not'\n ) {\n pairs.push({\n name: field.name,\n type: {\n name: field.type.name,\n kind: field.type.kind,\n ofType: field.type.ofType,\n },\n });\n }\n }\n }\n return pairs;\n }\n\n public async abortWorkflowInstance(instanceId: string): Promise<void> {\n this.logger.info(`Aborting workflow instance ${instanceId}`);\n const ProcessInstanceAbortMutationDocument = gql`\n mutation ProcessInstanceAbortMutation($id: String) {\n ProcessInstanceAbort(id: $id)\n }\n `;\n\n const result = await this.client.mutation(\n ProcessInstanceAbortMutationDocument,\n { id: instanceId },\n );\n\n this.logger.debug(\n `Abort workflow instance result: ${JSON.stringify(result)}`,\n );\n\n if (result.error) {\n throw new Error(\n `Error aborting workflow instance ${instanceId}: ${result.error}`,\n );\n }\n this.logger.debug(`Successfully aborted workflow instance ${instanceId}`);\n }\n\n public async fetchWorkflowInfo(\n definitionId: string,\n ): Promise<WorkflowInfo | undefined> {\n const graphQlQuery = `{ ProcessDefinitions ( where: {id: {equal: \"${definitionId}\" } } ) { id, name, version, type, endpoint, serviceUrl, source } }`;\n\n const result = await this.client.query(graphQlQuery, {});\n\n this.logger.debug(\n `Get workflow definition result: ${JSON.stringify(result)}`,\n );\n\n if (result.error) {\n this.logger.error(`Error fetching workflow definition ${result.error}`);\n throw result.error;\n }\n\n const processDefinitions = result.data.ProcessDefinitions as WorkflowInfo[];\n\n if (processDefinitions.length === 0) {\n this.logger.info(`No workflow definition found for ${definitionId}`);\n return undefined;\n }\n\n return processDefinitions[0];\n }\n\n public async fetchWorkflowServiceUrls(): Promise<Record<string, string>> {\n const graphQlQuery = `{ ProcessDefinitions { id, serviceUrl } }`;\n\n const result = await this.client.query(graphQlQuery, {});\n\n this.logger.debug(\n `Get workflow service urls result: ${JSON.stringify(result)}`,\n );\n\n if (result.error) {\n this.logger.error(`Error fetching workflow service urls ${result.error}`);\n throw result.error;\n }\n\n const processDefinitions = result.data.ProcessDefinitions as WorkflowInfo[];\n return processDefinitions\n .filter(definition => definition.serviceUrl)\n .map(definition => ({ [definition.id]: definition.serviceUrl! }))\n .reduce((acc, curr) => ({ ...acc, ...curr }), {});\n }\n\n public async fetchWorkflowInfos(args: {\n definitionIds?: string[];\n pagination?: Pagination;\n filter?: Filter;\n }): Promise<WorkflowInfo[]> {\n this.logger.info(`fetchWorkflowInfos() called: ${this.dataIndexUrl}`);\n const { definitionIds, pagination, filter } = args;\n\n const definitionIdsCondition =\n definitionIds !== undefined && definitionIds.length > 0\n ? `id: {in: ${JSON.stringify(definitionIds)}}`\n : undefined;\n\n const filterCondition = filter\n ? buildFilterCondition(\n await this.initInputProcessDefinitionArgs(),\n 'ProcessDefinition',\n filter,\n )\n : undefined;\n\n let whereClause: string | undefined;\n if (definitionIds && filter) {\n whereClause = `and: [{${definitionIdsCondition}}, {${filterCondition}}]`;\n } else if (definitionIdsCondition || filterCondition) {\n whereClause = definitionIdsCondition ?? filterCondition;\n } else {\n whereClause = undefined;\n }\n\n const graphQlQuery = buildGraphQlQuery({\n type: 'ProcessDefinitions',\n queryBody: 'id, name, version, type, endpoint, serviceUrl, source',\n whereClause,\n pagination,\n });\n this.logger.debug(`GraphQL query: ${graphQlQuery}`);\n const result = await this.client.query(graphQlQuery, {});\n this.logger.debug(\n `Get workflow definitions result: ${JSON.stringify(result)}`,\n );\n\n if (result.error) {\n this.logger.error(\n `Error fetching data index swf results ${result.error}`,\n );\n throw result.error;\n }\n\n return result.data.ProcessDefinitions;\n }\n\n public async fetchInstances(args: {\n definitionIds?: string[];\n pagination?: Pagination;\n filter?: Filter;\n }): Promise<ProcessInstance[]> {\n const { pagination, definitionIds, filter } = args;\n if (pagination) pagination.sortField ??= FETCH_PROCESS_INSTANCES_SORT_FIELD;\n\n const processIdNotNullCondition = 'processId: {isNull: false}';\n const definitionIdsCondition = definitionIds\n ? `processId: {in: ${JSON.stringify(definitionIds)}}`\n : undefined;\n const type = 'ProcessInstance';\n const filterCondition = filter\n ? buildFilterCondition(\n await this.inspectInputArgument(type),\n type,\n filter,\n )\n : '';\n\n let whereClause = '';\n const conditions = [];\n\n if (processIdNotNullCondition) {\n conditions.push(`{${processIdNotNullCondition}}`);\n }\n\n if (definitionIdsCondition) {\n conditions.push(`{${definitionIdsCondition}}`);\n }\n\n if (filter) {\n conditions.push(`{${filterCondition}}`);\n }\n\n if (conditions.length === 0) {\n whereClause = processIdNotNullCondition;\n } else if (conditions.length === 1) {\n whereClause = conditions[0].slice(1, -1); // Remove the outer braces\n } else if (conditions.length > 1) {\n whereClause = `and: [${conditions.join(', ')}]`;\n }\n\n const graphQlQuery = buildGraphQlQuery({\n type: 'ProcessInstances',\n queryBody:\n 'id, processName, processId, businessKey, state, start, end, nodes { id }, variables, parentProcessInstance {id, processName, businessKey}',\n whereClause,\n pagination,\n });\n\n this.logger.debug(`GraphQL query: ${graphQlQuery}`);\n\n const result = await this.client.query(graphQlQuery, {});\n\n this.logger.debug(\n `Fetch process instances result: ${JSON.stringify(result)}`,\n );\n\n const processInstancesSrc = result.data\n .ProcessInstances as ProcessInstance[];\n\n const processInstances = await Promise.all(\n processInstancesSrc.map(async instance => {\n return await this.getWorkflowDefinitionFromInstance(instance);\n }),\n );\n return processInstances;\n }\n\n public async fetchInstancesTotalCount(\n definitionIds?: string[],\n filter?: Filter,\n ): Promise<number> {\n const definitionIdsCondition = definitionIds\n ? `processId: {in: ${JSON.stringify(definitionIds)}}`\n : undefined;\n this.initInputProcessDefinitionArgs();\n const filterCondition = filter\n ? buildFilterCondition(\n await this.inspectInputArgument('ProcessInstance'),\n 'ProcessInstance',\n filter,\n )\n : '';\n\n let whereClause: string | undefined;\n if (definitionIds && filter) {\n whereClause = `and: [{${definitionIdsCondition}}, {${filterCondition}}]`;\n } else if (definitionIdsCondition || filterCondition) {\n whereClause = definitionIdsCondition ?? filterCondition;\n }\n\n const graphQlQuery = buildGraphQlQuery({\n type: 'ProcessInstances',\n queryBody: 'id',\n whereClause,\n });\n this.logger.debug(`GraphQL query: ${graphQlQuery}`);\n\n const result = await this.client.query(graphQlQuery, {});\n\n if (result.error) {\n this.logger.error(\n `Error when fetching instances total count: ${result.error}`,\n );\n throw result.error;\n }\n\n const idArr = result.data.ProcessInstances as ProcessInstance[];\n\n return idArr.length;\n }\n\n private async getWorkflowDefinitionFromInstance(instance: ProcessInstance) {\n const workflowInfo = await this.fetchWorkflowInfo(instance.processId);\n if (!workflowInfo?.source) {\n throw new Error(\n `Workflow defintion is required to fetch instance ${instance.id}`,\n );\n }\n const workflowDefinitionSrc: WorkflowDefinition = fromWorkflowSource(\n workflowInfo.source,\n );\n if (workflowInfo) {\n instance.category = getWorkflowCategory(workflowDefinitionSrc);\n instance.description = workflowInfo.description;\n }\n return instance;\n }\n\n public async fetchWorkflowSource(\n definitionId: string,\n ): Promise<string | undefined> {\n const graphQlQuery = `{ ProcessDefinitions ( where: {id: {equal: \"${definitionId}\" } } ) { id, source } }`;\n\n const result = await this.client.query(graphQlQuery, {});\n\n this.logger.debug(\n `Fetch workflow source result: ${JSON.stringify(result)}`,\n );\n\n if (result.error) {\n this.logger.error(`Error when fetching workflow source: ${result.error}`);\n return undefined;\n }\n\n const processDefinitions = result.data.ProcessDefinitions as WorkflowInfo[];\n\n if (processDefinitions.length === 0) {\n this.logger.info(`No workflow source found for ${definitionId}`);\n return undefined;\n }\n\n return processDefinitions[0].source;\n }\n\n public async fetchInstancesByDefinitionId(args: {\n definitionId: string;\n limit: number;\n offset: number;\n }): Promise<ProcessInstance[]> {\n const graphQlQuery = `{ ProcessInstances(where: {processId: {equal: \"${args.definitionId}\" } }, pagination: {limit: ${args.limit}, offset: ${args.offset}}) { id, processName, state, start, end } }`;\n\n const result = await this.client.query(graphQlQuery, {});\n\n this.logger.debug(\n `Fetch workflow instances result: ${JSON.stringify(result)}`,\n );\n\n if (result.error) {\n this.logger.error(\n `Error when fetching workflow instances: ${result.error}`,\n );\n throw result.error;\n }\n\n return result.data.ProcessInstances;\n }\n\n public async fetchInstanceVariables(\n instanceId: string,\n ): Promise<object | undefined> {\n const graphQlQuery = `{ ProcessInstances (where: { id: {equal: \"${instanceId}\" } } ) { variables } }`;\n\n const result = await this.client.query(graphQlQuery, {});\n\n this.logger.debug(\n `Fetch process instance variables result: ${JSON.stringify(result)}`,\n );\n\n if (result.error) {\n this.logger.error(\n `Error when fetching process instance variables: ${result.error}`,\n );\n throw result.error;\n }\n\n const processInstances = result.data.ProcessInstances as ProcessInstance[];\n\n if (processInstances.length === 0) {\n return undefined;\n }\n\n return parseWorkflowVariables(processInstances[0].variables as object);\n }\n\n public async fetchDefinitionIdByInstanceId(\n instanceId: string,\n ): Promise<string | undefined> {\n const graphQlQuery = `{ ProcessInstances (where: { id: {equal: \"${instanceId}\" } } ) { processId } }`;\n\n const result = await this.client.query(graphQlQuery, {});\n\n this.logger.debug(\n `Fetch process id from instance result: ${JSON.stringify(result)}`,\n );\n\n if (result.error) {\n this.logger.error(\n `Error when fetching process id from instance: ${result.error}`,\n );\n throw result.error;\n }\n\n const processInstances = result.data.ProcessInstances as ProcessInstance[];\n\n if (processInstances.length === 0) {\n return undefined;\n }\n\n return processInstances[0].processId;\n }\n\n public async fetchInstance(\n instanceId: string,\n ): Promise<ProcessInstance | undefined> {\n const FindProcessInstanceQuery = gql`\n query FindProcessInstanceQuery($instanceId: String!) {\n ProcessInstances(where: { id: { equal: $instanceId } }) {\n id\n processName\n processId\n serviceUrl\n businessKey\n state\n start\n end\n nodes {\n id\n nodeId\n definitionId\n type\n name\n enter\n exit\n }\n variables\n parentProcessInstance {\n id\n processName\n businessKey\n }\n error {\n nodeDefinitionId\n message\n }\n }\n }\n `;\n\n const result = await this.client.query(FindProcessInstanceQuery, {\n instanceId,\n });\n\n this.logger.debug(\n `Fetch process instance result: ${JSON.stringify(result)}`,\n );\n\n if (result.error) {\n this.logger.error(\n `Error when fetching process instances: ${result.error}`,\n );\n throw result.error;\n }\n\n const processInstances = result.data.ProcessInstances as ProcessInstance[];\n\n if (processInstances.length === 0) {\n return undefined;\n }\n\n const instance = processInstances[0];\n\n const workflowInfo = await this.fetchWorkflowInfo(instance.processId);\n if (!workflowInfo?.source) {\n throw new Error(\n `Workflow defintion is required to fetch instance ${instance.id}`,\n );\n }\n const workflowDefinitionSrc: WorkflowDefinition = fromWorkflowSource(\n workflowInfo.source,\n );\n if (workflowInfo) {\n instance.category = getWorkflowCategory(workflowDefinitionSrc);\n instance.description = workflowDefinitionSrc.description;\n }\n return instance;\n }\n}\n"],"names":["ErrorBuilder","Client","fetchExchange","gql","buildFilterCondition","buildGraphQlQuery","FETCH_PROCESS_INSTANCES_SORT_FIELD","fromWorkflowSource","getWorkflowCategory","parseWorkflowVariables"],"mappings":";;;;;;;;;AAoCO,MAAM,gBAAiB,CAAA;AAAA,EAKrB,WAAA,CACY,cACA,MACjB,EAAA;AAFiB,IAAA,IAAA,CAAA,YAAA,GAAA,YAAA,CAAA;AACA,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AAEjB,IAAI,IAAA,CAAC,aAAa,MAAQ,EAAA;AACxB,MAAA,MAAMA,0BAAa,yBAA0B,EAAA,CAAA;AAAA,KAC/C;AAEA,IAAK,IAAA,CAAA,MAAA,GAAS,KAAK,mBAAoB,EAAA,CAAA;AAAA,GACzC;AAAA,EAbiB,MAAA,CAAA;AAAA,EACV,6BAAmD,EAAC,CAAA;AAAA,EACpD,2BAAiD,EAAC,CAAA;AAAA,EAajD,mBAA8B,GAAA;AACpC,IAAM,MAAA,KAAA,GAAQ,CAAG,EAAA,IAAA,CAAK,YAAY,CAAA,QAAA,CAAA,CAAA;AAClC,IAAA,OAAO,IAAIC,WAAO,CAAA;AAAA,MAChB,GAAK,EAAA,KAAA;AAAA,MACL,SAAA,EAAW,CAACC,kBAAa,CAAA;AAAA,KAC1B,CAAA,CAAA;AAAA,GACH;AAAA,EAEA,MAAa,8BAAgE,GAAA;AAC3E,IAAI,IAAA,IAAA,CAAK,0BAA2B,CAAA,MAAA,KAAW,CAAG,EAAA;AAChD,MAAK,IAAA,CAAA,0BAAA,GAA6B,MAAM,IAAK,CAAA,oBAAA;AAAA,QAC3C,mBAAA;AAAA,OACF,CAAA;AAAA,KACF;AACA,IAAA,OAAO,IAAK,CAAA,0BAAA,CAAA;AAAA,GACd;AAAA,EAEO,qBAAqB,IAAsB,EAAA;AAChD,IAAA,OAAO,SAAS,IAAI,CAAA;AAAA,sBAAA,EACA,IAAI,CAAA;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ACA,MAAA,MAAM,MAAO,CAAA,KAAA,CAAA;AAAA,KACf;AAEA,IAAM,MAAA,gBAAA,GAAmB,OAAO,IAAK,CAAA,gBAAA,CAAA;AAErC,IAAI,IAAA,gBAAA,CAAiB,WAAW,CAAG,EAAA;AACjC,MAAO,OAAA,KAAA,CAAA,CAAA;AAAA,KACT;AAEA,IAAM,MAAA,QAAA,GAAW,iBAAiB,CAAC,CAAA,CAAA;AAEnC,IAAA,MAAM,YAAe,GAAA,MAAM,IAAK,CAAA,iBAAA,CAAkB,SAAS,SAAS,CAAA,CAAA;AACpE,IAAI,IAAA,CAAC,cAAc,MAAQ,EAAA;AACzB,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,CAAA,iDAAA,EAAoD,SAAS,EAAE,CAAA,CAAA;AAAA,OACjE,CAAA;AAAA,KACF;AACA,IAAA,MAAM,qBAA4C,GAAAI,oDAAA;AAAA,MAChD,YAAa,CAAA,MAAA;AAAA,KACf,CAAA;AACA,IAAA,IAAI,YAAc,EAAA;AAChB,MAAS,QAAA,CAAA,QAAA,GAAWC,sDAAoB,qBAAqB,CAAA,CAAA;AAC7D,MAAA,QAAA,CAAS,cAAc,qBAAsB,CAAA,WAAA,CAAA;AAAA,KAC/C;AACA,IAAO,OAAA,QAAA,CAAA;AAAA,GACT;AACF;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var constants = require('./constants.cjs.js');
|
|
4
|
+
|
|
5
|
+
class DataInputSchemaService {
|
|
6
|
+
extractWorkflowData(variables) {
|
|
7
|
+
return variables && constants.WORKFLOW_DATA_KEY in variables ? variables[constants.WORKFLOW_DATA_KEY] : void 0;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.DataInputSchemaService = DataInputSchemaService;
|
|
12
|
+
//# sourceMappingURL=DataInputSchemaService.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataInputSchemaService.cjs.js","sources":["../../src/service/DataInputSchemaService.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { JsonObject } from '@backstage/types';\n\nimport { WORKFLOW_DATA_KEY } from './constants';\n\nexport class DataInputSchemaService {\n public extractWorkflowData(variables?: object): JsonObject | undefined {\n return variables && WORKFLOW_DATA_KEY in variables\n ? (variables[WORKFLOW_DATA_KEY] as JsonObject)\n : undefined;\n }\n}\n"],"names":["WORKFLOW_DATA_KEY"],"mappings":";;;;AAmBO,MAAM,sBAAuB,CAAA;AAAA,EAC3B,oBAAoB,SAA4C,EAAA;AACrE,IAAA,OAAO,SAAa,IAAAA,2BAAA,IAAqB,SACpC,GAAA,SAAA,CAAUA,2BAAiB,CAC5B,GAAA,KAAA,CAAA,CAAA;AAAA,GACN;AACF;;;;"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var fs = require('fs-extra');
|
|
4
|
+
var backstagePluginOrchestratorCommon = require('@red-hat-developer-hub/backstage-plugin-orchestrator-common');
|
|
5
|
+
var child_process = require('child_process');
|
|
6
|
+
var path = require('path');
|
|
7
|
+
var GitService = require('./GitService.cjs.js');
|
|
8
|
+
var Helper = require('./Helper.cjs.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
13
|
+
|
|
14
|
+
const SONATA_FLOW_RESOURCES_PATH = "/home/kogito/serverless-workflow-project/src/main/resources";
|
|
15
|
+
class DevModeService {
|
|
16
|
+
constructor(config, logger) {
|
|
17
|
+
this.logger = logger;
|
|
18
|
+
this.connection = this.extractConnectionConfig(config);
|
|
19
|
+
this.gitService = new GitService.GitService(logger, config);
|
|
20
|
+
}
|
|
21
|
+
connection;
|
|
22
|
+
gitService;
|
|
23
|
+
get devModeUrl() {
|
|
24
|
+
if (!this.connection.port) {
|
|
25
|
+
return this.connection.host;
|
|
26
|
+
}
|
|
27
|
+
return `${this.connection.host}:${this.connection.port}`;
|
|
28
|
+
}
|
|
29
|
+
async launchDevMode() {
|
|
30
|
+
await this.loadDevWorkflows();
|
|
31
|
+
const isAlreadyUp = await this.isSonataFlowUp(false, this.devModeUrl);
|
|
32
|
+
if (isAlreadyUp) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
this.launchSonataFlow();
|
|
36
|
+
return await this.isSonataFlowUp(true, this.devModeUrl);
|
|
37
|
+
}
|
|
38
|
+
async isSonataFlowUp(withRetry, endpoint) {
|
|
39
|
+
const healthUrl = `${endpoint}/q/health`;
|
|
40
|
+
this.logger.info(`Checking SonataFlow health at: ${healthUrl}`);
|
|
41
|
+
try {
|
|
42
|
+
const response = await Helper.executeWithRetry(
|
|
43
|
+
() => fetch(healthUrl),
|
|
44
|
+
withRetry ? 15 : 1
|
|
45
|
+
);
|
|
46
|
+
if (response.ok) {
|
|
47
|
+
this.logger.info("SonataFlow is up and running");
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
} catch (e) {
|
|
51
|
+
this.logger.error(`Error when checking SonataFlow health: ${e}`);
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
launchSonataFlow() {
|
|
56
|
+
const launcherCmd = this.createLauncherCommand();
|
|
57
|
+
this.logger.info(
|
|
58
|
+
`Auto starting SonataFlow through: ${launcherCmd.command} ${launcherCmd.args.join(" ")}`
|
|
59
|
+
);
|
|
60
|
+
const process = child_process.spawn(launcherCmd.command, launcherCmd.args, {
|
|
61
|
+
shell: false
|
|
62
|
+
});
|
|
63
|
+
process.on("close", (code) => {
|
|
64
|
+
this.logger.info(`SonataFlow process exited with code ${code}`);
|
|
65
|
+
});
|
|
66
|
+
process.on("exit", (code) => {
|
|
67
|
+
this.logger.info(`SonataFlow process exited with code ${code}`);
|
|
68
|
+
});
|
|
69
|
+
process.on("error", (error) => {
|
|
70
|
+
this.logger.error(`SonataFlow process error: ${error}`);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
createLauncherCommand() {
|
|
74
|
+
const resourcesAbsPath = path.resolve(
|
|
75
|
+
path.join(this.connection.resourcesPath, backstagePluginOrchestratorCommon.DEFAULT_WORKFLOWS_PATH)
|
|
76
|
+
);
|
|
77
|
+
const launcherArgs = [
|
|
78
|
+
"run",
|
|
79
|
+
"--name",
|
|
80
|
+
"backstage-internal-sonataflow",
|
|
81
|
+
"--add-host",
|
|
82
|
+
"host.docker.internal:host-gateway"
|
|
83
|
+
];
|
|
84
|
+
launcherArgs.push("-e", `QUARKUS_HTTP_PORT=${this.connection.port}`);
|
|
85
|
+
launcherArgs.push("-p", `${this.connection.port}:${this.connection.port}`);
|
|
86
|
+
launcherArgs.push("-e", `KOGITO_SERVICE_URL=${this.devModeUrl}`);
|
|
87
|
+
launcherArgs.push(
|
|
88
|
+
"-v",
|
|
89
|
+
`${resourcesAbsPath}:${SONATA_FLOW_RESOURCES_PATH}:Z`
|
|
90
|
+
);
|
|
91
|
+
launcherArgs.push("-e", "KOGITO.CODEGEN.PROCESS.FAILONERROR=false");
|
|
92
|
+
launcherArgs.push(
|
|
93
|
+
"-e",
|
|
94
|
+
`QUARKUS_EMBEDDED_POSTGRESQL_DATA_DIR=${this.connection.persistencePath}`
|
|
95
|
+
);
|
|
96
|
+
launcherArgs.push(this.connection.containerImage);
|
|
97
|
+
return {
|
|
98
|
+
command: "docker",
|
|
99
|
+
args: launcherArgs
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
extractConnectionConfig(config) {
|
|
103
|
+
const host = config.getOptionalString("orchestrator.sonataFlowService.baseUrl") ?? backstagePluginOrchestratorCommon.DEFAULT_SONATAFLOW_BASE_URL;
|
|
104
|
+
const port = config.getOptionalNumber(
|
|
105
|
+
"orchestrator.sonataFlowService.port"
|
|
106
|
+
);
|
|
107
|
+
const resourcesPath = config.getOptionalString(
|
|
108
|
+
"orchestrator.sonataFlowService.workflowsSource.localPath"
|
|
109
|
+
) ?? "";
|
|
110
|
+
const containerImage = config.getOptionalString("orchestrator.sonataFlowService.container") ?? backstagePluginOrchestratorCommon.DEFAULT_SONATAFLOW_CONTAINER_IMAGE;
|
|
111
|
+
const persistencePath = config.getOptionalString(
|
|
112
|
+
"orchestrator.sonataFlowService.persistence.path"
|
|
113
|
+
) ?? backstagePluginOrchestratorCommon.DEFAULT_SONATAFLOW_PERSISTENCE_PATH;
|
|
114
|
+
const repoUrl = config.getOptionalString(
|
|
115
|
+
"orchestrator.sonataFlowService.workflowsSource.gitRepositoryUrl"
|
|
116
|
+
) ?? "";
|
|
117
|
+
return {
|
|
118
|
+
host,
|
|
119
|
+
port,
|
|
120
|
+
containerImage,
|
|
121
|
+
resourcesPath,
|
|
122
|
+
persistencePath,
|
|
123
|
+
repoUrl
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
async loadDevWorkflows() {
|
|
127
|
+
if (!this.connection.repoUrl) {
|
|
128
|
+
this.logger.info(
|
|
129
|
+
"No Git repository configured. Skipping dev workflows loading."
|
|
130
|
+
);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.logger.info(`Loading dev workflows from ${this.connection.repoUrl}`);
|
|
134
|
+
const localPath = this.connection.resourcesPath;
|
|
135
|
+
if (await fs__default.default.pathExists(localPath)) {
|
|
136
|
+
this.logger.info(`Path ${localPath} already exists. Skipping clone.`);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
await this.gitService.clone(this.connection.repoUrl, localPath);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
exports.DevModeService = DevModeService;
|
|
144
|
+
//# sourceMappingURL=DevModeService.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevModeService.cjs.js","sources":["../../src/service/DevModeService.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { LoggerService } from '@backstage/backend-plugin-api';\nimport type { Config } from '@backstage/config';\n\nimport fs from 'fs-extra';\n\nimport {\n DEFAULT_SONATAFLOW_BASE_URL,\n DEFAULT_SONATAFLOW_CONTAINER_IMAGE,\n DEFAULT_SONATAFLOW_PERSISTENCE_PATH,\n DEFAULT_WORKFLOWS_PATH,\n} from '@red-hat-developer-hub/backstage-plugin-orchestrator-common';\n\nimport { spawn } from 'child_process';\nimport { join, resolve } from 'path';\n\nimport { GitService } from './GitService';\nimport { executeWithRetry } from './Helper';\n\nconst SONATA_FLOW_RESOURCES_PATH =\n '/home/kogito/serverless-workflow-project/src/main/resources';\n\ninterface LauncherCommand {\n command: string;\n args: string[];\n}\n\ninterface DevModeConnectionConfig {\n host: string;\n port?: number;\n containerImage: string;\n resourcesPath: string;\n persistencePath: string;\n repoUrl?: string;\n}\n\nexport class DevModeService {\n private readonly connection: DevModeConnectionConfig;\n private readonly gitService;\n\n constructor(config: Config, private readonly logger: LoggerService) {\n this.connection = this.extractConnectionConfig(config);\n this.gitService = new GitService(logger, config);\n }\n\n public get devModeUrl(): string {\n if (!this.connection.port) {\n return this.connection.host;\n }\n return `${this.connection.host}:${this.connection.port}`;\n }\n\n public async launchDevMode(): Promise<boolean> {\n await this.loadDevWorkflows();\n\n const isAlreadyUp = await this.isSonataFlowUp(false, this.devModeUrl);\n if (isAlreadyUp) {\n return true;\n }\n\n this.launchSonataFlow();\n\n return await this.isSonataFlowUp(true, this.devModeUrl);\n }\n\n private async isSonataFlowUp(\n withRetry: boolean,\n endpoint: string,\n ): Promise<boolean> {\n const healthUrl = `${endpoint}/q/health`;\n this.logger.info(`Checking SonataFlow health at: ${healthUrl}`);\n\n try {\n const response = await executeWithRetry(\n () => fetch(healthUrl),\n withRetry ? 15 : 1,\n );\n if (response.ok) {\n this.logger.info('SonataFlow is up and running');\n return true;\n }\n } catch (e) {\n this.logger.error(`Error when checking SonataFlow health: ${e}`);\n }\n return false;\n }\n\n private launchSonataFlow(): void {\n const launcherCmd = this.createLauncherCommand();\n\n this.logger.info(\n `Auto starting SonataFlow through: ${\n launcherCmd.command\n } ${launcherCmd.args.join(' ')}`,\n );\n\n const process = spawn(launcherCmd.command, launcherCmd.args, {\n shell: false,\n });\n\n process.on('close', code => {\n this.logger.info(`SonataFlow process exited with code ${code}`);\n });\n\n process.on('exit', code => {\n this.logger.info(`SonataFlow process exited with code ${code}`);\n });\n\n process.on('error', error => {\n this.logger.error(`SonataFlow process error: ${error}`);\n });\n }\n\n private createLauncherCommand(): LauncherCommand {\n const resourcesAbsPath = resolve(\n join(this.connection.resourcesPath, DEFAULT_WORKFLOWS_PATH),\n );\n\n const launcherArgs = [\n 'run',\n '--name',\n 'backstage-internal-sonataflow',\n '--add-host',\n 'host.docker.internal:host-gateway',\n ];\n\n launcherArgs.push('-e', `QUARKUS_HTTP_PORT=${this.connection.port}`);\n\n launcherArgs.push('-p', `${this.connection.port}:${this.connection.port}`);\n launcherArgs.push('-e', `KOGITO_SERVICE_URL=${this.devModeUrl}`);\n launcherArgs.push(\n '-v',\n `${resourcesAbsPath}:${SONATA_FLOW_RESOURCES_PATH}:Z`,\n );\n launcherArgs.push('-e', 'KOGITO.CODEGEN.PROCESS.FAILONERROR=false');\n launcherArgs.push(\n '-e',\n `QUARKUS_EMBEDDED_POSTGRESQL_DATA_DIR=${this.connection.persistencePath}`,\n );\n\n launcherArgs.push(this.connection.containerImage);\n\n return {\n command: 'docker',\n args: launcherArgs,\n };\n }\n\n private extractConnectionConfig(config: Config): DevModeConnectionConfig {\n const host =\n config.getOptionalString('orchestrator.sonataFlowService.baseUrl') ??\n DEFAULT_SONATAFLOW_BASE_URL;\n const port = config.getOptionalNumber(\n 'orchestrator.sonataFlowService.port',\n );\n\n const resourcesPath =\n config.getOptionalString(\n 'orchestrator.sonataFlowService.workflowsSource.localPath',\n ) ?? '';\n\n const containerImage =\n config.getOptionalString('orchestrator.sonataFlowService.container') ??\n DEFAULT_SONATAFLOW_CONTAINER_IMAGE;\n\n const persistencePath =\n config.getOptionalString(\n 'orchestrator.sonataFlowService.persistence.path',\n ) ?? DEFAULT_SONATAFLOW_PERSISTENCE_PATH;\n\n const repoUrl =\n config.getOptionalString(\n 'orchestrator.sonataFlowService.workflowsSource.gitRepositoryUrl',\n ) ?? '';\n\n return {\n host,\n port,\n containerImage,\n resourcesPath,\n persistencePath,\n repoUrl,\n };\n }\n\n public async loadDevWorkflows() {\n if (!this.connection.repoUrl) {\n this.logger.info(\n 'No Git repository configured. Skipping dev workflows loading.',\n );\n return;\n }\n\n this.logger.info(`Loading dev workflows from ${this.connection.repoUrl}`);\n const localPath = this.connection.resourcesPath;\n if (await fs.pathExists(localPath)) {\n this.logger.info(`Path ${localPath} already exists. Skipping clone.`);\n return;\n }\n\n await this.gitService.clone(this.connection.repoUrl, localPath);\n }\n}\n"],"names":["GitService","executeWithRetry","spawn","resolve","join","DEFAULT_WORKFLOWS_PATH","DEFAULT_SONATAFLOW_BASE_URL","DEFAULT_SONATAFLOW_CONTAINER_IMAGE","DEFAULT_SONATAFLOW_PERSISTENCE_PATH","fs"],"mappings":";;;;;;;;;;;;;AAiCA,MAAM,0B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