-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Check in Cloud Job Discovery quick start #684
Conversation
I saw the other team writing the test using 'ava'. Could we use 'mocha' instead? |
Codecov Report
@@ Coverage Diff @@
## master #684 +/- ##
=======================================
Coverage 48.52% 48.52%
=======================================
Files 1 1
Lines 68 68
=======================================
Hits 33 33
Misses 35 35 Continue to review full report at Codecov.
|
IIRC we use Ava since it supports parallel test running - @jmdobry can confirm. |
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.
Mostly LGTM, but with a few nits.
I'll be OOO next week, so @happyhuman / @fhinkel can take it from here.
|
||
# Google Cloud Job Discovery API Samples | ||
|
||
Cloud Job Discovery is part of Google for Jobs - a Google-wide commitment to help |
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 this autogenerated using repo-tools generate
? If not, it should be.
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.
Do you mean the README should be generated from repo-tools generate?
Current README is written by myself. Should I remove it then run repo-tools generate?
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.
generate: Generating lib_readme in: /usr/local/google/home/xinyunh/githubCode/nodeJsPersonalFork/nodejs-docs-samples/jobs/cjd_sample
generate: Compiling: /usr/local/google/home/xinyunh/githubCode/nodeJsPersonalFork/nodejs-docs-samples/jobs/cjd_sample/README.md
generate: Failed to generate: /usr/local/google/home/xinyunh/githubCode/nodeJsPersonalFork/nodejs-docs-samples/jobs/cjd_sample/README.md
generate: Oh no! Generating failed after 0.0230s.
generate: TypeError: Cannot read property 'toUpperCase' of undefined
at Object.exports.createReleaseQualityBadge (/usr/lib/node_modules/@google-cloud/nodejs-repo-tools/cjs/utils/index.js:222:35)
at Object.eval [as main] (eval at createFunctionContext (/usr/lib/node_modules/@google-cloud/nodejs-repo-tools/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), :12:88)
at main (/usr/lib/node_modules/@google-cloud/nodejs-repo-tools/node_modules/handlebars/dist/cjs/handlebars/runtime.js:175:32)
at ret (/usr/lib/node_modules/@google-cloud/nodejs-repo-tools/node_modules/handlebars/dist/cjs/handlebars/runtime.js:178:12)
at ret (/usr/lib/node_modules/@google-cloud/nodejs-repo-tools/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:526:21)
at /usr/lib/node_modules/@google-cloud/nodejs-repo-tools/cjs/cli/commands/generate.js:276:46
at Array.forEach ()
at Object.exports.handler (/usr/lib/node_modules/@google-cloud/nodejs-repo-tools/cjs/cli/commands/generate.js:238:16)
at Object.runCommand (/usr/lib/node_modules/@google-cloud/nodejs-repo-tools/node_modules/yargs/lib/command.js:235:44)
at Object.parseArgs [as _parseArgs] (/usr/lib/node_modules/@google-cloud/nodejs-repo-tools/node_modules/yargs/yargs.js:1014:30)
// [START quickstart] | ||
|
||
// Imports the Google APIs client library | ||
const {google} = require('googleapis'); |
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.
Do we have a client library specifically for this, as opposed to googleapis
? (Paging @theacodes)
jobs/cjd_sample/quickstart.js
Outdated
return; | ||
} | ||
|
||
console.log('Request ID: ' + result.data.metadata.requestId); |
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.
Two nits:
- Use promises
- Use template strings
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.
Sorry, I am not too familiar with nodeJs. How could I use promise in this case?
jobs/cjd_sample/quickstart.js
Outdated
@@ -0,0 +1,62 @@ | |||
/** | |||
* Copyright 2017, Google, Inc. |
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.
- LLC instead of Inc.
return; | ||
} | ||
|
||
if (authClient.createScopedRequired && authClient.createScopedRequired()) { |
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 am not familiar with authClient object. Does it have a field and a method both named createScopedRequired? Is it needed to check both of them?
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.
Not sure. I just the follow the same way 'kms' did in their samples for authentication.
@@ -0,0 +1,24 @@ | |||
/** | |||
* Copyright 2017, Google, Inc. |
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.
2018 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.
LGTM, assuming the comments made by other reviewers are addressed as well.
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
CJD got Public beta launch so we would like to have our samples checked in as other projects.