-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Log workflow name with engine starting for workflow #15291
base: develop
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
|
@@ -352,7 +352,16 @@ | |
} | ||
} | ||
|
||
e.logger.Info("engine initialized") | ||
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 GitHub Actions / Core Tests (go_core_race_tests)
Check failure on line 357 in core/services/workflows/engine.go GitHub Actions / Core Tests (go_core_fuzz)
Check failure on line 357 in core/services/workflows/engine.go GitHub Actions / Core Tests (go_core_ccip_deployment_tests)
Check failure on line 357 in core/services/workflows/engine.go GitHub Actions / lint
Check failure on line 357 in core/services/workflows/engine.go GitHub Actions / Core Tests (go_core_tests_integration)
Check failure on line 357 in core/services/workflows/engine.go GitHub Actions / Core Tests (go_core_tests)
Check failure on line 357 in core/services/workflows/engine.go GitHub Actions / split-amd64
|
||
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.
|
||
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 GitHub Actions / Core Tests (go_core_race_tests)
Check failure on line 359 in core/services/workflows/engine.go GitHub Actions / Core Tests (go_core_fuzz)
Check failure on line 359 in core/services/workflows/engine.go GitHub Actions / Core Tests (go_core_ccip_deployment_tests)
Check failure on line 359 in core/services/workflows/engine.go GitHub Actions / lint
Check failure on line 359 in core/services/workflows/engine.go GitHub Actions / Core Tests (go_core_tests_integration)
Check failure on line 359 in core/services/workflows/engine.go GitHub Actions / Core Tests (go_core_tests)
Check failure on line 359 in core/services/workflows/engine.go GitHub Actions / split-amd64
|
||
} | ||
name = string(nameBytes[:]) | ||
} | ||
|
||
e.logger.Infof("engine initialized for %s", name) | ||
logCustMsg(ctx, e.cma, "workflow registered", e.logger) | ||
e.afterInit(true) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,8 @@ import ( | |
|
||
const testWorkflowId = "<workflow-id>" | ||
const hardcodedWorkflow = ` | ||
name: "hcwf" | ||
|
||
triggers: | ||
- id: "[email protected]" | ||
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) | ||
|
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.
e.workflow.name is hex-encoded just fyi -- do you want to log the human readable version instead? (Accessible via cfg.WorkflowName)
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.
Yes! Thanks for catching that