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

[CLI] fix incorrect propagation of span context in start workflow #6363

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

shijiesheng
Copy link
Member

What changed?

  • Use Tracer inject API to correctly pass span context

Why?

Simply passing baggage key/values won't work.

How did you test it?

Unit test

Potential risks

Release notes

Documentation Changes

@@ -526,12 +526,15 @@ func processHeader(c *cli.Context) (map[string][]byte, error) {
headers := mapFromKeysValues(headerKeys, headerValues)
// append context headers if exist
if span := opentracing.SpanFromContext(c.Context); span != nil && span.Context() != nil {
span.Context().ForeachBaggageItem(func(k, v string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

how did you find out this doesn't work? Does the unit test change cover it?

Copy link
Member Author

Choose a reason for hiding this comment

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

When I test with internal tracer, I realize the headers key doesn't match. Now the unit test coverage covered it. (prefix mockpfx-baggage-)

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.87%. Comparing base (084464e) to head (c49bd26).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
tools/cli/workflow_commands.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
tools/cli/workflow_commands.go 32.82% <50.00%> (-0.04%) ⬇️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 084464e...c49bd26. Read the comment docs.

@shijiesheng shijiesheng merged commit 473ccf1 into cadence-workflow:master Oct 15, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants