-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Documentation and behavior don't match, for HttpProtocolOptions::explicit_http_config #38064
Comments
@alyssawilk maybe? |
Or @yanavlasov and @adisuissa as the configuration people. |
The validation error is somewhat strange, as it is not the IIUC #14362 made the oneof required, which implies that the doc-string is no longer valid. |
It's definitely not the most readable error, but this interpretation isn't what's being complained about either - it's the (i.e. the error message is about this one, vs. you're talking about this one - they were both added in the same PR though.) |
The error message would be clearer by rephrasing so that e.g. |
I agree that the error message is misleading. |
I think I misunderstood the error. Would it be possible to add the config that causes the issue? |
Looks like the reordering I suggested could be just here and here, but it would break a lot of test expectations. Putting the thing right at the start of the message (i.e. It's awkward for me to show configs because we do it all through generators so it's not yaml, but essentially the problem here is any HttpProtocolOptions message like
which should be accepted per the current docs, but now has to be (for equivalent behavior to what one would expect from the above)
(Forgive yaml syntax errors, I don't do much yaml, not sure of the empty-message syntax off the top of my head.) |
Oh, I see why you thought it was the outer one, because the docstring is not super clear either.
I believe this is saying if explicit_http_config is set, but to an empty message, which is the case I had with the unexpected error. The alternative interpretation, if it's not set, is also an error if the other nearby oneof options are also not set, but I don't think that's the case the docstring was referring to. Either way though this fragment of docstring became outdated with #14362. :) |
Commit Message: Remove incorrect/outdated doc for explicit_http_config Additional Description: Per #38064, this docstring became incorrect with #14362 so should be removed. Risk Level: None, doc-only. Testing: n/a Docs Changes: Yes it is. Release Notes: n/a Platform Specific Features: n/a Signed-off-by: Raven Black <[email protected]>
) Commit Message: Remove incorrect/outdated doc for explicit_http_config Additional Description: Per envoyproxy#38064, this docstring became incorrect with envoyproxy#14362 so should be removed. Risk Level: None, doc-only. Testing: n/a Docs Changes: Yes it is. Release Notes: n/a Platform Specific Features: n/a Signed-off-by: Raven Black <[email protected]> Signed-off-by: Sheldon <[email protected]>
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 --------- Signed-off-by: Raven Black <[email protected]>
) Commit Message: Remove incorrect/outdated doc for explicit_http_config Additional Description: Per envoyproxy#38064, this docstring became incorrect with envoyproxy#14362 so should be removed. Risk Level: None, doc-only. Testing: n/a Docs Changes: Yes it is. Release Notes: n/a Platform Specific Features: n/a Signed-off-by: Raven Black <[email protected]>
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]>
envoy/api/envoy/extensions/upstreams/http/v3/http_protocol_options.proto
Lines 142 to 143 in d34e163
Actual behavior if
explicit_http_config
is empty:Proto constraint validation failed (HttpProtocolOptionsValidationError.ExplicitHttpConfig: embedded message failed validation | caused by field: "protocol_config", reason: is required): explicit_http_config
The text was updated successfully, but these errors were encountered: