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

feat: add support of customTime metadata #413

Merged
merged 7 commits into from Aug 27, 2020

Conversation

athakor
Copy link
Contributor

@athakor athakor commented Jul 1, 2020

Towards #395

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 1, 2020
@athakor athakor requested a review from frankyn July 1, 2020 13:19
@codecov
Copy link

codecov bot commented Jul 1, 2020

Codecov Report

Merging #413 into master will increase coverage by 1.38%.
The diff coverage is 91.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #413      +/-   ##
============================================
+ Coverage     63.19%   64.58%   +1.38%     
- Complexity      613      617       +4     
============================================
  Files            32       32              
  Lines          5144     5232      +88     
  Branches        492      507      +15     
============================================
+ Hits           3251     3379     +128     
+ Misses         1729     1694      -35     
+ Partials        164      159       -5     
Impacted Files Coverage Δ Complexity Δ
...c/main/java/com/google/cloud/storage/BlobInfo.java 88.30% <90.00%> (+0.04%) 91.00 <1.00> (+3.00)
...e/src/main/java/com/google/cloud/storage/Blob.java 82.38% <100.00%> (+0.20%) 30.00 <0.00> (ø)
...ain/java/com/google/cloud/storage/StorageImpl.java 81.25% <0.00%> (+0.24%) 138.00% <0.00%> (ø%)
...main/java/com/google/cloud/storage/BucketInfo.java 83.97% <0.00%> (+1.96%) 86.00% <0.00%> (ø%)
...gle/cloud/storage/testing/RemoteStorageHelper.java 64.51% <0.00%> (+2.41%) 9.00% <0.00%> (ø%)
...in/java/com/google/cloud/storage/PostPolicyV4.java 86.33% <0.00%> (+23.67%) 5.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0e945e...7ee53f8. Read the comment docs.

elharo
elharo previously requested changes Jul 1, 2020
google-cloud-storage/clirr-ignored-differences.xml Outdated Show resolved Hide resolved
@athakor
Copy link
Contributor Author

athakor commented Jul 6, 2020

@jkwlui

@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 9, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 9, 2020
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 10, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 10, 2020
@athakor athakor 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. labels Jul 14, 2020
@yoshi-kokoro yoshi-kokoro 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 Jul 14, 2020
@frankyn frankyn added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 14, 2020
@athakor athakor 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. labels Jul 16, 2020
@yoshi-kokoro yoshi-kokoro 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 Jul 16, 2020
@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 5, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 5, 2020
@athakor
Copy link
Contributor Author

athakor commented Aug 7, 2020

@frankyn @jkwlui friendly ping

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Aug 21, 2020
@frankyn frankyn removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 24, 2020
Copy link
Member

@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.

I have a few nits for documentation, otherwise LGTM.

@@ -260,6 +261,9 @@ static CustomerEncryption fromPb(StorageObject.CustomerEncryption customerEncryp
*/
public abstract Builder setCrc32c(String crc32c);

/** Sets the custom time for an object. */
public abstract Builder setCustomTime(Long customTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this abstract? If it's concrete it wouldn't be a breaking change.

Copy link
Member

Choose a reason for hiding this comment

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

It's the development model we've used over the years. It was designed before my time and folks who worked on the library have since left the team.

We could update it to concrete method instead but we would start changing development flow. Maybe that's a good thing, but I'd prefer to prevent changing development flow until we have a new design that fits into that model.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

If it's implemented, it could be implemented to raise an exception of it not being implemented. Seems a little clunky, but would remove the need to create a breaking change.

Thanks for raising the simple questions @elharo, I haven't applied this train of thought to this problem, and I appreciate the feedback.

Copy link
Member

Choose a reason for hiding this comment

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

@athakor please implement this method instead of using abstract to prevent the breaking change. Instead raise an exception of unimplemented if called directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@athakor
Copy link
Contributor Author

athakor commented Aug 26, 2020

@frankyn PTAL

@@ -260,6 +261,22 @@ static CustomerEncryption fromPb(StorageObject.CustomerEncryption customerEncryp
*/
public abstract Builder setCrc32c(String crc32c);

/**
* Sets the custom time for an object. Once set it can't be unset and only changed to a custom
* datetime in the future. If the custom_time must be unset, you must either perform a rewrite
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use "custom_time" in this context, say "custom time" instead. Replace "If the custom_time must be unset," with "To unset the custom time,"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

* datetime in the future. If the custom_time must be unset, you must either perform a rewrite
* operation or upload the data again.
*
* <p>Example of setting the custom_time.
Copy link
Contributor

Choose a reason for hiding this comment

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

custom time instead of custom_time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@athakor
Copy link
Contributor Author

athakor commented Aug 27, 2020

@frankyn @JesseLovelace All the comments have been addressed PTAL

@frankyn frankyn requested a review from elharo August 27, 2020 21:51
@frankyn frankyn dismissed elharo’s stale review August 27, 2020 21:53

elharo, PR addressed the remaining comment about the breaking change while also raising an exception of unimplemented if used directly. Dismissing to merge.

@JesseLovelace JesseLovelace merged commit 6f4585e into googleapis:master Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants