Skip to content

Commit 2e7037a

Browse files
Update cadence-idl version to latest (#1005)
* Update cadence-idl version to cadence-workflow/cadence-idl@0e56e57 * Update snapshots and history formatter schemas
1 parent 2a5cb63 commit 2e7037a

File tree

12 files changed

+96
-4
lines changed

12 files changed

+96
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cadence-web",
33
"private": true,
44
"config": {
5-
"cadence_idl_version": "7b45e3095a5103b5f4709e6b0eb1771342693838"
5+
"cadence_idl_version": "0e56e57909d9fa738eaa8d7a9561ea16acdf51e4"
66
},
77
"scripts": {
88
"dev": "next dev -p ${CADENCE_WEB_PORT:-8088} -H ${CADENCE_WEB_HOSTNAME:-0.0.0.0} | pino-pretty --messageKey message",

src/route-handlers/describe-task-list/__fixtures__/mock-task-list-response.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export const mockDecisionTaskListResponse: DescribeTaskListResponse = {
2121
],
2222
taskListStatus: null,
2323
partitionConfig: null,
24+
taskList: {
25+
name: 'mock-task-list',
26+
kind: 'TASK_LIST_KIND_NORMAL',
27+
},
2428
};
2529

2630
export const mockActivityTaskListResponse: DescribeTaskListResponse = {
@@ -44,4 +48,8 @@ export const mockActivityTaskListResponse: DescribeTaskListResponse = {
4448
],
4549
taskListStatus: null,
4650
partitionConfig: null,
51+
taskList: {
52+
name: 'mock-task-list',
53+
kind: 'TASK_LIST_KIND_NORMAL',
54+
},
4755
};

src/route-handlers/describe-workflow/describe-workflow.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ export default async function describeWorkflow(
115115
isCron: null,
116116
updateTime: null,
117117
partitionConfig: null,
118+
taskListInfo: null,
119+
activeClusterSelectionPolicy: null,
120+
cronOverlapPolicy: 'CRON_OVERLAP_POLICY_INVALID',
118121
},
119122
pendingActivities: [],
120123
pendingChildren: [],

src/route-handlers/list-workflows/helpers/__tests__/map-executions-to-workflows.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ const MOCK_WORKFLOW_EXECUTIONS: Array<WorkflowExecutionInfo> = [
2424
isCron: false,
2525
updateTime: null,
2626
partitionConfig: {},
27+
taskListInfo: null,
28+
activeClusterSelectionPolicy: null,
29+
cronOverlapPolicy: 'CRON_OVERLAP_POLICY_INVALID',
2730
},
2831
{
2932
workflowExecution: {
@@ -44,6 +47,9 @@ const MOCK_WORKFLOW_EXECUTIONS: Array<WorkflowExecutionInfo> = [
4447
isCron: false,
4548
updateTime: null,
4649
partitionConfig: {},
50+
taskListInfo: null,
51+
activeClusterSelectionPolicy: null,
52+
cronOverlapPolicy: 'CRON_OVERLAP_POLICY_INVALID',
4753
},
4854
// Invalid workflow executions
4955
{
@@ -62,6 +68,9 @@ const MOCK_WORKFLOW_EXECUTIONS: Array<WorkflowExecutionInfo> = [
6268
isCron: false,
6369
updateTime: null,
6470
partitionConfig: {},
71+
taskListInfo: null,
72+
activeClusterSelectionPolicy: null,
73+
cronOverlapPolicy: 'CRON_OVERLAP_POLICY_INVALID',
6574
},
6675
{
6776
workflowExecution: {
@@ -82,6 +91,9 @@ const MOCK_WORKFLOW_EXECUTIONS: Array<WorkflowExecutionInfo> = [
8291
isCron: false,
8392
updateTime: null,
8493
partitionConfig: {},
94+
taskListInfo: null,
95+
activeClusterSelectionPolicy: null,
96+
cronOverlapPolicy: 'CRON_OVERLAP_POLICY_INVALID',
8597
},
8698
{
8799
workflowExecution: {
@@ -102,6 +114,9 @@ const MOCK_WORKFLOW_EXECUTIONS: Array<WorkflowExecutionInfo> = [
102114
isCron: false,
103115
updateTime: null,
104116
partitionConfig: {},
117+
taskListInfo: null,
118+
activeClusterSelectionPolicy: null,
119+
cronOverlapPolicy: 'CRON_OVERLAP_POLICY_INVALID',
105120
},
106121
];
107122

src/utils/data-formatters/__tests__/format-workflow-history.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('formatWorkflowHistory', () => {
7171
rawHistory: null,
7272
nextPageToken: '',
7373
};
74-
//@ts-expect-error testing missing archived field
74+
// @ts-expect-error testing case where archived is not set
7575
expect(formatWorkflowHistory(input)).toEqual(expectedOutput);
7676
});
7777

@@ -137,7 +137,7 @@ describe('formatWorkflowHistory', () => {
137137
rawHistory: null,
138138
nextPageToken: '',
139139
};
140-
//@ts-expect-error testing null raw history
140+
// @ts-expect-error testing null case
141141
expect(formatWorkflowHistory(input)).toEqual(expectedOutput);
142142
});
143143
});

src/utils/data-formatters/format-workflow-history-event/__tests__/index.test.ts.snapshot

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,9 @@ exports[`formatWorkflowHistoryEvent should format workflow startChildWorkflowExe
510510

511511
exports[`formatWorkflowHistoryEvent should format workflow startChildWorkflowExecutionInitiatedEventAttributes to match snapshot 1`] = `
512512
{
513+
"activeClusterSelectionPolicy": null,
513514
"control": null,
515+
"cronOverlapPolicy": "CRON_OVERLAP_POLICY_INVALID",
514516
"cronSchedule": null,
515517
"decisionTaskCompletedEventId": 4,
516518
"delayStartSeconds": null,
@@ -648,7 +650,9 @@ exports[`formatWorkflowHistoryEvent should format workflow workflowExecutionComp
648650

649651
exports[`formatWorkflowHistoryEvent should format workflow workflowExecutionContinuedAsNewEventAttributes to match snapshot 1`] = `
650652
{
653+
"activeClusterSelectionPolicy": null,
651654
"backoffStartIntervalInSeconds": 55,
655+
"cronOverlapPolicy": "CRON_OVERLAP_POLICY_INVALID",
652656
"decisionTaskCompletedEventId": 17,
653657
"eventId": 55,
654658
"eventType": "WorkflowExecutionContinuedAsNew",
@@ -709,10 +713,12 @@ exports[`formatWorkflowHistoryEvent should format workflow workflowExecutionSign
709713

710714
exports[`formatWorkflowHistoryEvent should format workflow workflowExecutionStartedEventAttributes to match snapshot 1`] = `
711715
{
716+
"activeClusterSelectionPolicy": null,
712717
"attempt": null,
713718
"continuedExecutionRunId": "e8565005-a234-4077-a917-6e5992ccbe4a",
714719
"continuedFailureDetails": null,
715720
"continuedFailureReason": null,
721+
"cronOverlapPolicy": "CRON_OVERLAP_POLICY_INVALID",
716722
"cronSchedule": "@every 1m",
717723
"eventId": 1,
718724
"eventType": "WorkflowExecutionStarted",

src/utils/data-formatters/schema/history-event-schema.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { z } from 'zod';
22

3+
import { ActiveClusterSelectionStrategy } from '@/__generated__/proto-ts/uber/cadence/api/v1/ActiveClusterSelectionStrategy';
34
import { CancelExternalWorkflowExecutionFailedCause } from '@/__generated__/proto-ts/uber/cadence/api/v1/CancelExternalWorkflowExecutionFailedCause';
45
import { ChildWorkflowExecutionFailedCause } from '@/__generated__/proto-ts/uber/cadence/api/v1/ChildWorkflowExecutionFailedCause';
56
import { ContinueAsNewInitiator } from '@/__generated__/proto-ts/uber/cadence/api/v1/ContinueAsNewInitiator';
7+
import { CronOverlapPolicy } from '@/__generated__/proto-ts/uber/cadence/api/v1/CronOverlapPolicy';
68
import { DecisionTaskFailedCause } from '@/__generated__/proto-ts/uber/cadence/api/v1/DecisionTaskFailedCause';
79
import { DecisionTaskTimedOutCause } from '@/__generated__/proto-ts/uber/cadence/api/v1/DecisionTaskTimedOutCause';
810
import { type HistoryEvent } from '@/__generated__/proto-ts/uber/cadence/api/v1/HistoryEvent';
@@ -133,6 +135,41 @@ const signalExternalWorkflowExecutionFailedCauseSchema = z.enum([
133135
SignalExternalWorkflowExecutionFailedCause.SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_COMPLETED,
134136
]);
135137

138+
const cronOverlapPolicySchema = z.enum([
139+
CronOverlapPolicy.CRON_OVERLAP_POLICY_INVALID,
140+
CronOverlapPolicy.CRON_OVERLAP_POLICY_SKIPPED,
141+
CronOverlapPolicy.CRON_OVERLAP_POLICY_BUFFER_ONE,
142+
]);
143+
144+
const activeClusterSelectionStrategySchema = z.enum([
145+
ActiveClusterSelectionStrategy.ACTIVE_CLUSTER_SELECTION_STRATEGY_INVALID,
146+
ActiveClusterSelectionStrategy.ACTIVE_CLUSTER_SELECTION_STRATEGY_REGION_STICKY,
147+
ActiveClusterSelectionStrategy.ACTIVE_CLUSTER_SELECTION_STRATEGY_EXTERNAL_ENTITY,
148+
]);
149+
150+
const activeClusterSelectionPolicySchema = z.discriminatedUnion(
151+
'strategyConfig',
152+
[
153+
z.object({
154+
strategy: activeClusterSelectionStrategySchema,
155+
strategyConfig: z.literal('activeClusterStickyRegionConfig'),
156+
activeClusterStickyRegionConfig: z.object({
157+
stickyRegion: z.string(),
158+
}),
159+
activeClusterExternalEntityConfig: z.nullable(z.undefined()),
160+
}),
161+
z.object({
162+
strategy: activeClusterSelectionStrategySchema,
163+
strategyConfig: z.literal('activeClusterExternalEntityConfig'),
164+
activeClusterStickyRegionConfig: z.nullable(z.undefined()),
165+
activeClusterExternalEntityConfig: z.object({
166+
externalEntityType: z.string(),
167+
externalEntityKey: z.string(),
168+
}),
169+
}),
170+
]
171+
);
172+
136173
const failureSchema = z.object({
137174
reason: z.string(),
138175
details: z.string(),
@@ -220,6 +257,9 @@ export const workflowExecutionStartedEventSchema =
220257
firstScheduledTime: timestampSchema.nullable(),
221258
partitionConfig: z.record(z.string()),
222259
requestId: z.string(),
260+
cronOverlapPolicy: cronOverlapPolicySchema,
261+
activeClusterSelectionPolicy:
262+
activeClusterSelectionPolicySchema.nullable(),
223263
}),
224264
});
225265

@@ -536,6 +576,9 @@ export const workflowExecutionContinuedAsNewEventSchema =
536576
header: headerSchema.nullable(),
537577
memo: memoSchema.nullable(),
538578
searchAttributes: searchAttributesSchema.nullable(),
579+
cronOverlapPolicy: cronOverlapPolicySchema,
580+
activeClusterSelectionPolicy:
581+
activeClusterSelectionPolicySchema.nullable(),
539582
}),
540583
});
541584

@@ -575,6 +618,9 @@ export const startChildWorkflowExecutionInitiatedEventSchema =
575618
delayStart: durationSchema.nullable(),
576619
jitterStart: durationSchema.nullable(),
577620
firstRunAt: timestampSchema.nullable(),
621+
cronOverlapPolicy: cronOverlapPolicySchema,
622+
activeClusterSelectionPolicy:
623+
activeClusterSelectionPolicySchema.nullable(),
578624
}),
579625
});
580626

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
export type Props = {
22
cluster: string;
33
domain: string;
4-
taskList: { name: string | null; kind: 'NORMAL' | 'STICKY' | null } | null;
4+
taskList: {
5+
name: string | null;
6+
kind: 'NORMAL' | 'STICKY' | 'EPHEMERAL' | null;
7+
} | null;
58
};

