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(bigtable): add GC policy to FamilyInfo. #5993

Closed

Conversation

hoangpham95
Copy link
Contributor

@hoangpham95 hoangpham95 commented May 4, 2022

We need the proto of GC policy exposed so that Terraform can read max_version and max_age from the policy, instead of a fully parsed string. Fix #6122.

@hoangpham95 hoangpham95 requested review from dmahugh, tritone, telpirion and a team as code owners May 4, 2022 19:33
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label May 4, 2022
GCPolicy string
Name string
GCPolicy string
GCPolicyProto *btapb.GcRule
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you considered just adding the fields you need directly on this object, rather than exposing the whole proto?

In general we try to avoid exposing proto-types directly via the manual clients. Though, I see a few cases already where they are in this library, so I'll just have this as a question/suggestion rather than being a purist about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're interested in recursively iterate through this proto to generate a valid JSON field for Terraform. The one we're interested in is the Rule object in *btapb.GcRule, but the type of that object is not exported, so I opt in to pass the entire proto here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @tritone. We typically try to provide a veneer over proto message types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, so how about adding a new struct in the bigtable client and a parser function to convert the proto to the new struct, and pass that struct back from the admin?

@codyoss codyoss changed the title Add GC policy proto to FamilyInfo. feat(bigtable): add GC policy proto to FamilyInfo. May 4, 2022
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label May 5, 2022
@hoangpham95 hoangpham95 requested a review from enocom as a code owner May 5, 2022 14:01
@hoangpham95 hoangpham95 requested a review from tritone May 5, 2022 14:26
telpirion
telpirion previously approved these changes May 5, 2022
GCPolicy string
Name string
GCPolicy string
GCPolicyProto *btapb.GcRule
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @tritone. We typically try to provide a veneer over proto message types.

Copy link
Contributor

@telpirion telpirion left a comment

Choose a reason for hiding this comment

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

Does this have a corresponding Issue?

@telpirion telpirion dismissed their stale review May 5, 2022 19:07

Clicked the wrong button

@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels May 9, 2022
@hoangpham95 hoangpham95 requested a review from telpirion May 9, 2022 02:59
bigtable/gc.go Outdated Show resolved Hide resolved
bigtable/gc.go Outdated Show resolved Hide resolved
bigtable/gc.go Outdated Show resolved Hide resolved
@hoangpham95 hoangpham95 requested a review from tritone May 12, 2022 14:09
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.

Two more small comments, otherwise LGTM. @telpirion must approve though.

bigtable/gc.go Outdated Show resolved Hide resolved
bigtable/gc.go Outdated Show resolved Hide resolved
@telpirion telpirion dismissed their stale review June 10, 2022 15:31

Revoking approval

@telpirion
Copy link
Contributor

It looks like something similar to this feature is already available in the Java BT client, so it's reasonable to include here.

@telpirion telpirion added automerge Merge the pull request once unit tests and other checks pass. and removed stale: old Pull request is old and needs attention. labels Jun 17, 2022
@gcf-merge-on-green
Copy link
Contributor

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jun 18, 2022
@product-auto-label product-auto-label bot added the stale: old Pull request is old and needs attention. label Jun 18, 2022
@telpirion telpirion added the automerge Merge the pull request once unit tests and other checks pass. label Jun 21, 2022
@telpirion telpirion enabled auto-merge (squash) June 21, 2022 21:46
auto-merge was automatically disabled June 21, 2022 21:52

Pull request was closed

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API. size: m Pull request size is medium. stale: old Pull request is old and needs attention.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bigtable: add full GCPolicy object with PolicyType to bigtable's FamilyInfo
5 participants