-
Notifications
You must be signed in to change notification settings - Fork 150
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
feat!: convert Gapic client to TypeScript #805
Conversation
f6e2c7f
to
21f773f
Compare
"total_timeout_millis": 600000 | ||
} | ||
}, | ||
"methods": { | ||
"GetDocument": { | ||
"timeout_millis": 60000, | ||
"retry_codes_name": "idempotent", | ||
"retry_codes_name": "d_e_a_d_l_i_n_e_e_x_c_e_e_d_e_d_i_n_t_e_r_n_a_l_u_n_a_v_a_i_l_a_b_l_e", |
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.
This is a scary auto-generated name, looks like a bug - I'll figure out
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.
:)
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.
@@ -1,17 +1,3 @@ | |||
// Copyright 2019 Google LLC |
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.
Was the license added manually? I just used the update script.
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.
No. I wonder if it was added later when we migrated to the new Copyright header?
@@ -50,6 +50,14 @@ mkdir -p "${PROTOS_DIR}/google/firestore/v1" | |||
cp googleapis/google/firestore/v1/*.proto \ | |||
"${PROTOS_DIR}/google/firestore/v1/" | |||
|
|||
mkdir -p "${PROTOS_DIR}/google/firestore/v1beta1" |
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.
Now we need all the protos there.
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.
YAY! Getting close to .close()
.
Thank you so much.
@@ -1,17 +1,3 @@ | |||
// Copyright 2019 Google LLC |
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.
No. I wonder if it was added later when we migrated to the new Copyright header?
}, | ||
"nested": { | ||
"Index": { |
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.
Again, would the clients load faster if we split Admin/Non-Admin Protos?
const version = require('../../../package.json').version; | ||
|
||
/** | ||
* Operations are created by service `FirestoreAdmin`, but are accessed via |
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.
Nit: Leading spaces.
it('has apiEndpoint', () => { | ||
const apiEndpoint = firestoreModule.v1.FirestoreClient.apiEndpoint; | ||
assert(apiEndpoint); | ||
}); | ||
|
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.
Nit: Keep empty lines (again, don't fix before merging)
|
||
'use strict'; |
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.
It would be interesting to know if the old system tests pass against the new client. Did you test that by any chance?
|
||
# Fix dropping of google-cloud-resource-header | ||
# See: https://github.com/googleapis/nodejs-firestore/pull/375 | ||
s.replace( | ||
"dev/src/v1beta1/firestore_client.js", | ||
"dev/src/v1beta1/firestore_client.ts", | ||
"return this\._innerApiCalls\.listen\(options\);", | ||
"return this._innerApiCalls.listen({}, options);", |
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 still needed (or rather: does the original bug still exist in the TS generated client?). It would seem that this should now be caught by the type system.
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.
Thanks @schmidt-sebastian - I'll make more changes on Friday :)
We need to also include the field_definition and client protos
Codecov Report
@@ Coverage Diff @@
## master #805 +/- ##
===========================================
+ Coverage 74.24% 90.36% +16.12%
===========================================
Files 50 25 -25
Lines 2904 2814 -90
Branches 462 707 +245
===========================================
+ Hits 2156 2543 +387
+ Misses 695 118 -577
- Partials 53 153 +100
Continue to review full report at Codecov.
|
The system tests should pass once googleapis/gapic-generator-typescript#173 is merged and released. |
I'm guessing we first need to update |
Re-ran synthool and pushed changes. The only remaining blockers (in my opinion) are the setting for initial_rpc_timeout_millis and max_rpc_timeout_millis. Should we drop them? |
Updated all the dependencies since the CI requires a newer version of |
Dropping of I think we are good to go here! I suggest we treat this PR as a breaking change just in case (feel free to merge the PR then), otherwise, if you think it's just a minor, remove Upd. The parameters are actually used but will be dropped soon. |
googleapis/gapic-generator-typescript#175 will reset the parameters to 60000. We can merge now (this change will come within a nightly synthtool run) or wait for this change to make its way into the Docker image (will happen on Monday). |
This PR is linked in the v3.0.0 release notes as a breaking change. Is there anything that users of this library need to change to stay compliant? It looks mostly internal as far as I can tell. |
We bumped the major version because of the risk with this PR. We are not aware of any specific breakages. |
Converting the auto-generated parts of the library to TypeScript using the new https://github.com/googleapis/gapic-generator-typescript.