Skip to content

Conversation

@jinseopkim0
Copy link
Contributor

This PR introduces GcRuleBuilder and associated helpers to provide a type-safe way to construct Bigtable Garbage Collection rules.

Changes:

  • Added GcRuleBuilder factory to prevent silent overwrites of oneof fields (e.g., accidentally setting both max_age and max_versions).
  • Added safe, fluent builders for Intersection and Union rules (IntersectionRuleBuilder, UnionRuleBuilder).
  • Added GcRuleBuilderTest to verify correct proto construction.

Context:
This addresses the "Garbage Collection Rules" Critical User Journey (CUJ) for the Admin API modernization.

Tracking Bug: b/475818580

@jinseopkim0 jinseopkim0 requested review from a team as code owners January 20, 2026 22:02
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigtable Issues related to the googleapis/java-bigtable API. labels Jan 20, 2026
@jinseopkim0 jinseopkim0 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 Jan 20, 2026
@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 Jan 20, 2026
@jinseopkim0 jinseopkim0 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 Jan 20, 2026
@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 Jan 20, 2026
@jinseopkim0 jinseopkim0 requested a review from lqiu96 January 21, 2026 15:39
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Jan 21, 2026
@jinseopkim0 jinseopkim0 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 Jan 21, 2026
@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 Jan 21, 2026
@jinseopkim0 jinseopkim0 requested a review from lqiu96 January 21, 2026 18:09
Comment on lines +40 to +51
public static IntersectionRuleBuilder intersection() {
return new IntersectionRuleBuilder();
}

/**
* Starts building a Union (OR) rule.
*
* @return A new builder for a union rule.
*/
public static UnionRuleBuilder union() {
return new UnionRuleBuilder();
}
Copy link
Member

Choose a reason for hiding this comment

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

nit: Have we considered naming like:

  • GcRuleUnionBuilder
  • GcRuleIntersectionBuilder

I think it may be clearer for users that these are specifically for GcRules. I guess that in the context it will generally be:

GcRuleBuilder.union().addRule(...)

or

UnionRuleBuilder ruleBuilder = GcRuleBuilder.union();
ruleBuilder.add(...)

which is also pretty clear.

Copy link
Member

@lqiu96 lqiu96 left a comment

Choose a reason for hiding this comment

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

LGTM

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 googleapis/java-bigtable API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants