-
Notifications
You must be signed in to change notification settings - Fork 149
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
chore!: update settings for Node 10 #1019
Conversation
b8db912
to
ead628f
Compare
Hm, this is completely busted. I will fix this later. |
build/ | ||
docs/ | ||
protos/ | ||
system-test/ |
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.
The tooling is gonna undo that. Any reason to explicitly ignore it?
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 should be from the tooling. I didn't make this change manually at least :)
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.
Hmmm, we don't do it in other libs. Example: https://github.com/googleapis/nodejs-text-to-speech/blob/master/.eslintignore
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 deleted this file and re-ran synthtool and it was recreated just like this.
@@ -98,6 +138,13 @@ | |||
1 | |||
) | |||
|
|||
os.rename("dev/.gitignore", ".gitignore") |
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 what all goes here, but this may be missing .prettierignore
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.
Added
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 take that back: That file doesn't exist:
FileNotFoundError: [Errno 2] No such file or directory: 'dev/.prettierignore' -> '.prettierignore'
I guess we should add this to our templates?
Codecov Report
@@ Coverage Diff @@
## node10 #1019 +/- ##
===========================================
+ Coverage 0.00% 98.54% +98.54%
===========================================
Files 25 25
Lines 16044 16614 +570
Branches 0 1258 +1258
===========================================
+ Hits 0 16372 +16372
+ Misses 16044 239 -15805
- Partials 0 3 +3
Continue to review full report at Codecov.
|
@alexander-fenster Can you sanity check the manual changes? |
.jsdoc.js
Outdated
includeDate: false, | ||
sourceFiles: false, | ||
systemName: '@google-cloud/firestore', | ||
systemName: 'firestore', |
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.
For this, you need to add "package-name": "@google-cloud/firestore"
to the generator arguments in synth.py
.
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.
Done (and this fixed the issue here)
dev/protos/update.sh
Outdated
"${PROTOS_DIR}/google/firestore/admin/v1/*.proto" \ | ||
"${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \ | ||
"${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto" \ | ||
"${PROTOS_DIR}/google/longrunning/*.proto" | ||
"${PBTS}" -o firestore_admin_v1_proto_api.d.ts firestore_admin_v1_proto_api.js | ||
|
||
"${PBJS}" "${PBJS_ARGS[@]}" -o firestore_v1beta1_proto_api.js \ | ||
-r firestore_v1beta1_v1 \ |
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.
Does not really affect anything but the name is weird. Maybe just 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.
Fixed
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listIndexesAsync( |
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.
FYI @schmidt-sebastian: we now support this :) for await (const index of client.listIndexesAsync(request))
- feel free to use this in your manual layer! (the same for any list* paginated 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.
Oh, awesome. Thanks for pointing this out. We should probably use expose this in our APIs that currently hide all paging, since we didn't want to use Streams or Callbacks as the primary way of interacting with our APIs.
@@ -5,7 +5,7 @@ | |||
"license": "Apache-2.0", | |||
"author": "Google Inc.", | |||
"engines": { | |||
"node": "^8.13.0 || >=10.10.0" | |||
"node": ">=10.10.0" |
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 so breaking. The title must be chore!
then :)
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. Note that the base branch has a !
already.
|
||
# Fix dropping of google-cloud-resource-header | ||
# See: https://github.com/googleapis/nodejs-firestore/pull/375 | ||
s.replace( | ||
"dev/src/v1beta1/firestore_client.ts", | ||
"return this\._innerApiCalls\.listen\(options\);", | ||
"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.
Every time I see this replacement I wonder what's wrong with the code here, why we need this replacement?
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 do think the generated code is busted here. We use options
to set an additional header, but the way this gets passed down here is as the request (if I remember this correctly). If we don't modify the code, the header is dropped. This only affects bidirectional streaming APIs with additional metadata, so probably just us. I do think we should fix this upstream at some point.
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.
OK, this sounds like a bug - filed googleapis/gapic-generator-typescript#425 and one of us will investigate.
Manual changes are somewhat scary :) A lot of changes are caused by the fact that the gapic code lives in (an alternative is to teach the generator how to place files into a separate location, but I can't estimate how hard it would 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.
Re: package structure. The main reason for our dev/ and build/ package structure is that it allows us to import the package.json in a consistent way. If I parsed the discussions on Yoshi chat correctly this also now works around a breakage in npm pack
, so I am not super keen on changing this :)
.jsdoc.js
Outdated
includeDate: false, | ||
sourceFiles: false, | ||
systemName: '@google-cloud/firestore', | ||
systemName: 'firestore', |
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.
Done (and this fixed the issue here)
@@ -5,7 +5,7 @@ | |||
"license": "Apache-2.0", | |||
"author": "Google Inc.", | |||
"engines": { | |||
"node": "^8.13.0 || >=10.10.0" | |||
"node": ">=10.10.0" |
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. Note that the base branch has a !
already.
build/ | ||
docs/ | ||
protos/ | ||
system-test/ |
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 deleted this file and re-ran synthtool and it was recreated just like this.
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listIndexesAsync( |
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.
Oh, awesome. Thanks for pointing this out. We should probably use expose this in our APIs that currently hide all paging, since we didn't want to use Streams or Callbacks as the primary way of interacting with our APIs.
dev/protos/update.sh
Outdated
"${PROTOS_DIR}/google/firestore/admin/v1/*.proto" \ | ||
"${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \ | ||
"${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto" \ | ||
"${PROTOS_DIR}/google/longrunning/*.proto" | ||
"${PBTS}" -o firestore_admin_v1_proto_api.d.ts firestore_admin_v1_proto_api.js | ||
|
||
"${PBJS}" "${PBJS_ARGS[@]}" -o firestore_v1beta1_proto_api.js \ | ||
-r firestore_v1beta1_v1 \ |
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.
Fixed
|
||
# Fix dropping of google-cloud-resource-header | ||
# See: https://github.com/googleapis/nodejs-firestore/pull/375 | ||
s.replace( | ||
"dev/src/v1beta1/firestore_client.ts", | ||
"return this\._innerApiCalls\.listen\(options\);", | ||
"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.
I do think the generated code is busted here. We use options
to set an additional header, but the way this gets passed down here is as the request (if I remember this correctly). If we don't modify the code, the header is dropped. This only affects bidirectional streaming APIs with additional metadata, so probably just us. I do think we should fix this upstream at some point.
* fix!: mark v1beta1 client as deprecated (#937) * feat!: use QueryDocumentSnapshot in FirestoreDataConverter (#965) * deps: update to gts 2.x (#1013) * chore!: update settings for Node 10 (#1019) * deps: drop through2 (#1014) * feat: support BigInt (#1016) * fix: make update.sh work on Linux (#1043) * fix: only use BigInt in BigInt system test (#1044) * fix: make pbjs compile admin proto again (#1045) * Add BulkWriter (#1055) * docs: Add documentation for FirestoreDataConverter (#1059) * chore: enforce return types (#1065) * fix: add generic to Firestore.getAll() (#1066) * chore: remove internal WriteOp (#1067) * chore: add linter checks for it|describe.only (#1068) * fix: handle terminate in BulkWriter (#1070) * chore: run template copying last in synthtool (#1071) * feat: Firestore Bundles implementation (#1078) * feat: add support for set() with SetOptions when using FirestoreDataConverter (#1087) * feat: Add totalDocuments and totalBytes to bundle metadata. (#1085) * feat: Add totalDocuments and totalBytes to bundle metadata. * fix: Better comment * fix: Better testing. * fix: Improve metadata testing. * fix: incomplete expect in rate-limiter test (#1092) * Remove BatchWrite proto, fix conformance tests * chore: use public API types internally (#1100) * feat: add Partition and BatchWrite protos (#1110) * fix: remove GCF transaction fallback (#1112) * fix: add BulkWriter integration tests, java backport changes, delete fix (#1117) * chore: merge master (#1218) * chore: add eslint check for console.log statements (#1229) * fix: another attempt at fixing the flaky BulkWriter test (#1228) * Fix comment * Renames * Test fix * Fix unit tests Co-authored-by: Brian Chen <[email protected]> Co-authored-by: wu-hui <[email protected]>
This PR updates the synth.py script to work with the new format/tooling brought by the Node 10 migration.
Manual changes are in synth.py and dev/protos/update.sh to enable namespacing and add
toObject
andfromObject
(which is needed for the generated unit tests and unfortunately adds a lot of code - maybe we can find a way to remove this code in a follow up).