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

Add missing upstream string formatters #33857

Merged

Conversation

keithmattix
Copy link
Contributor

@keithmattix keithmattix commented Apr 30, 2024

%UPSTREAM_{PEER,LOCAL}_{URI,DNS,IP}_SAN% were not implemented; add them. Given that we're not too far from when v1.30 was cut, would it be possible to backport this to 1.30?

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution!
The change in source/common/formatter/stream_info_formatter.cc seems pretty large compared to what this PR should achieve. It seems to be mainly due to a format related change.
Can you make sure that the right formatting tools are used?
/wait

@adisuissa
Copy link
Contributor

Given that we're not too far from when v1.22 was cut, would it be possible to backport this to 1.30?

Do you want to backport to v1.30? If so, it is probably possible, and will require a subsequent PR to that release branch.

@adisuissa adisuissa self-assigned this Apr 30, 2024
@keithmattix
Copy link
Contributor Author

Do you want to backport to v1.30? If so, it is probably possible, and will require a subsequent PR to that release branch.

Sure, I'm happy to submit the 1.30 patch

@keithmattix
Copy link
Contributor Author

Thank you for this contribution! The change in source/common/formatter/stream_info_formatter.cc seems pretty large compared to what this PR should achieve. It seems to be mainly due to a format related change. Can you make sure that the right formatting tools are used? /wait

@adisuissa I'm running ./tools/local_fix_format.sh; is there another tool I should be using?

@adisuissa
Copy link
Contributor

_format

Can you please try running it using these instructions?

@cpakulski
Copy link
Contributor

Quick check why CI failed, and I see:

 [ RUN      ] SubstitutionFormatterTest.streamInfoFormatterWithSsl
                  test/common/formatter/substitution_formatter_test.cc:1861: Failure
                  Expected equality of these values:
                  "san"
                     Which is: 0x22d019
                  upstream_format.formatWithContext({}, stream_info)
                    Which is: (nullopt)

Can you locally run
bazel test //test/common/formatter:substitution_formatter_test

It should fail in your local env as well and should be straightforward to debug why it happens.

Copy link
Contributor

@cpakulski cpakulski left a comment

Choose a reason for hiding this comment

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

Please fix formatting.

source/common/formatter/stream_info_formatter.cc Outdated Show resolved Hide resolved
@keithmattix keithmattix force-pushed the stringformat/upstream-peer-uri-san branch from 9a74a55 to 21601e2 Compare May 13, 2024 15:59
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix keithmattix force-pushed the stringformat/upstream-peer-uri-san branch from 21601e2 to d3e0eb0 Compare May 13, 2024 19:23
@keithmattix
Copy link
Contributor Author

Looks like a flake in the udp tests?

/retest envoy-presubmit
/retest envoy-presubmit (Checks (Linux x64) Linux x64 compile_time_options)

@keithmattix
Copy link
Contributor Author

@cpakulski @adisuissa thanks for your patience on this review; still learning the ins and outs of the devtools. Formatting and tests should be good to go now!

Copy link
Contributor

@cpakulski cpakulski left a comment

Choose a reason for hiding this comment

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

Formattting is still an issue in source/common/formatter/stream_info_formatter.cc.

source/common/formatter/stream_info_formatter.cc Outdated Show resolved Hide resolved
@adisuissa
Copy link
Contributor

/wait

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

Thanks!
Mostly minor comments.
/wait

Copy link
Contributor

@cpakulski cpakulski left a comment

Choose a reason for hiding this comment

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

Looks good. Few minor comments.

test/common/formatter/substitution_formatter_test.cc Outdated Show resolved Hide resolved
test/common/formatter/substitution_formatter_test.cc Outdated Show resolved Hide resolved
test/common/formatter/substitution_formatter_test.cc Outdated Show resolved Hide resolved
test/common/formatter/substitution_formatter_test.cc Outdated Show resolved Hide resolved
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
adisuissa
adisuissa previously approved these changes May 17, 2024
Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!
/assign-from @envoyproxy/senior-maintainers

Copy link

@envoyproxy/senior-maintainers assignee is @zuercher

🐱

Caused by: a #33857 (review) was submitted by @adisuissa.

see: more, trace.

Copy link
Contributor

@cpakulski cpakulski left a comment

Choose a reason for hiding this comment

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

@keithmattix I think you should also update changelogs/current.yaml.

@keithmattix
Copy link
Contributor Author

@keithmattix I think you should also update changelogs/current.yaml.

Does it need to be something different than what I have here?

@cpakulski
Copy link
Contributor

Ah, sorry. I missed it. All good. Thanks!

@zuercher
Copy link
Member

Sorry this needs a merge. I'll try to keep a better eye on it and get it merged.

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix
Copy link
Contributor Author

No worries @zuercher - it should be caught up now

@keithmattix
Copy link
Contributor Author

/retest envoy-presubmit
/retest envoy-presubmit (Linux arm64 Build and test)

@zuercher zuercher added the backport/review Request to backport to stable releases label May 29, 2024
@zuercher zuercher merged commit 8ce7b46 into envoyproxy:main May 29, 2024
53 checks passed
@keithmattix keithmattix deleted the stringformat/upstream-peer-uri-san branch May 29, 2024 21:29
@keithmattix
Copy link
Contributor Author

FYI we found a way around this and don't need to backport

@zuercher zuercher removed the backport/review Request to backport to stable releases label May 30, 2024
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.

None yet

4 participants