Skip to content
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

Simplify Storage samples and their tests. #225

Merged
merged 1 commit into from
Oct 3, 2016
Merged

Simplify Storage samples and their tests. #225

merged 1 commit into from
Oct 3, 2016

Conversation

jmdobry
Copy link
Member

@jmdobry jmdobry commented Sep 30, 2016

  • - Using ES2015 (string templates, const, let, and arrow functions
  • - Unit tests are now really small (they only test the error cases)
  • - System tests now exercise the CLI of the samples
  • - Achieved 100% code coverage for files.js, buckets.js, acl.js, and encryption.js
  • - Samples were updated to follow latest sample usability guidelines

I left the Storage Transfer API samples alone. I don't want to mess with them until the google-cloud-node has support for the Storage Transfer API.

Copy link
Contributor

@ace-n ace-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, other than a few minor nits.

@@ -11,162 +11,284 @@
// See the License for the specific language governing permissions and
// limitations under the License.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultra-nit: update LICENSE to use block comments? (That's what #226 does.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -175,45 +297,49 @@ var program = module.exports = {

cli
.demand(1)
.command('add <entity> <role>', 'Add access controls on a bucket or file.', {}, function (options) {
program.addAccessControl(utils.pick(options, ['entity', 'role', 'bucket', 'default', 'file']), utils.makeHandler());
.command(`print-bucket-acl <bucketName>`, `Prints the ACL for a bucket.`, {}, (opts) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this is a fairly long command - what about print-acl instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this from the python sample. I figure it was better to be consistent.

.example(`node $0 generate-encryption-key`, `Generate a sample encryption key.`)
.example(`node $0 upload my-bucket ./resources/test.txt file_encrypted.txt QxhqaZEqBGVTW55HhQw9Q=`, `Encrypts and uploads "resources/test.txt" to "gs://my-bucket/file_encrypted.txt".`)
.example(`node $0 download my-bucket file_encrypted.txt ./file.txt QxhqaZEqBGVTW55HhQw9Q=`, `Decrypts and downloads "gs://my-bucket/file_encrypted.txt" to "./file.txt".`)
.example(`node $0 rotate my-bucket file_encrypted.txt QxhqaZEqBGVTW55HhQw9Q= SxafpsdfSDFS89sds9Q=`, `Rotates encryptiong keys for "gs://my-bucket/file_encrypted.txt".`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: encryptiong.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

after((done) => {
storage.bucket(bucketName).file(fileName).delete((err) => {
assert.ifError(err);
setTimeout(() => storage.bucket(bucketName).delete(done), 2000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it you want this to return an error if the bucket delete() operation fails?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@codecov-io
Copy link

Current coverage is 92.13% (diff: 100%)

No coverage report found for master at db124bc.

Powered by Codecov. Last update db124bc...202eabd

@jmdobry jmdobry merged commit 3d4bb4d into master Oct 3, 2016
@jmdobry jmdobry deleted the storage branch October 3, 2016 22:41
grayside pushed a commit that referenced this pull request Oct 26, 2022
* docs(samples): Update ReadMe and comments for samples

* docs(samples): Update ReadMe and comments for samples

* Update bodyparser and comment

* Fix merge error

* Add comment for bodyParser

* Update comment
grayside pushed a commit that referenced this pull request Nov 3, 2022
* docs(samples): Update ReadMe and comments for samples

* docs(samples): Update ReadMe and comments for samples

* Update bodyparser and comment

* Fix merge error

* Add comment for bodyParser

* Update comment
kweinmeister pushed a commit that referenced this pull request Nov 7, 2022
* build!: Update library to use Node 12

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this pull request Nov 8, 2022
kweinmeister pushed a commit that referenced this pull request Nov 8, 2022
* build!: Update library to use Node 12

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
kweinmeister pushed a commit that referenced this pull request Nov 8, 2022
* build!: Update library to use Node 12

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this pull request Nov 10, 2022
NimJay pushed a commit that referenced this pull request Nov 10, 2022
refactor: use execSync for tests

#225 automerged by dpebot
NimJay pushed a commit that referenced this pull request Nov 10, 2022
refactor: use execSync for tests

#225 automerged by dpebot
ace-n pushed a commit that referenced this pull request Nov 11, 2022
* wrap await with async

* wrap await

* lint

* license

* init without assigning null

* init without assigning null

* change outside function to sync

* comply to style guide & lint

* copyright header

* copyright header

* revert to 2018
ace-n pushed a commit that referenced this pull request Nov 11, 2022
* wrap await with async

* wrap await

* lint

* license

* init without assigning null

* init without assigning null

* change outside function to sync

* comply to style guide & lint

* copyright header

* copyright header

* revert to 2018
ace-n pushed a commit that referenced this pull request Nov 14, 2022
* wrap await with async

* wrap await

* lint

* license

* init without assigning null

* init without assigning null

* change outside function to sync

* comply to style guide & lint

* copyright header

* copyright header

* revert to 2018
ace-n pushed a commit that referenced this pull request Nov 15, 2022
* wrap await with async

* wrap await

* lint

* license

* init without assigning null

* init without assigning null

* change outside function to sync

* comply to style guide & lint

* copyright header

* copyright header

* revert to 2018
ace-n pushed a commit that referenced this pull request Nov 15, 2022
* wrap await with async

* wrap await

* lint

* license

* init without assigning null

* init without assigning null

* change outside function to sync

* comply to style guide & lint

* copyright header

* copyright header

* revert to 2018
ahrarmonsur pushed a commit that referenced this pull request Nov 16, 2022
ahrarmonsur pushed a commit that referenced this pull request Nov 16, 2022
ahrarmonsur pushed a commit that referenced this pull request Nov 16, 2022
ahrarmonsur pushed a commit that referenced this pull request Nov 16, 2022
ahrarmonsur pushed a commit that referenced this pull request Nov 16, 2022
grayside pushed a commit that referenced this pull request Nov 16, 2022
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
ace-n pushed a commit that referenced this pull request Nov 17, 2022
* wrap await with async

* wrap await

* lint

* license

* init without assigning null

* init without assigning null

* change outside function to sync

* comply to style guide & lint

* copyright header

* copyright header

* revert to 2018
ace-n pushed a commit that referenced this pull request Nov 17, 2022
* wrap await with async

* wrap await

* lint

* license

* init without assigning null

* init without assigning null

* change outside function to sync

* comply to style guide & lint

* copyright header

* copyright header

* revert to 2018
ace-n pushed a commit that referenced this pull request Nov 17, 2022
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
grayside pushed a commit that referenced this pull request Nov 17, 2022
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
ace-n pushed a commit that referenced this pull request Nov 17, 2022
ahrarmonsur pushed a commit that referenced this pull request Nov 17, 2022
* wrap await with async

* wrap await

* lint

* license

* init without assigning null

* init without assigning null

* change outside function to sync

* comply to style guide & lint

* copyright header

* copyright header

* revert to 2018
ahrarmonsur pushed a commit that referenced this pull request Nov 17, 2022
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
kweinmeister pushed a commit that referenced this pull request Nov 18, 2022
NimJay pushed a commit that referenced this pull request Nov 18, 2022
NimJay pushed a commit that referenced this pull request Nov 18, 2022
kweinmeister pushed a commit that referenced this pull request Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants