Skip to content

Commit

Permalink
Decode workflow name
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkaseman committed Dec 1, 2024
1 parent f606d0c commit f0a1867
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
11 changes: 10 additions & 1 deletion core/services/workflows/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,16 @@ func (e *Engine) init(ctx context.Context) {
}
}

e.logger.Infof("engine initialized for %s", e.workflow.name)
var name string
if e.workflow != nil {
nameBytes, err := hex.DecodeString(e.workflow.name)

Check failure on line 357 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 357 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 357 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 357 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 357 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 357 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 357 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 357 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", e.workflow.name)

Check failure on line 359 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 359 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 359 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 359 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 359 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 359 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 359 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 359 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)
}
name = string(nameBytes[:])
}

e.logger.Infof("engine initialized for %s", 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: "mercury-trigger@1.0.0"
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 f0a1867

Please sign in to comment.