GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(storage): support gs:// copy/move dests by zbjornson · Pull Request #1416 · googleapis/google-cloud-node Conversation
Contributor
Fixes #1395 -- supports gs:// strings for specifying destination buckets. I'm not totally thrilled with what I did on line 391 but I don't see a better way to create a new Bucket instance from File.js. The string format testing with
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
LGTM. Would you mind adding a system test? You can add one after this, "it should copy an existing file with a GS URL" (or something similar) If you haven't run the system tests before, we have a guide on setting the right env vars: https://github.com/GoogleCloudPlatform/gcloud-node/blob/master/CONTRIBUTING.md#system-tests Also, running the test will create a bucket and file under your account (then delete them), so it's understandable if you'd rather not run the tests. If you do, make sure you change the test you're working on to read: it.only('...', function() {}) The |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Coverage remained the same at 100.0% when pulling 0e8cf7b on zbjornson:1395-gs-urls into 0a6da60 on GoogleCloudPlatform:master. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for your review. On the system test, how would you like to handle file/bucket cleanup? You have a special Also, is it unnecessary to assert on the contents of the other bucket? it.only('should copy to another bucket given a gs:// URL', function(done) { var opts = { destination: 'CloudLogo' }; bucket.upload(FILES.logo.path, opts, function(err, file) { assert.ifError(err); var otherBucket = storage.bucket(generateName()); otherBucket.create(function (err) { assert.ifError(err); var destPath = 'gs://' + otherBucket.name + '/CloudLogoCopy'; file.copy(destPath, function(err, copiedFile) { assert.ifError(err); otherBucket.getFiles(function (err, files) { // Necessary? >> assert.ifError(err); assert.equal(files.length, 1); var newFile = files[0]; assert.equal(newFile.name, "CloudLogoCopy"); // << Necessary? async.parallel([ file.delete.bind(file), newFile.delete.bind(newFile), otherBucket.delete.bind(otherBucket) // Needs eventual consistency protection ], done); }); }); }); }); }); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
For bucket cleanup, you can let the And I like that you're checking that the new bucket received the file 👍 I'll just have some linting notes, but LGTM. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| destName = destination; | ||
| var parsedDestination = GS_URL_REGEXP.exec(destination); | ||
| if (parsedDestination !== null && parsedDestination.length === 3) { | ||
| destBucket = this.storage.bucket(parsedDestination[1]) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry about all that, my linter apparently decided to retire. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| assert.strictEqual(files.length, 1); | ||
| var newFile = files[0]; | ||
|
|
||
| assert.equal(newFile.name, 'CloudLogoCopy'); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Haha, I'm sorry that I have to even comment on this little stuff. I wish it could just be auto-formatted. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Squashed together... managed to swamp travis though 😢 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
No problem. I canceled the queued, old builds. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Coverage remained the same at 100.0% when pulling d387283 on zbjornson:1395-gs-urls into 4bce495 on GoogleCloudPlatform:master. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Perfect! We intend to get a release out shortly with support for Bigtable (currently held up on #1424), so this will ship with that. Thanks very much :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
🤖 I have created a release *beep* *boop* --- ## [3.5.5](https://togithub.com/googleapis/gax-nodejs/compare/v3.5.4...v3.5.5) (2023-02-03) ### Bug Fixes * **deps:** Update dependency @grpc/grpc-js to ~1.8.0 ([#1389](https://togithub.com/googleapis/gax-nodejs/issues/1389)) ([41ad17a](https://togithub.com/googleapis/gax-nodejs/commit/41ad17a0cc94388417704f929e56fe56498319f5)) * **deps:** Update dependency protobufjs to v7.2.1 ([#1411](https://togithub.com/googleapis/gax-nodejs/issues/1411)) ([17c7372](https://togithub.com/googleapis/gax-nodejs/commit/17c7372a0601736227898495ad10fc61907667f8)) * Get rid of fs-extra ([#1418](https://togithub.com/googleapis/gax-nodejs/issues/1418)) ([082e006](https://togithub.com/googleapis/gax-nodejs/commit/082e0063227d8f59a9c88416265fdf4acafe8f6f)) * Include Long import in d.ts files ([#1379](https://togithub.com/googleapis/gax-nodejs/issues/1379)) ([8d9d684](https://togithub.com/googleapis/gax-nodejs/commit/8d9d6847ff6ee3de4ba4aed8540045cdc9bc6b64)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
* chore(main): release 10.1.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Adds a close method to the Spanner client that will (try to) clean up the resources it has in use. Towards #1306
🤖 I have created a release \*beep\* \*boop\* --- ### [5.11.1](https://www.github.com/googleapis/nodejs-spanner/compare/v5.11.0...v5.11.1) (2021-07-07) ### Bug Fixes * add close method to Spanner client ([#1416](https://www.github.com/googleapis/nodejs-spanner/issues/1416)) ([69cd0b4](https://www.github.com/googleapis/nodejs-spanner/commit/69cd0b474ab6c836724813fd8bea88ec2e1ac9f5)), closes [#1306](https://www.github.com/googleapis/nodejs-spanner/issues/1306) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
* feat: Log Analytics features of the Cloud Logging API feat: Add ConfigServiceV2.CreateBucketAsync method for creating Log Buckets asynchronously feat: Add ConfigServiceV2.UpdateBucketAsync method for creating Log Buckets asynchronously feat: Add ConfigServiceV2.CreateLink method for creating linked datasets for Log Analytics Buckets feat: Add ConfigServiceV2.DeleteLink method for deleting linked datasets feat: Add ConfigServiceV2.ListLinks method for listing linked datasets feat: Add ConfigServiceV2.GetLink methods for describing linked datasets feat: Add LogBucket.analytics_enabled field that specifies whether Log Bucket's Analytics features are enabled feat: Add LogBucket.index_configs field that contains a list of Log Bucket's indexed fields and related configuration data docs: Documentation for the Log Analytics features of the Cloud Logging API PiperOrigin-RevId: 529851525 Source-Link: googleapis/googleapis@1c7ee99 Source-Link: googleapis/googleapis-gen@4a2a3a0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGEyYTNhMDViOTE4MDQzMzNhMWIzOWI2MzVkOGZlMjI0M2Q0YjRmZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: losalex <[email protected]>
Co-authored-by: Justin Beckwith <[email protected]>
* docs(samples): standardize samples * revert package.json * update sample var decl descriptions * split duplicate example titles * lint fix * encrypt keys locally * test encryption key handling * lint fix * pass key as string * revert the way keys are used Co-authored-by: Sameena Shaffeeullah <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.