-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(hc): Replace RPC methods with tuples as return types #67320
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
Conversation
PR for Step 1: #67321 |
@@ -128,8 +129,6 @@ def get_organization_integration( | |||
) | |||
return ois[0] if len(ois) > 0 else None | |||
|
|||
@rpc_method |
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.
We can avoid changing the return type by making it no longer an @rpc_method
. That's a good way to go, because otherwise we would have to add yet another single-case model class.
However, removing the @rpc_method
decorator is as much a breaking change as changing the return type, because it will no longer respond to requests from concurrently-running clients. So, it gets the same swapping procedure as the other methods.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #67320 +/- ##
==========================================
- Coverage 84.33% 84.33% -0.01%
==========================================
Files 5309 5309
Lines 237230 237249 +19
Branches 41029 41026 -3
==========================================
+ Hits 200073 200082 +9
- Misses 36939 36949 +10
Partials 218 218
|
I've discovered four more methods that will need breaking changes.
I'm thinking I'll try to roll them into this set of changes before proceeding. |
Replaced by #68345 |
The ultimate goal here is to replace all RPC methods that have a fixed-length tuple as a return type. The motive is to be able to represent those return types in an OpenAPI schema, for consumption by tools that will automatically detect breaking changes. Although constant-size tuples are supported under Pydantic for purposes of serialization, OpenAPI does not let us represent a logical type by constraining an array length (nor to specify a type at each array index).
These return type changes are breaking on production. (See prior discussion at #67027. Thanks @markstory.) This PR (which I intend to leave in draft status indefinitely) contains the five steps that we must take in order to avoid any production errors, assuming that each step is fully rolled out before the next starts. Those steps are represented in the first five commits in the branch (plus any fixups that I might have added by the time you read this).
I plan to make a one new PR at a time for each of those steps. I invite review of the entire plan on this PR.