Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit a0f216e

Browse files
feat: modernization part 2 (#1748)
* feat: update from selective gapic updates * feat: work in progress on updated admin tools * feat: update proposed gcrule builder * feat: more updates on the CUJs * feat: updates from comments on new modernization features * fix: implement the rest of the old GcRule rules * fix: clean up waitForConsistency * docs: typo * fix: a couple more pieces of backwards compat * samples: don't publish data plane generated samples * feat: move admin builder methods to be more namespaced * fix: updated GcRuleBuilder import * build: transform class names for selective gapic * feat: adjust BigtableAdmin for recent doc updates * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: owlbot.py updates and resulting fixes * feat: improve the type safety of GcRuleBuilder and add tests * tests: add tests for TableAdmin * samples: update GcRule samples for GcRuleBuilder * chore: bump dates in headers for year rollover * feat: allow the user to pass in an existing wait token * docs: exclude implementation comment from jsdocs * docs: wordsmithing for GcRuleBuilder errors * tests: add system tests for consistency tokens via gapic * chore: linter nits * tests: finish up system tests for gapic backups * tests: bug fixes for waitForConsistency system tests * samples: update existing samples to use selective gapic classes * samples: update samples for veneer functions for waiting consistency and restore optimization * build: tweak sample tag for internal sample * samples: fix tag munging for restoreTable * tests: keep random position test more in line with fixed position test * fix: just keep one set of client options for the admin wrapper --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent a719d9f commit a0f216e

118 files changed

Lines changed: 3119 additions & 8689 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

owlbot.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
src_files[version] = list([fn for fn in src_paths[version].glob('**/*.*')])
3939

4040
# Copy bigtable library.
41-
# src/index.ts src/admin/v2/index.ts has added AdminClients manually, we don't wanna override it.
41+
# src/index.ts src/admin/v2/index.ts has added AdminClients manually; we don't want to override it.
4242
# src/*.ts is a added layer for the client libraries, they need extra setting in tsconfig.json & tslint.json
4343
# Tracking issues: 1. https://github.com/googleapis/nodejs-bigtable/issues/636
4444
# 2. https://github.com/googleapis/nodejs-bigtable/issues/635
@@ -59,6 +59,7 @@
5959
'.github/sync-repo-settings.yaml',
6060
'.github/workflows/ci.yaml',
6161
'.OwlBot.yaml',
62+
'samples/generated/v2/*', # we don't want to encourage non-veneer use here.
6263
] + list(admin_files)
6364
logging.info(f"excluding files for non-admin: {excludes}")
6465
s.copy([library], excludes = excludes)
@@ -98,10 +99,24 @@
9899
for tfn in tfns:
99100
logging.info(f"munging test file: {str(tfn)}")
100101
contents = tfn.read_text()
102+
103+
# Fix relative paths.
101104
contents = contents.replace("'../", "'../../../")
105+
106+
# Use the selective subclasses.
107+
contents = contents.replace(".v2.BigtableInstanceAdminClient", ".admin.InstanceAdminClient")
108+
contents = contents.replace(".v2.BigtableTableAdminClient", ".admin.TableAdminClient")
109+
110+
# Statics also.
111+
contents = contents.replace("bigtabletableadminModule.v2.BigtableTableAdminClient", \
112+
"bigtabletableadminModule.admin.TableAdminClient")
113+
contents = contents.replace("bigtabletableadminModule.v2.BigtableInstanceAdminClient", \
114+
"bigtabletableadminModule.admin.InstanceAdminClient")
115+
102116
tfn.write_text(contents)
103117

