Skip to content

Commit

Permalink
Decode workflow name
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkaseman committed Nov 29, 2024
1 parent f606d0c commit 5fa4d9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
7 changes: 6 additions & 1 deletion core/services/workflows/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check failure on line 355 in core/services/workflows/engine.go

View workflow job for this annotation

GitHub Actions / Core Tests (go_core_tests_integration)

e.workflow.name undefined (type *workflow has no field or method name)

Check failure on line 355 in core/services/workflows/engine.go

View workflow job for this annotation

GitHub Actions / Core Tests (go_core_ccip_deployment_tests)

e.workflow.name undefined (type *workflow has no field or method name)

Check failure on line 355 in core/services/workflows/engine.go

View workflow job for this annotation

GitHub Actions / Core Tests (go_core_race_tests)

e.workflow.name undefined (type *workflow has no field or method name)

Check failure on line 355 in core/services/workflows/engine.go

View workflow job for this annotation

GitHub Actions / Core Tests (go_core_tests)

e.workflow.name undefined (type *workflow has no field or method name)

Check failure on line 355 in core/services/workflows/engine.go

View workflow job for this annotation

GitHub Actions / lint

e.workflow.name undefined (type *workflow has no field or method name)

Check failure on line 355 in core/services/workflows/engine.go

View workflow job for this annotation

GitHub Actions / Core Tests (go_core_fuzz)

e.workflow.name undefined (type *workflow has no field or method name)

Check failure on line 355 in core/services/workflows/engine.go

View workflow job for this annotation

GitHub Actions / split-amd64

e.workflow.name undefined (type *workflow has no field or method name)

Check failure on line 355 in core/services/workflows/engine.go

View workflow job for this annotation

GitHub Actions / split-arm64

e.workflow.name undefined (type *workflow has no field or method 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)
}
Expand Down
16 changes: 10 additions & 6 deletions core/services/workflows/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import (

const testWorkflowId = "<workflow-id>"
const hardcodedWorkflow = `
name: "hcwf"
triggers:
- id: "[email protected]"
config:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5fa4d9b

Please sign in to comment.