From 5fa4d9bd8cbee3024629210166b1e1a7c4e2530d Mon Sep 17 00:00:00 2001 From: Justin Kaseman Date: Fri, 29 Nov 2024 15:36:14 -0800 Subject: [PATCH] Decode workflow name --- core/services/workflows/engine.go | 7 ++++++- core/services/workflows/engine_test.go | 16 ++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index 9ab8284cf78..f98c430d4e9 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -352,7 +352,12 @@ func (e *Engine) init(ctx context.Context) { } } - e.logger.Infof("engine initialized for %s", e.workflow.name) + name, err := hex.DecodeString(e.workflow.name) + if err != nil { + e.logger.Errorf("failed to decode workflow name: %s", string(name[:])) + } + + e.logger.Infof("engine initialized for %s", string(name[:])) logCustMsg(ctx, e.cma, "workflow registered", e.logger) e.afterInit(true) } diff --git a/core/services/workflows/engine_test.go b/core/services/workflows/engine_test.go index 3a2bc17bc36..f976b4bf0a9 100644 --- a/core/services/workflows/engine_test.go +++ b/core/services/workflows/engine_test.go @@ -41,6 +41,8 @@ import ( const testWorkflowId = "" const hardcodedWorkflow = ` +name: "hcwf" + triggers: - id: "mercury-trigger@1.0.0" config: @@ -165,12 +167,14 @@ func newTestEngine(t *testing.T, reg *coreCap.Registry, sdkSpec sdk.WorkflowSpec reg.SetLocalRegistry(&testConfigProvider{}) cfg := Config{ - WorkflowID: testWorkflowId, - Lggr: logger.TestLogger(t), - Registry: reg, - Workflow: sdkSpec, - maxRetries: 1, - retryMs: 100, + WorkflowID: testWorkflowId, + WorkflowName: sdkSpec.Name, + WorkflowOwner: sdkSpec.Owner, + Lggr: logger.TestLogger(t), + Registry: reg, + Workflow: sdkSpec, + maxRetries: 1, + retryMs: 100, afterInit: func(success bool) { if success { close(initSuccessful)