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

chore(storage): add proto converters for Object metadata #4583

Merged
merged 11 commits into from Aug 25, 2021

Conversation

noahdietz
Copy link
Contributor

@noahdietz noahdietz commented Aug 9, 2021

Adds converters for the various metadata types, between the library version and the protobuf version.

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Aug 9, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 9, 2021
@noahdietz noahdietz force-pushed the storage-attrs branch 6 times, most recently from 9888779 to 880454a Compare August 16, 2021 15:53
@noahdietz noahdietz force-pushed the storage-attrs branch 3 times, most recently from b83994e to 123a6b6 Compare August 19, 2021 22:52
@noahdietz noahdietz marked this pull request as ready for review August 20, 2021 20:42
@noahdietz noahdietz requested a review from a team August 20, 2021 20:42
@noahdietz noahdietz requested a review from a team as a code owner August 20, 2021 20:42
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Good start! Two more thoughts

  • I think we have unit tests for raw object encoding/decoding-- we should add the same for proto.
  • This PR only covers object metadata and not bucket metadata. Let's change the title to indicate that.

storage/acl.go Outdated Show resolved Hide resolved
storage/storage.go Outdated Show resolved Hide resolved
Acl: toProtoObjectACL(o.ACL),
Metadata: o.Metadata,
CustomTime: ct,
KmsKey: o.KMSKeyName,
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 it necessary to add this field here and not in the apiary object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Idk if it's necessary or not, but it's in the proto so I included it here. Should I remove it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, looks like it might be an oversight in the current implementation which is concerning!

storage/storage.go Outdated Show resolved Hide resolved
Deleted: convertProtoTime(o.GetDeleteTime()),
Updated: convertProtoTime(o.GetUpdateTime()),
CustomTime: convertProtoTime(o.GetCustomTime()),
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed ETag is missing, is that no longer provided via gRPC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There isn't an etag field in the protos so I guess not.

@noahdietz noahdietz requested a review from tritone August 23, 2021 18:39
@noahdietz noahdietz changed the title chore(storage): add proto converters for metadata chore(storage): add proto converters for Object metadata Aug 23, 2021
@noahdietz
Copy link
Contributor Author

@tritone I've added test cases PTAL!

Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

thanks for adding tests!

storage/acl_test.go Outdated Show resolved Hide resolved
storage/storage.go Outdated Show resolved Hide resolved
storage/storage.go Outdated Show resolved Hide resolved
Acl: toProtoObjectACL(o.ACL),
Metadata: o.Metadata,
CustomTime: ct,
KmsKey: o.KMSKeyName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, looks like it might be an oversight in the current implementation which is concerning!

@noahdietz noahdietz requested a review from tritone August 25, 2021 16:54
@noahdietz noahdietz merged commit 83b3656 into googleapis:master Aug 25, 2021
@noahdietz noahdietz deleted the storage-attrs branch August 25, 2021 17:23
BrennaEpp pushed a commit to BrennaEpp/google-cloud-go that referenced this pull request Aug 27, 2021
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 Cloud 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

2 participants