Skip to content

Conversation

@feywind
Copy link
Contributor

@feywind feywind commented Dec 11, 2025

This is a follow-up for these two PRs:

#1739
#1740

This takes care of some missing pieces that were discovered by further discussion:

  • GcRuleBuilder is a more TypeScript-heavy way to validate ModifyColumnFamilies garbage collection rules, with type checking taking care of a lot of the constraints, and some minimal runtime checking for JavaScript users.
  • Rather than raw GAPIC, the focus has shifted to selective GAPIC subclasses that can augment them. This is specifically done to assist with RestoreTable and waiting for table consistency.
  • Data plane samples have been removed, as we don't want to encourage users to use them.
  • Generated samples and tests have been auto-edited to use the selective GAPIC classes.
  • Manual sample snippets have been updated to reflect the expected admin access and GcRuleBuilder usage.

There is still a CI issue that will need to be corrected before this can be merged. I don't think it's the result of this change, but I also don't want to chance it.

@feywind feywind self-assigned this Dec 11, 2025
@feywind feywind requested review from a team as code owners December 11, 2025 21:57
@feywind feywind added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 11, 2025
@snippet-bot
Copy link

snippet-bot bot commented Dec 11, 2025

Here is the summary of changes.

You are about to add 3 region tags.
You are about to delete 13 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added the size: xl Pull request size is extra large. label Dec 11, 2025
@generated-files-bot
Copy link

Warning: This pull request is touching the following templated files:

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/nodejs-bigtable API. label Dec 11, 2025
@feywind feywind changed the title Modernization part 2 feat: modernization part 2 Dec 11, 2025
@feywind feywind added owl-bot-copy owlbot:run Add this label to trigger the Owlbot post processor. labels Dec 11, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Dec 11, 2025
@feywind feywind removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 17, 2025
@feywind
Copy link
Contributor Author

feywind commented Dec 17, 2025

The CI is really not cooperating here (timeouts, quota errors, etc) but the code itself should be okay to review.

Copy link
Contributor

@mutianf mutianf left a comment

Choose a reason for hiding this comment

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

Where did all the data API examples go?


// Imports the Admin library
const {BigtableTableAdminClient} = require('@google-cloud/bigtable').admin.v2;
const {TableAdminClient} = require('@google-cloud/bigtable').admin;
Copy link
Contributor

Choose a reason for hiding this comment

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

should this sample reflect the new CUJ?

await tableAdmin.waitForConsistency('tablename');

or

  const [token] = await tableAdmin.generateConsistencyToken({
    name: 'tablename',
  });
  // overload/etc, may be a separate method
  await tableAdmin.waitForConsistency(token);

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's now a separate sample for waitForConsistency:

https://github.com/googleapis/nodejs-bigtable/blob/modernization-2/samples/api-reference-doc-snippets/table.waitconsistency.js

I don't want to remove the existing one just because those methods are still valid and work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I figure as long as we want this sample to show up for the bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async region tags then this should be fine, but I'm not sure what the requirements are here.

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 talked about this a bit in the last meeting, but since there's another tomorrow, let's just ask again.

versions: 1,
},
};
const updatedMetadata = GcRuleBuilder.rule({
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this example can be added to the modifyColumnFamilies example as well?

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 might've missed one, but I agree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I'm not sure I see where it's missing - can you paste a link?

Copy link
Contributor

Choose a reason for hiding this comment

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

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Jan 23, 2026
@feywind feywind added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 26, 2026
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 26, 2026
@feywind feywind added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 26, 2026
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 26, 2026
await adminClient.checkOptimizeRestoredTableProgress(
optimizeTableOperationName,
);
const [table] = await optimizeLRO.promise();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I remember modelling my code after the Python code which performs two operations shown by each of the await calls deleted above. Does the checkOptimizeRestoredTableProgress call basically return the same LRO as the gax.operation( call in the deleted snippet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's basically a copy of gapic's checkRestoreTableProgress, but modified to work with the optimize operation:

async checkOptimizeRestoredTableProgress(

I don't have the original handy, but IIRC it had similarities.

import {describe, it} from 'mocha';

describe('GcRuleBuilder', () => {
it('has working TypeScript types', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

With the new changes, are there tests anywhere that ensure the full sample from the doc https://docs.google.com/document/d/14aOXOpEbwpYJe7-p6E-PUgoy0vn4AKI7zP0Man0prLo/edit?tab=t.0#heading=h.d7jxtor70ekh runs without errors?

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'm pretty sure there's a very similar one in the table admin tests, but maybe we could update that one to do what's in the doc, since it's more comprehensive?

Copy link
Contributor

@danieljbruce danieljbruce left a comment

Choose a reason for hiding this comment

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

LGTM with a few nits and checks.

Copy link
Contributor

@danieljbruce danieljbruce left a comment

Choose a reason for hiding this comment

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

Left a few more responses.


// Imports the Admin library
const {BigtableTableAdminClient} = require('@google-cloud/bigtable').admin.v2;
const {TableAdminClient} = require('@google-cloud/bigtable').admin;
Copy link
Contributor

Choose a reason for hiding this comment

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

I figure as long as we want this sample to show up for the bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async region tags then this should be fine, but I'm not sure what the requirements are here.

versions: 1,
},
};
const updatedMetadata = GcRuleBuilder.rule({
Copy link
Contributor

Choose a reason for hiding this comment

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

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/nodejs-bigtable API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants