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

build!: update library to use Node 12 #1089

Merged
merged 9 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ branchProtectionRules:
- "ci/kokoro: System test"
- docs
- lint
- test (10)
- test (12)
- test (14)
- test (16)
- cla/google
- windows
- OwlBot Post Processor
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14]
node: [12, 14, 16]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
34 changes: 0 additions & 34 deletions .kokoro/continuous/node10/common.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/continuous/node10/docs.cfg

This file was deleted.

9 changes: 0 additions & 9 deletions .kokoro/continuous/node10/test.cfg

This file was deleted.

24 changes: 0 additions & 24 deletions .kokoro/continuous/node8/common.cfg

This file was deleted.

Empty file.
34 changes: 0 additions & 34 deletions .kokoro/presubmit/node10/common.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/presubmit/node10/docs.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/presubmit/node10/lint.cfg

This file was deleted.

Empty file.
24 changes: 0 additions & 24 deletions .kokoro/presubmit/node8/common.cfg

This file was deleted.

Empty file removed .kokoro/presubmit/node8/test.cfg
Empty file.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"dot-prop": "^6.0.0",
"escape-string-regexp": "^4.0.0",
"extend": "^3.0.2",
"google-gax": "^2.29.5",
"google-gax": "^3.0.1",
"grpc-gcp": "0.4.2",
"is": "^3.0.1",
"is-utf8": "^0.2.1",
Expand All @@ -75,24 +75,24 @@
"@types/uuid": "^8.0.0",
"c8": "^7.1.0",
"codecov": "^3.6.5",
"gts": "^3.0.0",
"gts": "^3.1.0",
"jsdoc": "^3.6.3",
"jsdoc-fresh": "^1.0.2",
"jsdoc-region-tag": "^1.0.4",
"linkinator": "^2.0.3",
"mocha": "^8.0.0",
"mocha": "^9.2.2",
"null-loader": "^4.0.0",
"p-queue": "^6.0.2",
"pack-n-play": "^1.0.0-2",
"proxyquire": "^2.0.0",
"sinon": "^14.0.0",
"ts-loader": "^9.0.0",
"typescript": "^3.8.3",
"typescript": "^4.6.4",
"uuid": "^8.0.0",
"webpack": "^5.0.0",
"webpack-cli": "^4.0.0"
},
"engines": {
"node": ">=10"
"node": ">=12.0.0"
}
}
2 changes: 1 addition & 1 deletion samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"api-reference-doc-snippets/*.js"
],
"engines": {
"node": ">=12"
"node": ">=12.0.0"
},
"dependencies": {
"@google-cloud/bigtable": "^3.12.0",
Expand Down
10 changes: 5 additions & 5 deletions src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface BasicClusterConfig {
}

export interface CreateBackupConfig extends ModifiableBackupFields {
table: string | Table;
table?: string | Table;
gaxOptions?: CallOptions;
}

Expand Down Expand Up @@ -487,13 +487,13 @@ Please use the format 'my-cluster' or '${instance.name}/clusters/my-cluster'.`);

const reqOpts: google.bigtable.admin.v2.IListBackupsRequest = {
parent: this.name,
pageSize: gaxOpts.pageSize,
pageToken: gaxOpts.pageToken,
pageSize: (gaxOpts as GetBackupsOptions).pageSize,
pageToken: (gaxOpts as GetBackupsOptions).pageToken,
...options,
};

delete gaxOpts.pageSize;
delete gaxOpts.pageToken;
delete (gaxOpts as GetBackupsOptions).pageSize;
delete (gaxOpts as GetBackupsOptions).pageToken;
delete (reqOpts as CallOptions).autoPaginate;
delete (reqOpts as GetBackupsOptions).gaxOptions;

Expand Down
40 changes: 20 additions & 20 deletions src/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,15 +703,15 @@ Please use the format 'my-instance' or '${bigtable.projectName}/instances/my-ins
parent: this.name,
};

if (is.number(gaxOpts.pageSize)) {
reqOpts.pageSize = gaxOpts.pageSize;
if (is.number((gaxOpts as GetBackupsOptions).pageSize)) {
reqOpts.pageSize = (gaxOpts as GetBackupsOptions).pageSize;
}
delete gaxOpts.pageSize;
delete (gaxOpts as GetBackupsOptions).pageSize;

if (gaxOpts.pageToken) {
reqOpts.pageToken = gaxOpts.pageToken;
if ((gaxOpts as GetBackupsOptions).pageToken) {
reqOpts.pageToken = (gaxOpts as GetBackupsOptions).pageToken;
}
delete gaxOpts.pageToken;
delete (gaxOpts as GetBackupsOptions).pageToken;

this.bigtable.request<google.bigtable.admin.v2.IAppProfile[]>(
{
Expand Down Expand Up @@ -777,15 +777,15 @@ Please use the format 'my-instance' or '${bigtable.projectName}/instances/my-ins
};
const gaxOpts = extend(true, {}, gaxOptions);

if (is.number(gaxOpts.pageSize)) {
reqOpts.pageSize = gaxOpts.pageSize;
if (is.number((gaxOpts as GetBackupsOptions).pageSize)) {
reqOpts.pageSize = (gaxOpts as GetBackupsOptions).pageSize;
}
delete gaxOpts.pageSize;
delete (gaxOpts as GetBackupsOptions).pageSize;

if (gaxOpts.pageToken) {
reqOpts.pageToken = gaxOpts.pageToken;
if ((gaxOpts as GetBackupsOptions).pageToken) {
reqOpts.pageToken = (gaxOpts as GetBackupsOptions).pageToken;
}
delete gaxOpts.pageToken;
delete (gaxOpts as GetBackupsOptions).pageToken;

// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;
Expand Down Expand Up @@ -1103,13 +1103,13 @@ Please use the format 'my-instance' or '${bigtable.projectName}/instances/my-ins
reqOpts = extend(
{},
{
pageSize: gaxOpts.pageSize,
pageToken: gaxOpts.pageToken,
pageSize: (gaxOpts as GetBackupsOptions).pageSize,
pageToken: (gaxOpts as GetBackupsOptions).pageToken,
},
reqOpts
);
delete gaxOpts.pageSize;
delete gaxOpts.pageToken;
delete (gaxOpts as GetBackupsOptions).pageSize;
delete (gaxOpts as GetBackupsOptions).pageToken;
}

delete (reqOpts as GetTablesOptions).gaxOptions;
Expand Down Expand Up @@ -1184,13 +1184,13 @@ Please use the format 'my-instance' or '${bigtable.projectName}/instances/my-ins
reqOpts = extend(
{},
{
pageSize: gaxOpts.pageSize,
pageToken: gaxOpts.pageToken,
pageSize: (gaxOpts as GetBackupsOptions).pageSize,
pageToken: (gaxOpts as GetBackupsOptions).pageToken,
},
reqOpts
);
delete gaxOpts.pageSize;
delete gaxOpts.pageToken;
delete (gaxOpts as GetBackupsOptions).pageSize;
delete (gaxOpts as GetBackupsOptions).pageToken;
}

// eslint-disable-next-line @typescript-eslint/no-this-alias
Expand Down
8 changes: 6 additions & 2 deletions system-test/bigtable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ describe('Bigtable', () => {
await operation.promise();
throw new Error('Cluster creation should not have succeeded');
} catch (e) {
assert(e.message.includes('default keys and CMEKs are not allowed'));
assert(
(e as Error).message.includes(
'default keys and CMEKs are not allowed'
)
);
}
});
});
Expand Down Expand Up @@ -913,7 +917,7 @@ describe('Bigtable', () => {
];
await TABLE.insert(entries);
const rows: Row[] = [];
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const stream = TABLE.createReadStream()
.on('error', reject)
.on('data', row => {
Expand Down
4 changes: 2 additions & 2 deletions system-test/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ describe('📦 pack-n-play test', () => {
await packNTest(options);
} catch (e) {
// all of the actionable information is on the output attribute
if (e.output) {
e.message += 'output: ' + e.output;
if ((e as any).output) {
(e as any).message += 'output: ' + (e as any).output;
}
throw e;
}
Expand Down
9 changes: 8 additions & 1 deletion test/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ import {PassThrough, Readable} from 'stream';
import {CallOptions} from 'google-gax';
import {PreciseDate} from '@google-cloud/precise-date';

export interface Options {
nodes?: Number;
gaxOptions?: {
timeout: number;
};
}

let promisified = false;
const fakePromisify = Object.assign({}, promisify, {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down Expand Up @@ -987,7 +994,7 @@ describe('Bigtable/Cluster', () => {
defaultStorageType: 'exellent_type',
};

const expectedReqOpts = Object.assign(
const expectedReqOpts: Options = Object.assign(
{},
{name: CLUSTER_NAME, serveNodes: options.nodes},
options
Expand Down
Loading