-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
status: Fix status incompatibility introduced by #6919 and move non-regeneratable proto code into /testdata #7724
Changes from 6 commits
73e33f2
31d53ae
3b088a0
a0c3b84
25cf51e
8633ca3
7dd0e15
6009694
ecdbda8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2024 gRPC authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package grpc.testdata.grpc_testing_not_regenerate; | ||
|
||
option go_package = "google.golang.org/grpc/testdata/grpc_testing_not_regenerate"; | ||
|
||
// SimpleMessage is used to hold string data. | ||
message SimpleMessage { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel it is better to name the test message as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like "implementing the V1 API" is a property of the generated code and not the proto itself. There is a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I missed that. |
||
string data = 1; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this guaranteed to always be the case? (Does it matter?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. The V1 API is deprecated and is only present for backward compatibility. There is no guarantee that
protoc-gen-go
will always support it.protoadapt.MessageV1Of
will return a wrapped message which implements the V1 API when the argument doesn't implement it already. Callers will need to unwrap it using theprotoadapt.MessageV2Of
to get the inner type.This is why I updated the doc comment to say the following:
status.WithDetails
accepts only V1 messages. To pass it a V2 message, it will need to be wrapped andstatus.Details()
will return the same wrapped type.