104-
# Finally, the samples. .v2 -> .admin.v2
118+
# Finally, the samples. Shift to selective subclasses, and mark the samples
119+
# with CUJs as internal, in favour of the handwritten ones.
105120
samplesStr = str(samples)
106121
sfns = [fn
107122
for fn
@@ -110,7 +125,18 @@
110125
for sfn in sfns:
111126
logging.info(f"munging sample file: {str(sfn)}")
112127
contents = sfn.read_text()
113-
contents = contents.replace(').v2', ').admin.v2')
128+
contents = contents.replace("const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2", \
129+
"const {InstanceAdminClient} = require('@google-cloud/bigtable').admin")
130+
contents = contents.replace("const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2", \
131+
"const {TableAdminClient} = require('@google-cloud/bigtable').admin")
132+
contents = contents.replace("new BigtableInstanceAdminClient", "new InstanceAdminClient")
133+
contents = contents.replace("new BigtableTableAdminClient", "new TableAdminClient")
134+
135+
# We need to disable this one so the handwritten sample
136+
# can take over for the CUJ.
137+
contents = contents.replace("bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async", \
138+
"bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async_internal")
139+
114140
sfn.write_text(contents)
115141

116142
os.system(f"mkdir -p {inProtoPath}")

protos/google/bigtable/v2/feature_flags.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,7 @@ message FeatureFlags {
6767

6868
// Notify the server that the client explicitly opted in for Direct Access.
6969
bool direct_access_requested = 10;
70+
71+
// If the client can support using BigtablePeerInfo.
72+
bool peer_info = 11;
7073
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.bigtable.v2;
18+
19+
option csharp_namespace = "Google.Cloud.Bigtable.V2";
20+
option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb";
21+
option java_multiple_files = true;
22+
option java_outer_classname = "PeerInfoProto";
23+
option java_package = "com.google.bigtable.v2";
24+
option php_namespace = "Google\\Cloud\\Bigtable\\V2";
25+
option ruby_package = "Google::Cloud::Bigtable::V2";
26+
27+
// PeerInfo contains information about the peer that the client is
28+
// connecting to.
29+
message PeerInfo {
30+
// The transport type that the client used to connect to this peer.
31+
enum TransportType {
32+
// The transport type is unknown.
33+
TRANSPORT_TYPE_UNKNOWN = 0;
34+
35+
// The client connected to this peer via an external network
36+
// (e.g. outside Google Coud).
37+
TRANSPORT_TYPE_EXTERNAL = 1;
38+
39+
// The client connected to this peer via CloudPath.
40+
TRANSPORT_TYPE_CLOUD_PATH = 2;
41+
42+
// The client connected to this peer via DirectAccess.
43+
TRANSPORT_TYPE_DIRECT_ACCESS = 3;
44+
45+
// The client connected to this peer via Bigtable Sessions using an unknown
46+
// transport type.
47+
TRANSPORT_TYPE_SESSION_UNKNOWN = 4;
48+
49+
// The client connected to this peer via Bigtable Sessions on an external
50+
// network (e.g. outside Google Cloud).
51+
TRANSPORT_TYPE_SESSION_EXTERNAL = 5;
52+
53+
// The client connected to this peer via Bigtable Sessions using CloudPath.
54+
TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6;
55+
56+
// The client connected to this peer via Bigtable Sessions using
57+
// DirectAccess.
58+
TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7;
59+
}
60+
61+
// An opaque identifier for the Google Frontend which serviced this request.
62+
// Only set when not using DirectAccess.
63+
int64 google_frontend_id = 1;
64+
65+
// An opaque identifier for the application frontend which serviced this
66+
// request.
67+
int64 application_frontend_id = 2;
68+
69+
// The Cloud zone of the application frontend that served this request.
70+
string application_frontend_zone = 3;
71+
72+
// The subzone of the application frontend that served this request, e.g. an
73+
// identifier for where within the zone the application frontend is.
74+
string application_frontend_subzone = 4;
75+
76+
TransportType transport_type = 5;
77+
}

protos/google/bigtable/v2/response_params.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ message ResponseParams {
3232
// Identifier for a cluster that represents set of
3333
// bigtable resources.
3434
optional string cluster_id = 2;
35+
36+
// The AFE ID for the AFE that is served this request.
37+
optional int64 afe_id = 3;
3538
}

protos/google/cloud/common_resources.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2025 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

protos/protos.d.ts

Lines changed: 148 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)