-
Notifications
You must be signed in to change notification settings - Fork 87
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!: use @grpc/grpc-js instead of grpc #484
Conversation
Something wrong with authentication - investigating... |
Codecov Report
@@ Coverage Diff @@
## master #484 +/- ##
=========================================
- Coverage 82.43% 82.4% -0.04%
=========================================
Files 50 50
Lines 3439 3416 -23
Branches 266 262 -4
=========================================
- Hits 2835 2815 -20
+ Misses 539 537 -2
+ Partials 65 64 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #484 +/- ##
==========================================
- Coverage 82.43% 82.38% -0.06%
==========================================
Files 50 50
Lines 3439 3417 -22
Branches 266 262 -4
==========================================
- Hits 2835 2815 -20
+ Misses 539 538 -1
+ Partials 65 64 -1
Continue to review full report at Codecov.
|
So, the authentication problem is caused by incorrect service account key (which just stopped working for some reason). I think at this point it's OK to remove the client library test (pub/sub, video intelligence, and speech), since we have an end-to-end test with a local gRPC server and it's much less fragile. When we are done will all these upgrades and semver major releases, we can put the client library system test back, but right now it will just prevent us from doing releases. |
src/grpc.ts
Outdated
|
||
export interface ClientStubOptions { | ||
servicePath: string; | ||
port: number; | ||
sslCreds?: grpcTypes.ChannelCredentials; | ||
// @ts-ignore waiting for grpc-js types |
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 understand why this is necessary. Should sslCreds
just be any
until we can fix things?
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.
Changed to any
!
src/grpc.ts
Outdated
const errorMessage = | ||
'To use @grpc/grpc-js you must run your code on Node.js v8.13.0 or newer. Please see README if you need to use an older version. ' + | ||
'https://github.com/googleapis/gax-nodejs/blob/master/README.md'; | ||
console.error(errorMessage); |
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 we need to write to the console if we're throwing, do we?
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 just wanted to communicate the error in all the ways possible :)
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 agree with Justin, throw is probably sufficient, as it will end up in stderr
and output essentially the same message (but with stack trace).
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.
Removed console.error
.
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
import * as execa from 'execa'; |
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.
removing this as part of this PR makes me uncomfortable and nervous 😨
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 feel the same, but this kind of testing works great for minor changes but not for breaking changes. We have a full feature coverage through the end-to-end test (the one that runs local gRPC server), and also we'll only release it as a semver major so we'll have enough time to make sure client libraries work.
I promise I'll put this back when we are done with these huge changes :)
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 looks great to me, I'm really excited to be dropping node-gyp
dependencies.
src/grpc.ts
Outdated
const errorMessage = | ||
'To use @grpc/grpc-js you must run your code on Node.js v8.13.0 or newer. Please see README if you need to use an older version. ' + | ||
'https://github.com/googleapis/gax-nodejs/blob/master/README.md'; | ||
console.error(errorMessage); |
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 agree with Justin, throw is probably sufficient, as it will end up in stderr
and output essentially the same message (but with stack trace).
@@ -15,13 +15,7 @@ | |||
'use strict'; | |||
|
|||
const assert = require('assert'); | |||
|
|||
let grpc; |
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.
seems like this update eliminates a lot of cruft.
BREAKING CHANGE
Make all client libraries use @grpc/grpc-js by default. The libraries that still want to use legacy grpc should pass the instance of
grpc
to client library constructor.