Skip to content

Conversation

@billyjacobson
Copy link
Member

@billyjacobson billyjacobson commented Aug 27, 2018

  • Sample review
  • Samples with test
    • Defining a retention policy
    • Remove a retention policy if not locked
    • Lock a retention policy
    • Get retention policy
    • Set temporary hold
    • Release temporary hold
    • Set event-based hold
    • Release event-based hold
    • Get default event-based hold
    • Set default event-based hold
    • Release default event-based hold
    • Get object metadata
  • Update CLI for sample
  • Updated README.md

@billyjacobson billyjacobson added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 27, 2018
Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

A few nits, but overall lgtm! Thanks @billyjacobson!

$bucket = $storage->bucket($bucketName);
$bucket->update([
'retentionPolicy' => [
]]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you move up the closing bracket?

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

});


// Create Buckets command
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing this was copied over from another file.

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


// Create Buckets command
$application->add(new Command('bucketlock'))
->setDescription('Manage Cloud Storage retention policies')
Copy link
Contributor

Choose a reason for hiding this comment

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

Manage Cloud Storage object retention.

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Generalizing for buckets/objects. Update to Manage Cloud Storage retention policies and holds

Copy link
Member Author

Choose a reason for hiding this comment

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

Should the entire command set be labeled "retention-policy" then? or is it fine to keep it as bucket-lock

Copy link
Contributor

Choose a reason for hiding this comment

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

bucketlock is okay.

)
->addArgument('bucket', InputArgument::REQUIRED, 'The Cloud Storage bucket name')
->addArgument('object', InputArgument::OPTIONAL, 'The Cloud Storage object name')
->addArgument('retention-period', InputArgument::OPTIONAL, 'The length of the retention period')
Copy link
Contributor

Choose a reason for hiding this comment

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

suffix it with " in seconds"

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

Adding conditional for removing retention policy
Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

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

Fixed some code styles but otherwise this is great once the tests pass!

@frankyn frankyn added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Oct 4, 2018
@kokoro-team kokoro-team removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Oct 4, 2018
@frankyn frankyn requested a review from grayside October 4, 2018 17:46
Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

Small nits

@frankyn
Copy link
Contributor

frankyn commented Oct 4, 2018

@grayside could you help review these PHP samples?

@frankyn
Copy link
Contributor

frankyn commented Oct 4, 2018

@grayside there is also version difficulties with the composer.lock file. We aren't sure how to fix this issue. Any tips would be awesome.

@frankyn frankyn removed the request for review from grayside October 4, 2018 19:52
@frankyn
Copy link
Contributor

frankyn commented Oct 4, 2018

cc: @chingor13 will help review.

Copy link
Member

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

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

  • @return void should be removed from the phpdoc. There's no void type in PHP.
  • It's unlikely users will want to call update without checking the return value

*
* @param string $bucketName the name of your Cloud Storage bucket.
*
* @return void
Copy link
Member

Choose a reason for hiding this comment

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

We can skip @return void

$bucket = $storage->bucket($bucketName);
$bucket->reload();

if ($bucket->info()['retentionPolicy']['isLocked']) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we not surface these attributes in a cleaner way? If they're well known, we should probably consider trying to expose them in a better way than nested associative arrays.

Copy link
Contributor

Choose a reason for hiding this comment

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

It could be a feature request at this point. It currently follows how metadata is handled by the library.

@frankyn
Copy link
Contributor

frankyn commented Oct 4, 2018

@chingor13 do you have input on how to fix the composer.lock? There's a mismatch of versions.

@chingor13
Copy link
Member

@frankyn It looks like storage/composer.lock was removed upstream causing the conflict. composer can resolve the dependencies from scratch without it.

@frankyn frankyn added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Oct 5, 2018
@frankyn
Copy link
Contributor

frankyn commented Oct 5, 2018

Something is up with travis.

@frankyn
Copy link
Contributor

frankyn commented Oct 5, 2018

Chatted with @bshaffer, looks like Travis CI requirement is a bug. He was trying to remove Travis CI but he's no longer able to remove it (I tried as well). We are technically blocked until this is resolved.

@frankyn
Copy link
Contributor

frankyn commented Oct 5, 2018

Nvm, unblocked.

@frankyn frankyn added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 5, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 5, 2018
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 5, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 5, 2018
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 5, 2018
@frankyn frankyn merged commit cc58f22 into master Oct 5, 2018
@frankyn frankyn deleted the bucketlock branch October 5, 2018 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kokoro:force-run Add this label to force Kokoro to re-run the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants