Skip to content

Commit 952e4dd

Browse files
Code-freeze 02.26.25 (#2590)
* Support messageType metadata on protobuf encoded Payloads (#2581) * WIP: add messageType metadata field for json/protobuf payloads. Need to add messageType to schedules/signals * Set existing messageType and encoding on start workflow if it exists, add to signal * Add gap * Url encode deployment name (#2585) * Don't query metadata if no pollers available (#2586) * Include Local Activity failure in filter for Pending and Failed Events (#2588) * Add local activity failure to filter * Add unit tests, refactor logic, standarized and clean up pending rows --------- Co-authored-by: Alex Tideman <[email protected]>
1 parent 77dc703 commit 952e4dd

24 files changed

+415
-81
lines changed

Diff for: src/lib/components/event/event-summary-row.svelte

+6-1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@
109109
isEventGroup(event) &&
110110
!event.isPending &&
111111
event.eventList.find(isActivityTaskStartedEvent)?.attributes?.attempt;
112+
$: showSecondaryAttribute =
113+
compact &&
114+
secondaryAttribute?.key &&
115+
secondaryAttribute?.key !== primaryAttribute?.key &&
116+
!currentEvent?.userMetadata?.summary;
112117
</script>
113118

114119
<tr
@@ -234,7 +239,7 @@
234239
{attributes}
235240
/>
236241
{/if}
237-
{#if compact && secondaryAttribute?.key && !currentEvent?.userMetadata?.summary}
242+
{#if showSecondaryAttribute}
238243
<EventDetailsRow {...secondaryAttribute} {attributes} />
239244
{/if}
240245
</td>

Diff for: src/lib/components/event/pending-activity-summary-row.svelte

+2-3
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@
4242
data-testid="pending-activity-summary-row"
4343
on:click|stopPropagation={onLinkClick}
4444
>
45-
<td>
45+
<td class="font-mono">
4646
<Link data-testid="link" {href}>
4747
{event.activityId}
4848
</Link>
4949
</td>
5050
<td class="w-full overflow-hidden text-right font-normal xl:text-left">
5151
<div class="flex w-full items-center gap-2">
52-
<!-- <Icon name="activity" /> -->
5352
<p class="event-name truncate font-semibold md:text-base">
5453
Pending Activity
5554
</p>
@@ -88,7 +87,7 @@
8887

8988
<style lang="postcss">
9089
.row {
91-
@apply flex select-none items-center gap-4 px-1 text-sm no-underline;
90+
@apply flex select-none items-center gap-4 px-2 text-sm no-underline;
9291
}
9392
9493
.expanded-cell {

Diff for: src/lib/components/event/pending-nexus-summary-row.svelte

+2-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
data-testid="pending-nexus-summary-row"
4242
on:click|stopPropagation={onLinkClick}
4343
>
44-
<td class="w-12 text-left">
44+
<td class="font-mono">
4545
<Link data-testid="link" {href}>
4646
{event.scheduledEventId || ''}
4747
</Link>
@@ -51,7 +51,6 @@
5151
>
5252
<div class="flex">
5353
<div class="flex w-full items-center gap-2">
54-
<Icon name="nexus" />
5554
<p class="font-semibold md:text-base">Pending Nexus Operation</p>
5655
{#if event.attempt}
5756
<div
@@ -85,7 +84,7 @@
8584

8685
<style lang="postcss">
8786
.row {
88-
@apply flex select-none items-center gap-4 px-1 text-sm no-underline;
87+
@apply flex select-none items-center gap-4 px-2 text-sm no-underline;
8988
}
9089
9190
.expanded-cell {

Diff for: src/lib/components/payload-input-with-encoding.svelte

+32-19
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<script lang="ts">
1010
import { type Writable } from 'svelte/store';
1111
12-
import { onDestroy } from 'svelte';
1312
import { v4 as uuid } from 'uuid';
1413
1514
import Card from '$lib/holocene/card.svelte';
15+
import Input from '$lib/holocene/input/input.svelte';
1616
import RadioGroup from '$lib/holocene/radio-input/radio-group.svelte';
1717
import RadioInput from '$lib/holocene/radio-input/radio-input.svelte';
1818
import { translate } from '$lib/i18n/translate';
@@ -22,36 +22,49 @@
2222
export let id = uuid();
2323
export let input: string;
2424
export let encoding: Writable<PayloadInputEncoding>;
25+
export let messageType: string;
2526
export let error = false;
2627
export let loading = false;
2728
export let label = translate('workflows.input');
2829
export let editing = true;
2930
30-
const clearValues = () => {
31-
$encoding = 'json/plain';
32-
};
33-
34-
onDestroy(clearValues);
31+
$: {
32+
if ($encoding === 'json/plain' && messageType) {
33+
messageType = '';
34+
}
35+
}
3536
</script>
3637

3738
<div>
3839
<h5 class="pb-1 text-sm font-medium">{label}</h5>
3940
<Card class="flex flex-col gap-2">
4041
<PayloadInput bind:input bind:loading {error} {id} {editing} />
41-
<div class="flex items-end {editing ? 'justify-between' : 'justify-end'}">
42+
<div
43+
class="flex items-end gap-2 {editing ? 'justify-between' : 'justify-end'}"
44+
>
4245
{#if editing}
43-
<RadioGroup
44-
description={translate('workflows.encoding')}
45-
bind:group={encoding}
46-
name="encoding"
47-
>
48-
<RadioInput id="json/plain" value="json/plain" label="json/plain" />
49-
<RadioInput
50-
id="json/protobuf"
51-
value="json/protobuf"
52-
label="json/protobuf"
53-
/>
54-
</RadioGroup>
46+
<div class="flex w-full flex-col gap-2">
47+
<RadioGroup
48+
description={translate('workflows.encoding')}
49+
bind:group={encoding}
50+
name="encoding"
51+
>
52+
<RadioInput id="json/plain" value="json/plain" label="json/plain" />
53+
<RadioInput
54+
id="json/protobuf"
55+
value="json/protobuf"
56+
label="json/protobuf"
57+
/>
58+
</RadioGroup>
59+
{#if $encoding === 'json/protobuf'}
60+
<Input
61+
label={translate('workflows.message-type')}
62+
bind:value={messageType}
63+
{error}
64+
id="messageType"
65+
/>
66+
{/if}
67+
</div>
5568
{/if}
5669
<slot name="action" />
5770
</div>

Diff for: src/lib/components/schedule/schedule-form-view.svelte

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
let input = '';
8080
let editInput = !schedule;
8181
let encoding: Writable<PayloadInputEncoding> = writable('json/plain');
82+
let messageType = '';
8283
let daysOfWeek: string[] = [];
8384
let daysOfMonth: number[] = [];
8485
let months: string[] = [];
@@ -104,6 +105,7 @@
104105
taskQueue,
105106
...(editInput && { input }),
106107
encoding: $encoding,
108+
messageType,
107109
hour,
108110
minute,
109111
second,
@@ -218,6 +220,7 @@
218220
bind:input
219221
bind:editInput
220222
bind:encoding
223+
bind:messageType
221224
payloads={schedule?.action?.startWorkflow?.input}
222225
showEditActions={Boolean(schedule)}
223226
/>

Diff for: src/lib/components/schedule/schedule-input-payload.svelte

+12
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
export let input: string;
1717
export let editInput: boolean;
1818
export let encoding: Writable<PayloadInputEncoding>;
19+
export let messageType: string;
1920
export let payloads: Payloads;
2021
export let showEditActions: boolean = false;
2122
2223
let initialInput = '';
2324
let initialEncoding: PayloadInputEncoding = 'json/plain';
25+
let initialMessageType = '';
2426
let loading = true;
2527
2628
const setInitialInput = (decodedValue: string): void => {
@@ -29,9 +31,17 @@
2931
const currentEncoding = atob(
3032
String(payloads?.payloads[0]?.metadata?.encoding ?? 'json/plain'),
3133
);
34+
const currentMessageType = payloads?.payloads[0]?.metadata?.messageType
35+
? atob(String(payloads?.payloads[0]?.metadata?.messageType))
36+
: '';
37+
3238
if (isPayloadInputEncodingType(currentEncoding)) {
3339
$encoding = currentEncoding;
3440
initialEncoding = $encoding;
41+
if (currentEncoding === 'json/protobuf' && currentMessageType) {
42+
messageType = currentMessageType;
43+
initialMessageType = currentMessageType;
44+
}
3545
}
3646
loading = false;
3747
};
@@ -41,6 +51,7 @@
4151
editInput = false;
4252
input = initialInput;
4353
$encoding = initialEncoding;
54+
messageType = initialMessageType;
4455
} else {
4556
editInput = true;
4657
input;
@@ -53,6 +64,7 @@
5364
<PayloadInputWithEncoding
5465
bind:input
5566
bind:encoding
67+
bind:messageType
5668
bind:loading
5769
editing={editInput}
5870
id="schedule-payload-input"

Diff for: src/lib/components/workflow/client-actions/signal-confirmation-modal.svelte

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@
3030
let name = '';
3131
let customSignal = false;
3232
33-
let encoding: Writable<PayloadInputEncoding> = writable(defaultEncoding);
3433
let input = '';
34+
let encoding: Writable<PayloadInputEncoding> = writable(defaultEncoding);
35+
let messageType = '';
3536
3637
const hideSignalModal = () => {
3738
open = false;
3839
name = '';
3940
input = '';
4041
customSignal = false;
4142
$encoding = defaultEncoding;
43+
messageType = '';
4244
};
4345
4446
const signal = async () => {
@@ -50,6 +52,7 @@
5052
workflow,
5153
input,
5254
encoding: $encoding,
55+
messageType,
5356
name,
5457
});
5558
$refresh = Date.now();
@@ -114,6 +117,6 @@
114117
bind:value={name}
115118
/>
116119
{/if}
117-
<PayloadInputWithEncoding bind:input bind:encoding />
120+
<PayloadInputWithEncoding bind:input bind:encoding bind:messageType />
118121
</div>
119122
</Modal>

Diff for: src/lib/i18n/locales/en/workflows.ts

+1
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ export const Strings = {
268268
'start-workflow-success': 'Workflow started successfully',
269269
'start-workflow-error': 'Error starting Workflow',
270270
encoding: 'Encoding',
271+
'message-type': 'Message Type',
271272
'user-metadata': 'User Metadata',
272273
'markdown-supported': 'Markdown Supported',
273274
'markdown-description':

Diff for: src/lib/layouts/workflow-run-layout.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
103103
workflowRunController = new AbortController();
104104
105-
if (workflow.isRunning) {
105+
if (workflow.isRunning && workers?.pollers?.length) {
106106
getWorkflowMetadata(
107107
{
108108
namespace,

Diff for: src/lib/pages/schedule-edit.svelte

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
taskQueue,
3838
input,
3939
encoding,
40+
messageType,
4041
hour,
4142
minute,
4243
second,
@@ -56,6 +57,7 @@
5657
taskQueue,
5758
input,
5859
encoding,
60+
messageType,
5961
searchAttributes,
6062
};
6163
const spec: Partial<ScheduleSpecParameters> = {

Diff for: src/lib/pages/schedules-create.svelte

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
taskQueue,
2525
input,
2626
encoding,
27+
messageType,
2728
hour,
2829
minute,
2930
second,
@@ -44,6 +45,7 @@
4445
taskQueue,
4546
input,
4647
encoding,
48+
messageType,
4749
searchAttributes,
4850
};
4951
const spec: Partial<ScheduleSpecParameters> = {

Diff for: src/lib/pages/start-workflow.svelte

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
let summary = '';
5050
let details = '';
5151
let encoding: Writable<PayloadInputEncoding> = writable('json/plain');
52+
let messageType = '';
5253
let inputRetrieved = 0;
5354
5455
let initialWorkflowId = '';
@@ -86,6 +87,7 @@
8687
summary,
8788
details,
8889
encoding: $encoding,
90+
messageType,
8991
searchAttributes,
9092
});
9193
toaster.push({
@@ -132,6 +134,8 @@
132134
workflowType: type,
133135
});
134136
input = initialValues.input;
137+
encoding.set(initialValues.encoding);
138+
messageType = initialValues.messageType;
135139
inputRetrieved = Date.now();
136140
summary = initialValues.summary;
137141
details = initialValues.details;
@@ -262,7 +266,7 @@
262266
on:blur={(e) => onInputChange(e, 'workflowType')}
263267
/>
264268
{#key inputRetrieved}
265-
<PayloadInputWithEncoding bind:input bind:encoding />
269+
<PayloadInputWithEncoding bind:input bind:encoding bind:messageType />
266270
{/key}
267271
{#if viewAdvancedOptions}
268272
<Card class="flex flex-col gap-2">

Diff for: src/lib/pages/workflow-query.svelte

+5-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@
8585
8686
try {
8787
encodePayloadResult = input
88-
? encodePayloads(input, 'json/plain', false)
88+
? encodePayloads({
89+
input,
90+
encoding: 'json/plain',
91+
encodeWithCodec: false,
92+
})
8993
: Promise.resolve(null);
9094
payloads = await encodePayloadResult;
9195
} catch (e) {

0 commit comments

Comments
 (0)