Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
}
}

e.logger.Info("engine initialized")
Copy link
Contributor

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)

Copy link
Contributor Author

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

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.workflow.hexname now i believe

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: "[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
Loading