-
Notifications
You must be signed in to change notification settings - Fork 154
feat(DT-3944): SignalWithStart system Nexus obfuscation — decode infrastructure + UI #3356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
49eff6a
63753c6
9421a91
03929d0
f2e8456
fadea3f
6121234
1781da9
14f3a50
c4b99c9
53a56b1
2e6995e
dab2970
7a0f3a8
ca8c043
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| engine-strict=true | ||
| @buf:registry=https://buf.build/gen/npm/v1/ |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| import { | ||
| isActivityTaskScheduledEvent, | ||
| isActivityTaskStartedEvent, | ||
| isNexusOperationScheduledEvent, | ||
| } from '$lib/utilities/is-event-type'; | ||
|
|
||
| import { | ||
|
|
@@ -58,6 +59,16 @@ | |
| pendingActivity && pendingActivity.pauseInfo?.pauseTime, | ||
| ); | ||
|
|
||
| const systemNexusCategory = $derived.by((): typeof group.category | null => { | ||
| if (!isNexusOperationScheduledEvent(group.initialEvent)) return null; | ||
| const attrs = group.initialEvent.nexusOperationScheduledEventAttributes; | ||
| if (String(attrs.endpoint ?? '') !== '__temporal_system') return null; | ||
| if (attrs.operation === 'SignalWithStartWorkflowExecution') return 'signal'; | ||
| return null; | ||
| }); | ||
|
|
||
| const effectiveCategory = $derived(systemNexusCategory ?? group.category); | ||
|
|
||
| let decodedLocalActivity: SummaryAttribute | undefined = $state(undefined); | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| onMount(async () => { | ||
|
|
@@ -189,7 +200,7 @@ | |
| > | ||
| <div | ||
| class={groupHover({ | ||
| category: group ? group.category : 'default', | ||
| category: group ? effectiveCategory : 'default', | ||
| })} | ||
| ></div> | ||
| </foreignObject> | ||
|
|
@@ -224,7 +235,7 @@ | |
| <Line | ||
| startPoint={[x, y]} | ||
| endPoint={[nextPoint, y]} | ||
| category={group.category} | ||
| category={effectiveCategory} | ||
| classification={group.lastEvent.classification} | ||
| pending={!!pauseTime} | ||
| paused={!!pauseTime} | ||
|
|
@@ -242,7 +253,7 @@ | |
| ? pendingActivity.attempt > 1 | ||
| ? 'retry' | ||
| : 'pending' | ||
| : group.category} | ||
| : effectiveCategory} | ||
| classification={group.lastEvent.classification} | ||
| pending | ||
| paused={!!pauseTime} | ||
|
|
@@ -295,12 +306,13 @@ | |
| {/if} | ||
| <Dot | ||
| point={[x, y]} | ||
| category={effectiveCategory} | ||
| classification={group.eventList[index]?.classification} | ||
| icon={pauseTime && index !== 0 | ||
| ? 'pause' | ||
| : decodedLocalActivity | ||
| ? CategoryIcon['local-activity'].name | ||
| : CategoryIcon[group.category].name} | ||
| : CategoryIcon[effectiveCategory].name} | ||
| r={radius} | ||
| /> | ||
| {/each} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <script lang="ts"> | ||
| import type { Component } from 'svelte'; | ||
|
|
||
| import type { Payload } from '$lib/types'; | ||
| import { | ||
| describeNexusOperation, | ||
| type NexusEmbeddedOperationKind, | ||
| type NexusOperationDescriptor, | ||
| } from '$lib/utilities/nexus-operation-registry'; | ||
|
|
||
| import DefaultRenderer from './system-nexus/default-renderer.svelte'; | ||
| import SignalWithStartRenderer from './system-nexus/signal-with-start-renderer.svelte'; | ||
|
|
||
| interface Props { | ||
| payload: Payload; | ||
| maxHeight?: number; | ||
| } | ||
|
|
||
| let { payload, maxHeight }: Props = $props(); | ||
|
|
||
| type RendererProps = { | ||
| descriptor: NexusOperationDescriptor; | ||
| maxHeight?: number; | ||
| }; | ||
|
|
||
| const RENDERERS: Partial< | ||
| Record<NexusEmbeddedOperationKind, Component<RendererProps>> | ||
| > = { | ||
| 'signal-with-start-workflow': SignalWithStartRenderer, | ||
| }; | ||
|
|
||
| const descriptor: NexusOperationDescriptor | null = $derived( | ||
| describeNexusOperation(payload), | ||
| ); | ||
|
|
||
| const Renderer = $derived( | ||
| descriptor ? (RENDERERS[descriptor.kind] ?? DefaultRenderer) : null, | ||
| ); | ||
| </script> | ||
|
|
||
| {#if descriptor && Renderer} | ||
| <Renderer {descriptor} {maxHeight} /> | ||
| {/if} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <script lang="ts"> | ||
| import PayloadCodeBlock from '$lib/components/payload/payload-code-block.svelte'; | ||
| import type { NexusOperationDescriptor } from '$lib/utilities/nexus-operation-registry'; | ||
|
|
||
| interface Props { | ||
| descriptor: NexusOperationDescriptor; | ||
| maxHeight?: number; | ||
| } | ||
|
|
||
| let { descriptor, maxHeight }: Props = $props(); | ||
| </script> | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| <PayloadCodeBlock value={descriptor.embeddedInput} {maxHeight} /> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <script lang="ts"> | ||
| import PayloadCodeBlock from '$lib/components/payload/payload-code-block.svelte'; | ||
| import type { NexusOperationDescriptor } from '$lib/utilities/nexus-operation-registry'; | ||
|
|
||
| interface Props { | ||
| descriptor: NexusOperationDescriptor; | ||
| maxHeight?: number; | ||
| } | ||
|
|
||
| let { descriptor, maxHeight }: Props = $props(); | ||
| </script> | ||
|
|
||
| <div class="flex flex-col gap-2"> | ||
| {#if descriptor.embeddedInput != null || descriptor.workflowInput != null} | ||
| {#if descriptor.embeddedInput != null} | ||
| {#if descriptor.workflowInput != null} | ||
| <p class="text-xs text-secondary/70">Signal Input</p> | ||
| {/if} | ||
| <PayloadCodeBlock value={descriptor.embeddedInput} {maxHeight} /> | ||
| {/if} | ||
| {#if descriptor.workflowInput != null} | ||
| <p class="text-xs text-secondary/70">Workflow Input</p> | ||
| <PayloadCodeBlock value={descriptor.workflowInput} {maxHeight} /> | ||
| {/if} | ||
| {:else} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| <PayloadCodeBlock value={null} {maxHeight} /> | ||
| {/if} | ||
| </div> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.