Skip to content

Commit dfd28b3

Browse files
authored
fix(orchestrator): returns the version of the workflow in the response (#2925)
* fix: returns the version of the workflow in the response
1 parent 91e724f commit dfd28b3

16 files changed

Lines changed: 504 additions & 443 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-orchestrator-backend': patch
3+
'@red-hat-developer-hub/backstage-plugin-orchestrator-common': patch
4+
---
5+
6+
fix: returns the version of the workflow in the overview and instance reponses

workspaces/orchestrator/plugins/orchestrator-backend/src/service/DataIndexService.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ describe('fetchInstances', () => {
546546
definitionIds,
547547
)}`;
548548
const queryBody =
549-
'id, processName, processId, state, start, end, nodes { id }, variables, executionSummary, parentProcessInstance {id, processName, businessKey}';
549+
'id, version, processName, processId, state, start, end, nodes { id }, variables, executionSummary, parentProcessInstance {id, processName, businessKey}';
550550

551551
const mockProcessInstances: ProcessInstance[] = [
552552
{

workspaces/orchestrator/plugins/orchestrator-backend/src/service/DataIndexService.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export class DataIndexService {
324324
const graphQlQuery = buildGraphQlQuery({
325325
type: 'ProcessInstances',
326326
queryBody:
327-
'id, processName, processId, state, start, end, nodes { id }, variables, executionSummary, parentProcessInstance {id, processName, businessKey}',
327+
'id, version, processName, processId, state, start, end, nodes { id }, variables, executionSummary, parentProcessInstance {id, processName, businessKey}',
328328
whereClause,
329329
pagination,
330330
filterCondition: filterCondition,
@@ -485,7 +485,7 @@ export class DataIndexService {
485485
where: {processId: {equal: $definitionId } ${targetEntityWhereCondition} },
486486
orderBy: {start:DESC},
487487
pagination: {limit: $limit, offset: $offset}
488-
) { id, processName, state, start, end }
488+
) { id, version, processName, state, start, end }
489489
}
490490
`;
491491

@@ -590,6 +590,7 @@ export class DataIndexService {
590590
query FindProcessInstanceQuery($instanceId: String!) {
591591
ProcessInstances(where: { id: { equal: $instanceId } }) {
592592
id
593+
version
593594
processName
594595
processId
595596
serviceUrl

workspaces/orchestrator/plugins/orchestrator-backend/src/service/SonataFlowService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ export class SonataFlowService {
381381
lastTriggeredMs: lastTriggered.getTime(),
382382
lastRunStatus,
383383
description: definition.description,
384+
version: definition.version,
384385
};
385386
}
386387

workspaces/orchestrator/plugins/orchestrator-backend/src/service/api/mapping/V2Mappings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export function mapToWorkflowOverviewDTO(
5151
: undefined,
5252
lastTriggeredMs: overview.lastTriggeredMs,
5353
isAvailable: overview.isAvailable,
54+
version: overview.version,
5455
};
5556
}
5657

@@ -108,6 +109,7 @@ export function mapToProcessInstanceDTO(
108109

109110
return {
110111
id: processInstance.id,
112+
version: processInstance.version,
111113
processId: processInstance.processId,
112114
processName: processInstance.processName,
113115
description: processInstance.description,

workspaces/orchestrator/plugins/orchestrator-common/report.api.md

Lines changed: 452 additions & 438 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
29ca3997832aabcbc991d7ee209a2201c100b234
1+
cf0efc8cfbff20790511b54518709ea36cffe122

workspaces/orchestrator/plugins/orchestrator-common/src/generated/api/definition.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

workspaces/orchestrator/plugins/orchestrator-common/src/generated/client/api.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ export interface ProcessInstanceDTO {
367367
* @memberof ProcessInstanceDTO
368368
*/
369369
'id': string;
370+
/**
371+
* Process definition version
372+
* @type {string}
373+
* @memberof ProcessInstanceDTO
374+
*/
375+
'version'?: string;
370376
/**
371377
*
372378
* @type {string}
@@ -712,6 +718,12 @@ export interface WorkflowOverviewDTO {
712718
* @memberof WorkflowOverviewDTO
713719
*/
714720
'isAvailable'?: boolean;
721+
/**
722+
* Workflow definition version
723+
* @type {string}
724+
* @memberof WorkflowOverviewDTO
725+
*/
726+
'version'?: string;
715727
}
716728

717729

workspaces/orchestrator/plugins/orchestrator-common/src/generated/docs/api-doc/orchestrator-api.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ spec:
464464
type: string
465465
isAvailable:
466466
type: boolean
467+
version:
468+
type: string
469+
description: Workflow definition version
467470
required:
468471
- workflowId
469472
- format
@@ -536,6 +539,9 @@ spec:
536539
properties:
537540
id:
538541
type: string
542+
version:
543+
type: string
544+
description: Process definition version
539545
processId:
540546
type: string
541547
processName:

0 commit comments

Comments
 (0)