From 3069fac134c43e89c066addf9dae1939f4b14e2d Mon Sep 17 00:00:00 2001 From: Alex Tideman Date: Thu, 12 Dec 2024 11:29:49 -0600 Subject: [PATCH 1/3] Add blocked reason and links --- server/go.mod | 8 +-- server/go.sum | 16 +++--- src/lib/components/event/event-link.svelte | 21 +++++--- .../event/event-links-expanded.svelte | 34 +++++++------ .../lines-and-dots/workflow-callback.svelte | 49 +++++++++++++------ src/lib/i18n/locales/en/nexus.ts | 3 ++ src/lib/models/workflow-execution.ts | 4 +- src/lib/types/nexus.ts | 5 +- .../get-single-attribute-for-event.ts | 4 +- 9 files changed, 90 insertions(+), 54 deletions(-) diff --git a/server/go.mod b/server/go.mod index dd84016d9..fac433297 100644 --- a/server/go.mod +++ b/server/go.mod @@ -10,10 +10,10 @@ require ( github.com/labstack/echo/v4 v4.9.1 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.3.0 - go.temporal.io/api v1.38.0 + go.temporal.io/api v1.43.0 golang.org/x/net v0.28.0 golang.org/x/oauth2 v0.22.0 - google.golang.org/grpc v1.65.0 + google.golang.org/grpc v1.66.0 google.golang.org/protobuf v1.34.2 gopkg.in/validator.v2 v2.0.0-20210331031555-b37d688a7fb0 gopkg.in/yaml.v3 v3.0.1 @@ -35,8 +35,8 @@ require ( golang.org/x/sys v0.24.0 // indirect golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.3.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect ) replace github.com/grpc-ecosystem/grpc-gateway => github.com/temporalio/grpc-gateway v1.17.0 diff --git a/server/go.sum b/server/go.sum index 752e2c31f..441bee918 100644 --- a/server/go.sum +++ b/server/go.sum @@ -51,8 +51,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -go.temporal.io/api v1.38.0 h1:L5i+Ai7UoBa2Gq/goVHLY32064AgawxPDLkKm4I7fu4= -go.temporal.io/api v1.38.0/go.mod h1:fmh06EjstyrPp6SHbjJo7yYHBfHamPE4SytM+2NRejc= +go.temporal.io/api v1.43.0 h1:lBhq+u5qFJqGMXwWsmg/i8qn1UA/3LCwVc88l2xUMHg= +go.temporal.io/api v1.43.0/go.mod h1:1WwYUMo6lao8yl0371xWUm13paHExN5ATYT/B7QtFis= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= @@ -69,12 +69,12 @@ golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/src/lib/components/event/event-link.svelte b/src/lib/components/event/event-link.svelte index 21c3f5212..08ae358e4 100644 --- a/src/lib/components/event/event-link.svelte +++ b/src/lib/components/event/event-link.svelte @@ -1,22 +1,29 @@
-

Link

- - {link.workflowEvent.workflowId} - +

+ {label} +

+
+ + {value} + +
diff --git a/src/lib/components/event/event-links-expanded.svelte b/src/lib/components/event/event-links-expanded.svelte index d6bdbc9c5..7d43df3b1 100644 --- a/src/lib/components/event/event-links-expanded.svelte +++ b/src/lib/components/event/event-links-expanded.svelte @@ -1,23 +1,29 @@ {#each links as link} {#if link?.workflowEvent} - {@const href = routeForEventHistory({ - namespace: link.workflowEvent.namespace, - workflow: link.workflowEvent.workflowId, - run: link.workflowEvent.runId, - })} -
-

Link

- - {link.workflowEvent.workflowId} - +
+ +
+
+
{/if} {/each} diff --git a/src/lib/components/lines-and-dots/workflow-callback.svelte b/src/lib/components/lines-and-dots/workflow-callback.svelte index 77e384775..4a3900fc4 100644 --- a/src/lib/components/lines-and-dots/workflow-callback.svelte +++ b/src/lib/components/lines-and-dots/workflow-callback.svelte @@ -1,16 +1,22 @@
-
-

- {translate('common.url')} - {callback.callback.nexus.url} -

-
+ {#if link} + + + {/if}
-

- {translate('common.state')} {callback.state} +

+ {translate('common.state')}{callback.state}

{#if callback.attempt} -

+

{translate('common.attempt')} - {callback.attempt} + {callback.attempt}

{/if} {#if callback.lastAttemptCompleteTime} -

+

{translate('nexus.last-attempt-completed-time')} - {completedTime} + {completedTime}

{/if} {#if callback.nextAttemptScheduleTime} -

+

{translate('nexus.next-attempt-scheduled-time')} - {nextTime} + {nextTime}

{/if}
+ {#if blockedReason} +

+ {translate('nexus.blocked-reason')} + {blockedReason} +

+ {/if} {#if failure}

{translate('nexus.last-attempt-failure')}

diff --git a/src/lib/i18n/locales/en/nexus.ts b/src/lib/i18n/locales/en/nexus.ts index 66d8901b1..41ab87ab0 100644 --- a/src/lib/i18n/locales/en/nexus.ts +++ b/src/lib/i18n/locales/en/nexus.ts @@ -57,4 +57,7 @@ export const Strings = { 'last-attempt-completed-time': 'Last Attempt Completed Time', 'next-attempt-scheduled-time': 'Next Attempt Scheduled Time', 'last-attempt-failure': 'Last Attempt Failure', + 'blocked-reason': 'Blocked Reason', + link: 'Link', + 'link-namespace': 'Link Namespace', } as const; diff --git a/src/lib/models/workflow-execution.ts b/src/lib/models/workflow-execution.ts index 04ffd1d42..9b468c5ed 100644 --- a/src/lib/models/workflow-execution.ts +++ b/src/lib/models/workflow-execution.ts @@ -1,4 +1,3 @@ -import type { CallbackInfo } from '$lib/types'; import type { Callbacks, PendingActivity, @@ -6,6 +5,7 @@ import type { PendingChildren, PendingNexusOperation, } from '$lib/types/events'; +import type { Callback } from '$lib/types/nexus'; import type { ListWorkflowExecutionsResponse, WorkflowExecution, @@ -47,7 +47,7 @@ const toPendingNexusOperations = ( const toCallbacks = (callbacks?: Callbacks): Callbacks => { if (!callbacks) return []; - return callbacks.map((callback): CallbackInfo => { + return callbacks.map((callback): Callback => { return { ...callback, state: toCallbackStateReadable(callback.state), diff --git a/src/lib/types/nexus.ts b/src/lib/types/nexus.ts index 2da8b554c..c940a1e21 100644 --- a/src/lib/types/nexus.ts +++ b/src/lib/types/nexus.ts @@ -1,4 +1,4 @@ -import type { Endpoint, EndpointSpec } from '$lib/types'; +import type { CallbackInfo, Endpoint, EndpointSpec } from '$lib/types'; export interface NexusEndpointSpec extends EndpointSpec { descriptionString?: string; @@ -9,3 +9,6 @@ export interface NexusEndpoint extends Endpoint { state?: string; spec?: NexusEndpointSpec; } +export interface Callback extends CallbackInfo { + blockedReason?: string; +} diff --git a/src/lib/utilities/get-single-attribute-for-event.ts b/src/lib/utilities/get-single-attribute-for-event.ts index d450057d2..ff0b3e682 100644 --- a/src/lib/utilities/get-single-attribute-for-event.ts +++ b/src/lib/utilities/get-single-attribute-for-event.ts @@ -209,8 +209,8 @@ export const shouldDisplayChildWorkflowLink = ( const keysWithNexusEndpointLinks = ['endpointId'] as const; export const shouldDisplayNexusEndpointLink = (key: string): boolean => { - for (const taskQueueKey of keysWithNexusEndpointLinks) { - if (key === taskQueueKey) return true; + for (const endpointKey of keysWithNexusEndpointLinks) { + if (key === endpointKey) return true; } return false; From 0ab91e04088a0ea7c891a5f089ceee31e4937fed Mon Sep 17 00:00:00 2001 From: Alex Tideman Date: Thu, 12 Dec 2024 13:44:55 -0600 Subject: [PATCH 2/3] Add blocked reason to callback, add link namespace with a link to namespace --- src/lib/components/event/event-link.svelte | 5 ++--- src/lib/components/event/event-summary-row.svelte | 6 +++++- src/lib/components/lines-and-dots/workflow-callback.svelte | 6 ------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/lib/components/event/event-link.svelte b/src/lib/components/event/event-link.svelte index 08ae358e4..9624c8bc7 100644 --- a/src/lib/components/event/event-link.svelte +++ b/src/lib/components/event/event-link.svelte @@ -12,16 +12,15 @@ workflow: link.workflowEvent.workflowId, run: link.workflowEvent.runId, }); - export let xs = false;
-

+

{label}

-
+
{value} diff --git a/src/lib/components/event/event-summary-row.svelte b/src/lib/components/event/event-summary-row.svelte index e47fd7a2d..e5be88cba 100644 --- a/src/lib/components/event/event-summary-row.svelte +++ b/src/lib/components/event/event-summary-row.svelte @@ -199,7 +199,11 @@
{/if} {#if currentEvent?.links?.length} - + {/if} {#if primaryAttribute?.key} diff --git a/src/lib/components/lines-and-dots/workflow-callback.svelte b/src/lib/components/lines-and-dots/workflow-callback.svelte index 4a3900fc4..af4f352be 100644 --- a/src/lib/components/lines-and-dots/workflow-callback.svelte +++ b/src/lib/components/lines-and-dots/workflow-callback.svelte @@ -84,9 +84,3 @@ {/if}
- - From 8b9d68bf2f334612fd0540263ba30cd80bb0722d Mon Sep 17 00:00:00 2001 From: Alex Tideman Date: Thu, 12 Dec 2024 13:52:23 -0600 Subject: [PATCH 3/3] Remove unused classes, consistent padding --- .../components/event/event-links-expanded.svelte | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/lib/components/event/event-links-expanded.svelte b/src/lib/components/event/event-links-expanded.svelte index 7d43df3b1..210562c6b 100644 --- a/src/lib/components/event/event-links-expanded.svelte +++ b/src/lib/components/event/event-links-expanded.svelte @@ -10,14 +10,10 @@ {#each links as link} {#if link?.workflowEvent} -
+
-
+
{/if} {/each} - -