Skip to content

Commit 1d7b9fc

Browse files
authored
chore(fixit): remove redundant region tags (#3676)
* chore(fixit): remove redundant region tags Manually searched docs and confirmed no references remain. Removed these tags: run_user_auth_secrets run_broken_service_upgrade run_broken_service_problem run_broken_service run_pubsub_server run_pubsub_server_setup run_pubsub_handler run_manual_logging run_imageproc_handler_setup run_imageproc_handler_blur run_imageproc_handler_analyze run_imageproc_controller run_imageproc_server * expand license headers to current format
1 parent 4a8fbcb commit 1d7b9fc

File tree

8 files changed

+60
-40
lines changed

8 files changed

+60
-40
lines changed

run/hello-broken/index.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,29 @@
1313
// limitations under the License.
1414

1515
// [START cloudrun_broken_service]
16-
// [START run_broken_service]
1716
const express = require('express');
1817
const app = express();
1918

2019
app.get('/', (req, res) => {
2120
console.log('hello: received request.');
2221

2322
// [START cloudrun_broken_service_problem]
24-
// [START run_broken_service_problem]
2523
const {NAME} = process.env;
2624
if (!NAME) {
2725
// Plain error logs do not appear in Stackdriver Error Reporting.
2826
console.error('Environment validation failed.');
2927
console.error(new Error('Missing required server parameter'));
3028
return res.status(500).send('Internal Server Error');
3129
}
32-
// [END run_broken_service_problem]
3330
// [END cloudrun_broken_service_problem]
3431
res.send(`Hello ${NAME}!`);
3532
});
36-
// [END run_broken_service]
3733
// [END cloudrun_broken_service]
3834

3935
app.get('/improved', (req, res) => {
4036
console.log('hello: received request.');
4137

4238
// [START cloudrun_broken_service_upgrade]
43-
// [START run_broken_service_upgrade]
4439
const NAME = process.env.NAME || 'World';
4540
if (!process.env.NAME) {
4641
console.log(
@@ -50,16 +45,13 @@ app.get('/improved', (req, res) => {
5045
})
5146
);
5247
}
53-
// [END run_broken_service_upgrade]
5448
// [END cloudrun_broken_service_upgrade]
5549
res.send(`Hello ${NAME}!`);
5650
});
5751

5852
// [START cloudrun_broken_service]
59-
// [START run_broken_service]
6053
const port = parseInt(process.env.PORT) || 8080;
6154
app.listen(port, () => {
6255
console.log(`hello: listening on port ${port}`);
6356
});
64-
// [END run_broken_service]
6557
// [END cloudrun_broken_service]

run/idp-sql/secrets.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const {logger} = require('./logging');
1717
// Load the Cloud SQL config from Secret Manager
1818
function getCredConfig() {
1919
// [START cloudrun_user_auth_secrets]
20-
// [START run_user_auth_secrets]
2120
// CLOUD_SQL_CREDENTIALS_SECRET is the resource ID of the secret, passed in by environment variable.
2221
// Format: projects/PROJECT_ID/secrets/SECRET_ID/versions/VERSION
2322
const {CLOUD_SQL_CREDENTIALS_SECRET} = process.env;
@@ -32,7 +31,6 @@ function getCredConfig() {
3231
);
3332
}
3433
}
35-
// [END run_user_auth_secrets]
3634
// [END cloudrun_user_auth_secrets]
3735
logger.info(
3836
'CLOUD_SQL_CREDENTIALS_SECRET env var not set. Defaulting to environment variables.'

run/image-processing/app.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
// Copyright 2020 Google LLC. All rights reserved.
2-
// Use of this source code is governed by the Apache 2.0
3-
// license that can be found in the LICENSE file.
1+
/**
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
416

517
// [START cloudrun_imageproc_controller]
6-
// [START run_imageproc_controller]
718

819
const express = require('express');
920
const app = express();
@@ -58,7 +69,6 @@ app.post('/', async (req, res) => {
5869
res.status(500).send();
5970
}
6071
});
61-
// [END run_imageproc_controller]
6272
// [END cloudrun_imageproc_controller]
6373

6474
module.exports = app;

run/image-processing/image.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
'use strict';
1616

1717
// [START cloudrun_imageproc_handler_setup]
18-
// [START run_imageproc_handler_setup]
1918
const gm = require('gm').subClass({imageMagick: true});
2019
const fs = require('fs');
2120
const {promisify} = require('util');
@@ -27,11 +26,9 @@ const storage = new Storage();
2726
const client = new vision.ImageAnnotatorClient();
2827

2928
const {BLURRED_BUCKET_NAME} = process.env;
30-
// [END run_imageproc_handler_setup]
3129
// [END cloudrun_imageproc_handler_setup]
3230

3331
// [START cloudrun_imageproc_handler_analyze]
34-
// [START run_imageproc_handler_analyze]
3532
// Blurs uploaded images that are flagged as Adult or Violence.
3633
exports.blurOffensiveImages = async event => {
3734
// This event represents the triggering Cloud Storage object.
@@ -61,11 +58,9 @@ exports.blurOffensiveImages = async event => {
6158
throw err;
6259
}
6360
};
64-
// [END run_imageproc_handler_analyze]
6561
// [END cloudrun_imageproc_handler_analyze]
6662

6763
// [START cloudrun_imageproc_handler_blur]
68-
// [START run_imageproc_handler_blur]
6964
// Blurs the given file using ImageMagick, and uploads it to another bucket.
7065
const blurImage = async (file, blurredBucketName) => {
7166
const tempLocalPath = `/tmp/${path.parse(file.name).base}`;
@@ -109,5 +104,4 @@ const blurImage = async (file, blurredBucketName) => {
109104
const unlink = promisify(fs.unlink);
110105
return unlink(tempLocalPath);
111106
};
112-
// [END run_imageproc_handler_blur]
113107
// [END cloudrun_imageproc_handler_blur]

run/image-processing/index.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
// Copyright 2020 Google LLC. All rights reserved.
2-
// Use of this source code is governed by the Apache 2.0
3-
// license that can be found in the LICENSE file.
1+
/**
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
416

517
// [START cloudrun_imageproc_server]
6-
// [START run_imageproc_server]
718
const app = require('./app.js');
819
const PORT = parseInt(parseInt(process.env.PORT)) || 8080;
920

1021
app.listen(PORT, () =>
1122
console.log(`nodejs-image-processing listening on port ${PORT}`)
1223
);
13-
// [END run_imageproc_server]
1424
// [END cloudrun_imageproc_server]

run/logging-manual/app.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ app.get('/', (req, res) => {
1919
const project = process.env.GOOGLE_CLOUD_PROJECT;
2020

2121
// [START cloudrun_manual_logging]
22-
// [START run_manual_logging]
2322

2423
// Uncomment and populate this variable in your code:
2524
// const project = 'The project ID of your function or Cloud Run service';
@@ -52,7 +51,6 @@ app.get('/', (req, res) => {
5251
// Serialize to a JSON string and output.
5352
console.log(JSON.stringify(entry));
5453

55-
// [END run_manual_logging]
5654
// [END cloudrun_manual_logging]
5755

5856
res.send('Hello Logger!');

run/pubsub/app.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
// Copyright 2020 Google LLC. All rights reserved.
2-
// Use of this source code is governed by the Apache 2.0
3-
// license that can be found in the LICENSE file.
1+
/**
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
416

517
// [START cloudrun_pubsub_server_setup]
6-
// [START run_pubsub_server_setup]
718
const express = require('express');
819
const app = express();
920

1021
// This middleware is available in Express v4.16.0 onwards
1122
app.use(express.json());
12-
// [END run_pubsub_server_setup]
1323
// [END cloudrun_pubsub_server_setup]
1424

1525
// [START cloudrun_pubsub_handler]
16-
// [START run_pubsub_handler]
1726
app.post('/', (req, res) => {
1827
if (!req.body) {
1928
const msg = 'no Pub/Sub message received';
@@ -36,7 +45,6 @@ app.post('/', (req, res) => {
3645
console.log(`Hello ${name}!`);
3746
res.status(204).send();
3847
});
39-
// [END run_pubsub_handler]
4048
// [END cloudrun_pubsub_handler]
4149

4250
module.exports = app;

run/pubsub/index.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
// Copyright 2020 Google LLC. All rights reserved.
2-
// Use of this source code is governed by the Apache 2.0
3-
// license that can be found in the LICENSE file.
1+
/**
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
416

517
// [START cloudrun_pubsub_server]
6-
// [START run_pubsub_server]
718
const app = require('./app.js');
819
const PORT = parseInt(parseInt(process.env.PORT)) || 8080;
920

1021
app.listen(PORT, () =>
1122
console.log(`nodejs-pubsub-tutorial listening on port ${PORT}`)
1223
);
13-
// [END run_pubsub_server]
1424
// [END cloudrun_pubsub_server]

0 commit comments

Comments
 (0)