Skip to content

Commit b942b62

Browse files
authored
refactor: linting errors, updates to node 16 (#3464)
* refactor: updates samples to node 16 and resolves linting errors * fix: adding in a skip for the gaming samples as it is referencing a project that seems to either not exist or has strict permissions, preventing the tests from running refactor: move dataproc and media-livestream back to node 12
1 parent 190d545 commit b942b62

File tree

177 files changed

+253
-272
lines changed

Some content is hidden

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

177 files changed

+253
-272
lines changed

.github/workflows/game-servers-snippets.yaml

+13-10
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,22 @@ on:
3232
schedule:
3333
- cron: '0 0 * * 0'
3434
jobs:
35-
test:
36-
permissions:
37-
contents: 'read'
38-
id-token: 'write'
39-
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
40-
uses: ./.github/workflows/test.yaml
41-
with:
42-
name: 'game-servers-snippets'
43-
path: 'game-servers/snippets'
35+
# -----------------
36+
# Issue to revisit skip: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/issues/3466
37+
# -----------------
38+
# test:
39+
# permissions:
40+
# contents: 'read'
41+
# id-token: 'write'
42+
# if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
43+
# uses: ./.github/workflows/test.yaml
44+
# with:
45+
# name: 'game-servers-snippets'
46+
# path: 'game-servers/snippets'
4447
flakybot:
4548
permissions:
4649
contents: 'read'
4750
id-token: 'write'
4851
if: github.event_name == 'schedule' && always() # always() submits logs even if tests fail
4952
uses: ./.github/workflows/flakybot.yaml
50-
needs: [test]
53+
# needs: [test]

.kokoro/appengine/test-deployment/common.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build_file: "nodejs-docs-samples/.kokoro/trampoline.sh"
1212
# Configure the docker image for kokoro-trampoline.
1313
env_vars: {
1414
key: "TRAMPOLINE_IMAGE"
15-
value: "gcr.io/cloud-devrel-kokoro-resources/node"
15+
value: "gcr.io/cloud-devrel-kokoro-resources/node:16-user"
1616
}
1717

1818
# Tell the trampoline which build file to use.

.kokoro/common.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ build_file: "nodejs-docs-samples/.kokoro/trampoline.sh"
1212
# Configure the docker image for kokoro-trampoline.
1313
env_vars: {
1414
key: "TRAMPOLINE_IMAGE"
15-
value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user"
15+
value: "gcr.io/cloud-devrel-kokoro-resources/node:16-user"
1616
}
1717

1818
# Export XUnit test results for further analysis
1919
action {
2020
define_artifacts {
2121
regex: "**/*sponge_log.xml"
2222
}
23-
}
23+
}

