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

Reorder proto validation error message #38089

Merged
merged 2 commits into from
Jan 21, 2025
Merged

Conversation

ravenblackx
Copy link
Contributor

@ravenblackx ravenblackx commented Jan 17, 2025

Commit Message: Reorder proto validation error message
Additional Description: As discussed in #38064, the error message is currently often hard to interpret due to the ordering being "high-level low-level high-level" rather than the usual high-to-low ordering error messages have, leading to confusing adjacencies. This is a minimal reordering that doesn't break tests and makes the error message easier to read, for example

Proto constraint validation failed (HttpProtocolOptionsValidationError.ExplicitHttpConfig: embedded message failed validation | caused by field: "protocol_config", reason: is required): explicit_http_config

becomes

explicit_http_config: Proto constraint validation failed (HttpProtocolOptionsValidationError.ExplicitHttpConfig: embedded message failed validation | caused by field: "protocol_config", reason: is required)

Risk Level: Very low it's just an error string.
Testing: Existing tests still pass.
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

adisuissa
adisuissa previously approved these changes Jan 17, 2025
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!

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!

@ravenblackx ravenblackx merged commit 6fea4d7 into envoyproxy:main Jan 21, 2025
25 checks passed
@ravenblackx ravenblackx deleted the errmsgs branch January 21, 2025 20:56
bazmurphy pushed a commit to bazmurphy/envoy that referenced this pull request Jan 29, 2025
Commit Message: Reorder proto validation error message
Additional Description: As discussed in envoyproxy#38064, the error message is
currently often hard to interpret due to the ordering being "high-level
low-level high-level" rather than the usual high-to-low ordering error
messages have, leading to confusing adjacencies. This is a minimal
reordering that doesn't break tests and makes the error message easier
to read, for example

`Proto constraint validation failed
(HttpProtocolOptionsValidationError.ExplicitHttpConfig: embedded message
failed validation | caused by field: "protocol_config", reason: is
required): explicit_http_config`

becomes

`explicit_http_config: Proto constraint validation failed
(HttpProtocolOptionsValidationError.ExplicitHttpConfig: embedded message
failed validation | caused by field: "protocol_config", reason: is
required)`

Risk Level: Very low it's just an error string.
Testing: Existing tests still pass.
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

---------

Signed-off-by: Raven Black <[email protected]>
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