src/views/workflow-history/__fixtures__/workflow-history-child-workflow-events.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export const initiateChildWorkflowEvent = {
4343
header: {
4444
fields: {},
4545
},
46+
activeClusterSelectionPolicy: null,
47+
cronOverlapPolicy: 'CRON_OVERLAP_POLICY_INVALID',
4648
},
4749
attributes: 'startChildWorkflowExecutionInitiatedEventAttributes',
4850
} as const satisfies ChildWorkflowExecutionHistoryEvent;

src/views/workflow-history/__fixtures__/workflow-history-single-events.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export const startWorkflowExecutionEvent = {
6363
nanos: 895425298,
6464
},
6565
requestId: '8b2d2b6f-996a-431e-96b3-17d19cf0e508',
66+
activeClusterSelectionPolicy: null,
67+
cronOverlapPolicy: 'CRON_OVERLAP_POLICY_INVALID',
6668
},
6769
attributes: 'workflowExecutionStartedEventAttributes',
6870
} as const satisfies SingleHistoryEvent;
@@ -258,6 +260,8 @@ export const continueAsNewWorkflowExecutionEvent = {
258260
},
259261
memo: null,
260262
searchAttributes: null,
263+
activeClusterSelectionPolicy: null,
264+
cronOverlapPolicy: 'CRON_OVERLAP_POLICY_INVALID',
261265
},
262266
attributes: 'workflowExecutionContinuedAsNewEventAttributes',
263267
} as const satisfies SingleHistoryEvent;

0 commit comments

Comments
 (0)