.kokoro/functions/billing-periodic.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env_vars: {
1515
# Configure the docker image for kokoro-trampoline.
1616
env_vars: {
1717
key: "TRAMPOLINE_IMAGE"
18-
value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user"
18+
value: "gcr.io/cloud-devrel-kokoro-resources/node:16-user"
1919
}
2020

2121
# Tell the trampoline which build file to use.

.kokoro/functions/ocr-app.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env_vars: {
99
# Configure the docker image for kokoro-trampoline.
1010
env_vars: {
1111
key: "TRAMPOLINE_IMAGE"
12-
value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user"
12+
value: "gcr.io/cloud-devrel-kokoro-resources/node:16-user"
1313
}
1414

1515
# Tell the trampoline which build file to use.

.kokoro/run/common.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env_vars: {
1818
# Configure the docker image for kokoro-trampoline.
1919
env_vars: {
2020
key: "TRAMPOLINE_IMAGE"
21-
value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user"
21+
value: "gcr.io/cloud-devrel-kokoro-resources/node:16-user"
2222
}
2323

2424
# Export XUnit test results for further analysis

ai-platform/snippets/create-training-pipeline-image-classification.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ function main(
8181
const request = {parent, trainingPipeline};
8282

8383
// Create training pipeline request
84-
const [response] = await pipelineServiceClient.createTrainingPipeline(
85-
request
86-
);
84+
const [response] =
85+
await pipelineServiceClient.createTrainingPipeline(request);
8786

8887
console.log('Create training pipeline image classification response');
8988
console.log(`Name : ${response.name}`);

ai-platform/snippets/create-training-pipeline-image-object-detection.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ async function main(
7979
};
8080

8181
// Create training pipeline request
82-
const [response] = await pipelineServiceClient.createTrainingPipeline(
83-
request
84-
);
82+
const [response] =
83+
await pipelineServiceClient.createTrainingPipeline(request);
8584

8685
console.log('Create training pipeline image object detection response');
8786
console.log(`Name : ${response.name}`);

ai-platform/snippets/create-training-pipeline-tabular-classification.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ async function main(
9393
};
9494

9595
// Create training pipeline request
96-
const [response] = await pipelineServiceClient.createTrainingPipeline(
97-
request
98-
);
96+
const [response] =
97+
await pipelineServiceClient.createTrainingPipeline(request);
9998

10099
console.log('Create training pipeline tabular classification response');
101100
console.log(`Name : ${response.name}`);

ai-platform/snippets/create-training-pipeline-tabular-regression.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,8 @@ async function main(
118118
};
119119

120120
// Create training pipeline request
121-
const [response] = await pipelineServiceClient.createTrainingPipeline(
122-
request
123-
);
121+
const [response] =
122+
await pipelineServiceClient.createTrainingPipeline(request);
124123

125124
console.log('Create training pipeline tabular regression response');
126125
console.log(`Name : ${response.name}`);

ai-platform/snippets/create-training-pipeline-text-classification.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ async function main(
7474
};
7575

7676
// Create training pipeline request
77-
const [response] = await pipelineServiceClient.createTrainingPipeline(
78-
request
79-
);
77+
const [response] =
78+
await pipelineServiceClient.createTrainingPipeline(request);
8079

8180
console.log('Create training pipeline text classification response :');
8281
console.log(`Name : ${response.name}`);

ai-platform/snippets/create-training-pipeline-text-entity-extraction.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ async function main(
7272
};
7373

7474
// Create training pipeline request
75-
const [response] = await pipelineServiceClient.createTrainingPipeline(
76-
request
77-
);
75+
const [response] =
76+
await pipelineServiceClient.createTrainingPipeline(request);
7877

7978
console.log('Create training pipeline text entity extraction response :');
8079
console.log(`Name : ${response.name}`);

ai-platform/snippets/create-training-pipeline-text-sentiment-analysis.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ async function main(
7474
};
7575

7676
// Create training pipeline request
77-
const [response] = await pipelineServiceClient.createTrainingPipeline(
78-
request
79-
);
77+
const [response] =
78+
await pipelineServiceClient.createTrainingPipeline(request);
8079

8180
console.log('Create training pipeline text sentiment analysis response :');
8281
console.log(`Name : ${response.name}`);

ai-platform/snippets/create-training-pipeline-video-action-recognition.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ async function main(
7676
};
7777

7878
// Create training pipeline request
79-
const [response] = await pipelineServiceClient.createTrainingPipeline(
80-
request
81-
);
79+
const [response] =
80+
await pipelineServiceClient.createTrainingPipeline(request);
8281

8382
console.log('Create training pipeline video action recognition response');
8483
console.log(`Name : ${response.name}`);

ai-platform/snippets/create-training-pipeline-video-classification.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ async function main(
7474
};
7575

7676
// Create training pipeline request
77-
const [response] = await pipelineServiceClient.createTrainingPipeline(
78-
request
79-
);
77+
const [response] =
78+
await pipelineServiceClient.createTrainingPipeline(request);
8079

8180
console.log('Create training pipeline video classification response');
8281
console.log(`Name : ${response.name}`);

ai-platform/snippets/create-training-pipeline-video-object-tracking.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ async function main(
7676
};
7777

7878
// Create training pipeline request
79-
const [response] = await pipelineServiceClient.createTrainingPipeline(
80-
request
81-
);
79+
const [response] =
80+
await pipelineServiceClient.createTrainingPipeline(request);
8281

8382
console.log('Create training pipeline video object tracking response');
8483
console.log(`Name : ${response.name}`);

ai-platform/snippets/get-hyperparameter-tuning-job.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ async function main(tuningJobId, project, location = 'us-central1') {
4949
name,
5050
};
5151
// Get and print out a list of all the endpoints for this resource
52-
const [response] = await jobServiceClient.getHyperparameterTuningJob(
53-
request
54-
);
52+
const [response] =
53+
await jobServiceClient.getHyperparameterTuningJob(request);
5554

5655
console.log('Get hyperparameter tuning job response');
5756
console.log(`\tDisplay name: ${response.displayName}`);

ai-platform/snippets/get-model-evaluation-slice.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ async function main(
5959
};
6060

6161
// Get and print out a list of all the endpoints for this resource
62-
const [response] = await modelServiceClient.getModelEvaluationSlice(
63-
request
64-
);
62+
const [response] =
63+
await modelServiceClient.getModelEvaluationSlice(request);
6564

6665
console.log('Get model evaluation slice');
6766
console.log(`\tName : ${response.name}`);

ai-platform/snippets/list-model-evaluation-slices.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ async function main(modelId, evaluationId, project, location = 'us-central1') {
5454
};
5555

5656
// Get and print out a list of all the evaluation slices for this resource
57-
const [response] = await modelServiceClient.listModelEvaluationSlices(
58-
request
59-
);
57+
const [response] =
58+
await modelServiceClient.listModelEvaluationSlices(request);
6059
console.log('List model evaluation response', response);
6160
console.log(response);
6261
}

ai-platform/snippets/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "Apache-2.0",
55
"author": "Google LLC",
66
"engines": {
7-
"node": ">=12.0.0"
7+
"node": ">=16.0.0"
88
},
99
"files": [
1010
"*.js"

appengine/hello-world/flexible/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1111
},
1212
"engines": {
13-
"node": ">=18.x.x"
13+
"node": ">=16.0.0"
1414
},
1515
"scripts": {
1616
"start": "node app.js",

appengine/hello-world/standard/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1111
},
1212
"engines": {
13-
"node": ">=14.0.0"
13+
"node": ">=16.0.0"
1414
},
1515
"scripts": {
1616
"start": "node app.js",

appengine/storage/flexible/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "c8 mocha -p -j 2 system-test/*.test.js --exit --timeout=30000"
77
},
88
"engines": {
9-
"node": ">=18.x.x"
9+
"node": ">=16.0.0"
1010
},
1111
"dependencies": {
1212
"@google-cloud/storage": "^7.0.0",

appengine/storage/standard/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "c8 mocha -p -j 2 system-test/*.test.js --exit --timeout=30000"
77
},
88
"engines": {
9-
"node": ">=14.0.0"
9+
"node": ">=16.0.0"
1010
},
1111
"dependencies": {
1212
"@google-cloud/storage": "^7.0.0",

appengine/websockets/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "Apache Version 2.0",
77
"author": "Google Inc.",
88
"engines": {
9-
"node": ">=16.x.x"
9+
"node": ">=16.0.0"
1010
},
1111
"scripts": {
1212
"deploy": "gcloud app deploy",

auth/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1010
},
1111
"engines": {
12-
"node": ">=12.0.0"
12+
"node": ">=16.0.0"
1313
},
1414
"scripts": {
1515
"test:auth": "c8 mocha -p -j 2 system-test/auth.test.js --timeout=30000",

automl/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "Apache-2.0",
55
"author": "Google LLC",
66
"engines": {
7-
"node": ">=12.0.0"
7+
"node": ">=16.0.0"
88
},
99
"repository": "googleapis/nodejs-automl",
1010
"private": true,

batch/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "Apache-2.0",
55
"author": "Google LLC",
66
"engines": {
7-
"node": ">=12.0.0"
7+
"node": ">=16.0.0"
88
},
99
"files": [
1010
"*.js"

cloud-language/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "Apache-2.0",
44
"author": "Google Inc.",
55
"engines": {
6-
"node": ">=12.0.0"
6+
"node": ">=16.0.0"
77
},
88
"repository": "googleapis/nodejs-language",
99
"private": true,

cloud-sql/mysql/mysql/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1010
},
1111
"engines": {
12-
"node": ">=12.0.0"
12+
"node": ">=16.0.0"
1313
},
1414
"scripts": {
1515
"start": "node server/server.js",

cloud-sql/mysql/mysql2/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1010
},
1111
"engines": {
12-
"node": ">=14.0.0"
12+
"node": ">=16.0.0"
1313
},
1414
"scripts": {
1515
"start": "node server/server.js",

cloud-sql/postgres/knex/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1111
},
1212
"engines": {
13-
"node": ">=12.0.0"
13+
"node": ">=16.0.0"
1414
},
1515
"scripts": {
1616
"start": "node server/server.js",

cloud-sql/sqlserver/mssql/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1010
},
1111
"engines": {
12-
"node": ">=12.0.0"
12+
"node": ">=16.0.0"
1313
},
1414
"scripts": {
1515
"start": "node server/server.js",

cloud-sql/sqlserver/tedious/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1010
},
1111
"engines": {
12-
"node": ">=14.0.0"
12+
"node": ">=16.0.0"
1313
},
1414
"scripts": {
1515
"start": "node server/server.js",

cloud-tasks/snippets/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Google Inc.",
66
"private": true,
77
"engines": {
8-
"node": ">=14.0.0"
8+
"node": ">=16.0.0"
99
},
1010
"files": [
1111
"*.js"

cloud-tasks/tutorial-gcf/app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"main": "index.js",
55
"private": true,
66
"engines": {
7-
"node": ">=12.0.0"
7+
"node": ">=16.0.0"
88
},
99
"scripts": {
1010
"start": "node index.js",

0 commit comments

Comments
 (0)