Skip to content

Commit 3d8566c

Browse files
Alex-Tidemanrossedforttemporal-datastevekinneylaurakwhit
authored
New Versioning UI (#2142)
* Add config and command to run local temporal server, remove versioning on workflow worker tab, add link to task queue, add tabs for workers/versioning on task queue page. Add view all assignment rules row * send resetType in request body for batch reset (#2110) * send resetType in req body for batch reset for compatibility with older server/api versions * default reset type to first, clear up reason hint text * 2.27.4 (#2111) Co-authored-by: Temporal Data (cicd) <[email protected]> * remove import from protos, use custom enum (#2112) * 2.27.5 (#2113) Co-authored-by: Temporal Data (cicd) <[email protected]> * Remove copyable tooltip (#2114) * Fix issue where close button cannot be seen on dark drawers (#2115) * Fix issue where close button cannot be seen on dark drawers * Update drawer.stories.svelte * Update drawer.stories.svelte * DT-2159 - fix "Reapply Signals" checkbox on reset workflow confirmation form (#2117) * use binding instead of on:change for reset reapply checkbox * add regression integration test * Night mode audit (#2118) * Update and consolidate surface colors * Update text colors * Update border colors * Update shadow colors * Remove unnecessary colors * Fix box shadow color * Use ring instead of box shadow * Update WorkflowStatus colors * Fix simple TableHeaderRow * Input updates based on designs * Fix table headers and various text and bg colors * Update button styles to match designs * Remove disabled color variables, update placeholder text and update Pill component * Update checkbox and radio input * Update toggle switch * Update IconButton to use Button component * Remove unnecessary badge background * Update Toast component colors * Update snaps and fix errors * Remove unnecessary surface-input * Update page background color to match designs * Update timeline background and text color * Remove underline on button links * Remove ternary and use and instead for active class * Delete snapshot tests * Kebab case colors * Keep Button border as 2px on focus * Add caret-danger to plugin * 2.27.6 (#2122) Co-authored-by: Temporal Data (cicd) <[email protected]> * Add local-temporal command (#2120) * Update SideNavigation component (#2124) * Update side nav focus styles * Update heart beat indicator color * Update version.go to v2.27.2 (#2126) * Link to namespace in Namespace sticky nav (#2123) * Add href prop to combobox for link button * Subtle border, better path, disable link if no namespace * add docs to side nav (#2131) * add filtering to api pagination (#2130) * DT-2179 - fix wf reset button & other fixes (#2133) * missed PR feedback - fix ApiPagination prop typing and name - add search icon to input in ApiPagination * fix workflow reset button disabled logic * move docs link * use cloud guard * Add timezoneName to schedule spec with default of UTC (#2127) * Add timezoneName to schedule spec with default of UTC * Use translate for timezones * Set input on edit * Add onDecode prop * 2.27.7 (#2134) Co-authored-by: Temporal Data (cicd) <[email protected]> * Audit a11y issues (#2135) * DT-2134 Fix a11y issues with accordion.svelte * Remove on:keydown on CodeBlock I could not find a single use of `CodeBlock` that had an on:keydown event. [Related ticket](https://temporalio.atlassian.net/browse/DT-2135). * Update filter-or-copy-buttons.svelte These both appear to be `noop` functions? * clean up workflow actions (#2136) * clean up workflow actions * better i18n string name * fix batch action checks * fix tests * add integration tests * 2.27.8 (#2137) Co-authored-by: Temporal Data (cicd) <[email protected]> * Update workflow status colors (#2132) * Update running color * Update scheduled color * Update completed and open color * Update new and initiated color * Use globalThis.accessToken() for codec server calls (#2138) * Fix api pagination alignment, add debounce as a prop (#2139) * fix alignment of api pagination slots * fix * fix slot check * add debounce as a prop * spelling * fix debounce * remove loading slot prop * 2.27.9 (#2140) Co-authored-by: Temporal Data (cicd) <[email protected]> * Fix header colors * Update snaps? * Remove commented out mock, better check for rules * Remove dup .env --------- Co-authored-by: Ross Edfort <[email protected]> Co-authored-by: Temporal Data (cicd) <[email protected]> Co-authored-by: Steve Kinney <[email protected]> Co-authored-by: Laura Whitaker <[email protected]> Co-authored-by: Grace Iris Gardner <[email protected]>
1 parent 44e68a6 commit 3d8566c

File tree

17 files changed

+238
-179
lines changed

17 files changed

+238
-179
lines changed

src/fixtures/task-queue-rules.json

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,45 @@
22
"assignmentRules": [
33
{
44
"rule": {
5-
"targetBuildId": "1.10",
6-
"ramp": {
7-
"percentageRamp": {
8-
"rampPercentage": 0.2
9-
}
5+
"targetBuildId": "1.12-alpha",
6+
"percentageRamp": {
7+
"rampPercentage": 0.2
108
}
119
},
12-
"createTime": "2024-01-01T00:00:00Z"
10+
"createTime": "2024-04-04T00:00:00Z"
11+
},
12+
{
13+
"rule": {
14+
"targetBuildId": "1.11-beta",
15+
"percentageRamp": {
16+
"rampPercentage": 0.4
17+
}
18+
},
19+
"createTime": "2024-04-02T00:00:00Z"
20+
},
21+
{
22+
"rule": {
23+
"targetBuildId": "1.1",
24+
"percentageRamp": {
25+
"rampPercentage": 1
26+
}
27+
},
28+
"createTime": "2024-04-01T00:00:00Z"
1329
},
1430
{
1531
"rule": {
16-
"targetBuildId": "1.11",
17-
"ramp": {
18-
"percentageRamp": {
19-
"rampPercentage": 0.4
20-
}
32+
"targetBuildId": "1.01",
33+
"percentageRamp": {
34+
"rampPercentage": 1
2135
}
2236
},
23-
"createTime": "2024-02-01T00:00:00Z"
37+
"createTime": "2024-03-15T00:00:00Z"
2438
},
2539
{
2640
"rule": {
27-
"targetBuildId": "1.12",
28-
"ramp": {
29-
"percentageRamp": {
30-
"rampPercentage": 0.5
31-
}
41+
"targetBuildId": "1.00",
42+
"percentageRamp": {
43+
"rampPercentage": 1
3244
}
3345
},
3446
"createTime": "2024-03-01T00:00:00Z"
Lines changed: 48 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,59 @@
11
<script lang="ts">
2-
import Badge from '$lib/holocene/badge.svelte';
3-
import CompatibilityBadge from '$lib/holocene/compatibility-badge.svelte';
42
import EmptyState from '$lib/holocene/empty-state.svelte';
53
import TableHeaderRow from '$lib/holocene/table/table-header-row.svelte';
64
import TableRow from '$lib/holocene/table/table-row.svelte';
75
import Table from '$lib/holocene/table/table.svelte';
86
import { translate } from '$lib/i18n/translate';
9-
import {
10-
type GetPollersResponse,
11-
type TaskQueueRules,
12-
} from '$lib/services/pollers-service';
13-
import { relativeTime, timeFormat } from '$lib/stores/time-format';
7+
import { type TaskQueueRules } from '$lib/services/pollers-service';
8+
import { timeFormat } from '$lib/stores/time-format';
149
import { formatDate } from '$lib/utilities/format-date';
1510
16-
import PollerIcon from './poller-icon.svelte';
11+
export let rules: TaskQueueRules;
1712
18-
export let workers: GetPollersResponse;
19-
export let rules: TaskQueueRules | undefined = undefined;
13+
let showAll = false;
2014
21-
$: ({ assignmentRules, compatibleRedirectRules } = rules);
15+
$: ({ assignmentRules = [], compatibleRedirectRules = [] } = rules);
16+
17+
$: catchAllRule = assignmentRules.find(
18+
(rule) =>
19+
!rule.rule?.percentageRamp?.rampPercentage ||
20+
rule.rule?.percentageRamp?.rampPercentage.toFixed(0) === '1',
21+
);
22+
$: catchAllIndex = assignmentRules.indexOf(catchAllRule);
23+
24+
$: activeRules = assignmentRules.filter((r, i) => i <= catchAllIndex);
25+
$: inactiveRules = assignmentRules.filter((r, i) => i > catchAllIndex);
26+
27+
$: visibleRules = showAll ? [...activeRules, ...inactiveRules] : activeRules;
2228
</script>
2329

2430
<h2 class="text-base font-medium" data-testid="worker-rules">
2531
{translate('workers.assignment-rules')}
2632
</h2>
2733
<Table class="mb-6 w-full table-fixed">
2834
<TableHeaderRow slot="headers">
29-
<th class="w-2/3">Target Build ID</th>
30-
<th class="w-1/3 text-right">Create Time</th>
35+
<th class="w-20">Index</th>
36+
<th class="grow">Target Build ID</th>
37+
<th class="w-20">Ramp</th>
38+
<th class="text-right">Create Time</th>
3139
</TableHeaderRow>
32-
{#each assignmentRules as rule, index (index)}
40+
{#each visibleRules as rule, index (index)}
3341
<TableRow data-testid="version-row">
34-
<td class="text-left" data-testid="target-source"
35-
>{rule.rule.targetBuildId}</td
42+
<td class="text-left" data-testid="index">{index}</td>
43+
<td class="break-all text-left" data-testid="target-source"
44+
>{rule.rule?.targetBuildId}</td
3645
>
3746
<td class="text-right" data-testid="target-source"
38-
>{formatDate(rule.createTime, $timeFormat)}</td
47+
>{((rule.rule?.percentageRamp?.rampPercentage || 1) * 100).toFixed(
48+
0,
49+
)}%</td
50+
>
51+
<td
52+
class="justfiy-between flex w-full items-center text-right"
53+
data-testid="target-source"
3954
>
55+
<p>{formatDate(rule.createTime, $timeFormat)}</p>
56+
</td>
4057
</TableRow>
4158
{:else}
4259
<tr class="w-full">
@@ -45,6 +62,20 @@
4562
</td>
4663
</tr>
4764
{/each}
65+
{#if !showAll && inactiveRules?.length}
66+
<TableRow
67+
data-testid="view-all"
68+
class="cursor-pointer bg-slate-100"
69+
on:click={() => (showAll = !showAll)}
70+
>
71+
<td></td>
72+
<td class="break-all text-left text-blue-700 underline"
73+
>{translate('workers.view-all-assignment-rules')}</td
74+
>
75+
<td />
76+
<td />
77+
</TableRow>
78+
{/if}
4879
</Table>
4980

5081
<h2 class="text-base font-medium" data-testid="worker-rules">
@@ -76,64 +107,3 @@
76107
</tr>
77108
{/each}
78109
</Table>
79-
80-
<h2 class="flex items-center gap-2 text-base font-medium" data-testid="workers">
81-
{translate('workers.workers')}
82-
<Badge type="count" class="rounded-sm">{workers?.pollers?.length || 0}</Badge>
83-
</h2>
84-
<Table class="mb-6 w-full min-w-[600px] table-fixed">
85-
<caption class="sr-only" slot="caption"
86-
>{translate('workflows.workers-tab')}</caption
87-
>
88-
<TableHeaderRow slot="headers">
89-
<th class={'w-3/12'}>{translate('common.id')}</th>
90-
<th class="w-3/12">{translate('workers.buildId')}</th>
91-
<th class="w-2/12">{translate('workflows.last-accessed')}</th>
92-
<th class="w-2/12">
93-
<p class="text-center">
94-
{translate('workflows.workflow-task-handler')}
95-
</p>
96-
</th>
97-
<th class="w-2/12 text-center">
98-
<p class="text-center">{translate('workflows.activity-handler')}</p>
99-
</th>
100-
</TableHeaderRow>
101-
{#each workers?.pollers as poller (poller.identity)}
102-
<TableRow data-testid="worker-row">
103-
<td class="text-left" data-testid="worker-identity">
104-
<p class="select-all">{poller.identity}</p>
105-
</td>
106-
<td class="text-left" data-testid="worker-identity">
107-
<p class="select-all">
108-
<CompatibilityBadge
109-
active
110-
buildId={poller?.workerVersionCapabilities?.buildId}
111-
/>
112-
</p>
113-
</td>
114-
<td class="text-left" data-testid="worker-last-access-time">
115-
<p class="select-all">
116-
{formatDate(poller.lastAccessTime, $timeFormat, {
117-
relative: $relativeTime,
118-
})}
119-
</p>
120-
</td>
121-
<td data-testid="workflow-poller">
122-
<PollerIcon
123-
includesTaskQueueType={poller.taskQueueTypes.includes('WORKFLOW')}
124-
/>
125-
</td>
126-
<td data-testid="activity-poller">
127-
<PollerIcon
128-
includesTaskQueueType={poller.taskQueueTypes.includes('ACTIVITY')}
129-
/>
130-
</td>
131-
</TableRow>
132-
{:else}
133-
<tr class="w-full">
134-
<td colspan={6}>
135-
<EmptyState title={translate('workflows.workers-empty-state')} />
136-
</td>
137-
</tr>
138-
{/each}
139-
</Table>

src/lib/components/worker-table.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<p class="text-center">{translate('workflows.activity-handler')}</p>
3535
</th>
3636
</TableHeaderRow>
37-
{#each workers?.pollers as poller (poller.identity)}
37+
{#each workers?.pollers as poller}
3838
<TableRow data-testid="worker-row">
3939
<td class="text-left" data-testid="worker-identity">
4040
<p class="select-all">{poller.identity}</p>

src/lib/i18n/locales/en/workers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export const Namespace = 'workers' as const;
33
export const Strings = {
44
workers: 'Workers',
55
version: 'Version',
6+
versioning: 'Versioning',
67
retirability: 'Retirability',
78
buildId: 'Build ID',
89
'assignment-rules': 'Assignment Rules',
@@ -14,6 +15,7 @@ export const Strings = {
1415
'no-version-sets-found': 'No Version Sets found',
1516
'no-assignment-rules-found': 'No Assignment Rules found',
1617
'no-redirect-rules-found': 'No Redirect Rules found',
18+
'view-all-assignment-rules': 'View all Assignment Rules',
1719
'last-used-version': 'Last used version',
1820
'next-version': 'Next version',
1921
'ready-to-be-retired': 'Ready to be Retired',

src/lib/layouts/workflow-header.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
);
5858
$: workflowHasBeenReset = has($resetWorkflows, $workflowRun?.workflow?.runId);
5959
$: workflowUsesVersioning =
60+
workflow?.assignedBuildId ??
6061
workflow?.mostRecentWorkerVersionStamp?.useVersioning;
6162
$: workflowRelationships = getWorkflowRelationships(
6263
workflow,
@@ -125,7 +126,7 @@
125126
</div>
126127
</div>
127128
<Tabs>
128-
<TabList class="flex flex-wrap gap-6 p-4" label="workflow detail">
129+
<TabList class="flex flex-wrap gap-6 p-4 pl-0" label="workflow detail">
129130
<Tab
130131
label={translate('workflows.history-tab')}
131132
id="history-tab"

src/lib/models/__snapshots__/workflow-execution.test.ts.snap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
exports[`toWorkflowExecution > should match the snapshot for Canceled workflows 1`] = `
44
{
5+
"assignedBuildId": undefined,
56
"canBeTerminated": false,
67
"defaultWorkflowTaskTimeout": "20s",
78
"endTime": "2022-07-01T20:20:50.181506253Z",
@@ -44,6 +45,7 @@ exports[`toWorkflowExecution > should match the snapshot for Canceled workflows
4445

4546
exports[`toWorkflowExecution > should match the snapshot for Completed workflows 1`] = `
4647
{
48+
"assignedBuildId": undefined,
4749
"canBeTerminated": false,
4850
"defaultWorkflowTaskTimeout": "20s",
4951
"endTime": "2022-07-01T20:28:52.916373379Z",
@@ -86,6 +88,7 @@ exports[`toWorkflowExecution > should match the snapshot for Completed workflows
8688

8789
exports[`toWorkflowExecution > should match the snapshot for Failed workflows 1`] = `
8890
{
91+
"assignedBuildId": undefined,
8992
"canBeTerminated": false,
9093
"defaultWorkflowTaskTimeout": "20s",
9194
"endTime": "2022-07-01T20:22:50.027441003Z",
@@ -121,6 +124,7 @@ exports[`toWorkflowExecution > should match the snapshot for Failed workflows 1`
121124

122125
exports[`toWorkflowExecution > should match the snapshot for Running workflows 1`] = `
123126
{
127+
"assignedBuildId": undefined,
124128
"canBeTerminated": true,
125129
"defaultWorkflowTaskTimeout": "20s",
126130
"endTime": null,
@@ -189,6 +193,7 @@ exports[`toWorkflowExecution > should match the snapshot for Running workflows 1
189193

190194
exports[`toWorkflowExecution > should match the snapshot for Terminated workflows 1`] = `
191195
{
196+
"assignedBuildId": undefined,
192197
"canBeTerminated": false,
193198
"defaultWorkflowTaskTimeout": "20s",
194199
"endTime": "2022-07-01T20:14:51.002030504Z",
@@ -262,6 +267,7 @@ exports[`toWorkflowExecution > should match the snapshot for Terminated workflow
262267

263268
exports[`toWorkflowExecution > should match the snapshot for TimedOut workflows 1`] = `
264269
{
270+
"assignedBuildId": undefined,
265271
"canBeTerminated": false,
266272
"defaultWorkflowTaskTimeout": "20s",
267273
"endTime": "2022-07-01T14:16:18.804308503Z",
@@ -305,6 +311,7 @@ exports[`toWorkflowExecution > should match the snapshot for TimedOut workflows
305311
exports[`toWorkflowExecutions > should match the snapshot 1`] = `
306312
[
307313
{
314+
"assignedBuildId": undefined,
308315
"canBeTerminated": false,
309316
"defaultWorkflowTaskTimeout": undefined,
310317
"endTime": "2022-07-01T20:20:50.181506253Z",
@@ -341,6 +348,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
341348
"url": "/workflows/temporal.fixture.cancelled.workflow.id/346e7a24-c660-4f91-a777-ffe3274d8144",
342349
},
343350
{
351+
"assignedBuildId": undefined,
344352
"canBeTerminated": false,
345353
"defaultWorkflowTaskTimeout": undefined,
346354
"endTime": "2022-07-01T20:28:52.916373379Z",
@@ -377,6 +385,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
377385
"url": "/workflows/temporal.fixture.completed.workflow.id/202dcff6-7f35-4c65-995c-bcadce524fb1",
378386
},
379387
{
388+
"assignedBuildId": undefined,
380389
"canBeTerminated": false,
381390
"defaultWorkflowTaskTimeout": undefined,
382391
"endTime": "2022-07-01T20:22:50.027441003Z",
@@ -409,6 +418,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
409418
"url": "/workflows/temporal.fixture.failed.workflow.id/7e00b341-c579-4bb5-9e28-810d34ef4329",
410419
},
411420
{
421+
"assignedBuildId": undefined,
412422
"canBeTerminated": true,
413423
"defaultWorkflowTaskTimeout": undefined,
414424
"endTime": null,
@@ -445,6 +455,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
445455
"url": "/workflows/temporal.fixture.running.workflow.id/2a7ba421-f74b-4b8b-b9d8-e6e30e4caac7",
446456
},
447457
{
458+
"assignedBuildId": undefined,
448459
"canBeTerminated": false,
449460
"defaultWorkflowTaskTimeout": undefined,
450461
"endTime": "2022-07-01T20:14:51.073853795Z",
@@ -481,6 +492,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
481492
"url": "/workflows/temporal.fixture.completed.workflow.id/dfd4039d-4bc0-4864-9a24-85d136814977",
482493
},
483494
{
495+
"assignedBuildId": undefined,
484496
"canBeTerminated": false,
485497
"defaultWorkflowTaskTimeout": undefined,
486498
"endTime": "2022-07-01T20:14:51.002030504Z",
@@ -517,6 +529,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
517529
"url": "/workflows/temporal.fixture.terminated.workflow.id/16c5fbe5-f82d-43c1-acbc-18c65c449ace",
518530
},
519531
{
532+
"assignedBuildId": undefined,
520533
"canBeTerminated": false,
521534
"defaultWorkflowTaskTimeout": undefined,
522535
"endTime": "2022-07-01T14:16:18.804308503Z",

0 commit comments

Comments
 (0)