From d674f05b7ee3bfa315e050bbe9243971983491a7 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 12 Nov 2018 16:58:05 -0800 Subject: [PATCH 01/68] initial commit --- scheduler/.eslintrc.yml | 3 +++ scheduler/system-test/.eslintrc.yml | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 scheduler/.eslintrc.yml create mode 100644 scheduler/system-test/.eslintrc.yml diff --git a/scheduler/.eslintrc.yml b/scheduler/.eslintrc.yml new file mode 100644 index 0000000000..282535f55f --- /dev/null +++ b/scheduler/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/scheduler/system-test/.eslintrc.yml b/scheduler/system-test/.eslintrc.yml new file mode 100644 index 0000000000..c0289282a6 --- /dev/null +++ b/scheduler/system-test/.eslintrc.yml @@ -0,0 +1,5 @@ +--- +rules: + node/no-unpublished-require: off + node/no-unsupported-features: off + no-empty: off From 76a7270be064a138babd742d3e62c50b52a33b7d Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 20 Nov 2018 21:09:32 -0800 Subject: [PATCH 02/68] chore: clean up lint rules (#2) --- scheduler/.eslintrc.yml | 1 + scheduler/package.json | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 scheduler/package.json diff --git a/scheduler/.eslintrc.yml b/scheduler/.eslintrc.yml index 282535f55f..ea05271a53 100644 --- a/scheduler/.eslintrc.yml +++ b/scheduler/.eslintrc.yml @@ -1,3 +1,4 @@ --- rules: no-console: off + node/no-missing-require: off \ No newline at end of file diff --git a/scheduler/package.json b/scheduler/package.json new file mode 100644 index 0000000000..af8b185e44 --- /dev/null +++ b/scheduler/package.json @@ -0,0 +1,13 @@ +{ + "name": "nodejs-scheduler-samples", + "private": true, + "main": "quickstart.js", + "files": ["*.js"], + "license": "Apache-2.0", + "dependencies": { + "@google-cloud/scheduler": "^0.1.0" + }, + "devDependencies": { + "mocha": "^5.2.0" + } +} From 540e4e1badafb462f4d16b3c19c2466b40848592 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 7 Dec 2018 15:53:19 -0800 Subject: [PATCH 03/68] Release v0.1.1 (#21) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index af8b185e44..3a33049e45 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -5,7 +5,7 @@ "files": ["*.js"], "license": "Apache-2.0", "dependencies": { - "@google-cloud/scheduler": "^0.1.0" + "@google-cloud/scheduler": "^0.1.1" }, "devDependencies": { "mocha": "^5.2.0" From 56ebd5e646c2fe171feebdda1fdc4b58e12a1935 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 3 Jan 2019 13:55:23 -0800 Subject: [PATCH 04/68] Release v0.1.2 (#29) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 3a33049e45..c566bff0c2 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -5,7 +5,7 @@ "files": ["*.js"], "license": "Apache-2.0", "dependencies": { - "@google-cloud/scheduler": "^0.1.1" + "@google-cloud/scheduler": "^0.1.2" }, "devDependencies": { "mocha": "^5.2.0" From 599a048ce33927d2b9eb93ca1f0a85db78201b1a Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Fri, 25 Jan 2019 11:17:30 -0800 Subject: [PATCH 05/68] docs(samples): Add App Engine Target sample (#33) --- scheduler/.eslintrc.yml | 3 +- scheduler/createJob.js | 60 +++++++++++++++++++++++++++ scheduler/package.json | 20 +++++++-- scheduler/system-test/.eslintrc.yml | 2 + scheduler/system-test/test.samples.js | 59 ++++++++++++++++++++++++++ 5 files changed, 140 insertions(+), 4 deletions(-) create mode 100644 scheduler/createJob.js create mode 100644 scheduler/system-test/test.samples.js diff --git a/scheduler/.eslintrc.yml b/scheduler/.eslintrc.yml index ea05271a53..8ed0e67e47 100644 --- a/scheduler/.eslintrc.yml +++ b/scheduler/.eslintrc.yml @@ -1,4 +1,5 @@ --- rules: no-console: off - node/no-missing-require: off \ No newline at end of file + node/no-missing-require: off + no-warning-comments: off diff --git a/scheduler/createJob.js b/scheduler/createJob.js new file mode 100644 index 0000000000..ff418e3dc5 --- /dev/null +++ b/scheduler/createJob.js @@ -0,0 +1,60 @@ +/** + * Copyright 2018, Google LLC + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Create a job with an App Engine target via the Cloud Scheduler API + */ +async function createJob(projectId, locationId, serviceId) { + // [START cloud_scheduler_create_job] + const scheduler = require('@google-cloud/scheduler'); + + // Create a client. + const client = new scheduler.CloudSchedulerClient(); + + // TODO(developer): Uncomment and set the following variables + // const projectId = "PROJECT_ID" + // const locationId = "LOCATION_ID" + // const serviceId = "my-serivce" + + // Construct the fully qualified location path. + const parent = client.locationPath(projectId, locationId); + + // Construct the request body. + const job = { + appEngineHttpTarget: { + appEngineRouting: { + service: serviceId, + }, + relativeUri: '/log_payload', + httpMethod: 'POST', + body: Buffer.from('Hello World'), //.toString("base64"), + }, + schedule: '* * * * *', + timeZone: 'America/Los_Angeles', + }; + + const request = { + parent: parent, + job: job, + }; + + // Use the client to send the job creation request. + const [response] = await client.createJob(request); + console.log(`Created job: ${response.name}`); + // [END cloud_scheduler_create_job] +} + +const args = process.argv.slice(2); +createJob(...args).catch(console.error); diff --git a/scheduler/package.json b/scheduler/package.json index c566bff0c2..5fa1071440 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -2,12 +2,26 @@ "name": "nodejs-scheduler-samples", "private": true, "main": "quickstart.js", - "files": ["*.js"], + "engines": { + "node": ">=8" + }, + "files": [ + "*.js" + ], "license": "Apache-2.0", + "scripts": { + "start": "node app.js", + "test": "mocha system-test --timeout 10000 --exit" + }, "dependencies": { - "@google-cloud/scheduler": "^0.1.2" + "@google-cloud/scheduler": "^0.1.2", + "body-parser": "^1.18.3", + "express": "^4.16.4" }, "devDependencies": { - "mocha": "^5.2.0" + "chai": "^4.2.0", + "execa": "^1.0.0", + "mocha": "^5.2.0", + "supertest": "^3.3.0" } } diff --git a/scheduler/system-test/.eslintrc.yml b/scheduler/system-test/.eslintrc.yml index c0289282a6..752164361d 100644 --- a/scheduler/system-test/.eslintrc.yml +++ b/scheduler/system-test/.eslintrc.yml @@ -1,4 +1,6 @@ --- +env: + mocha: true rules: node/no-unpublished-require: off node/no-unsupported-features: off diff --git a/scheduler/system-test/test.samples.js b/scheduler/system-test/test.samples.js new file mode 100644 index 0000000000..67da83470e --- /dev/null +++ b/scheduler/system-test/test.samples.js @@ -0,0 +1,59 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const path = require('path'); +const {assert} = require('chai'); +const execa = require('execa'); +const supertest = require('supertest'); +const app = require('../app.js'); +const request = supertest(app); + +const PROJECT_ID = process.env.GCLOUD_PROJECT; +const LOCATION_ID = process.env.LOCATION_ID || 'us-central1'; +const SERVICE_ID = 'my-service'; + +const cwd = path.join(__dirname, '../'); +const exec = cmd => execa.shell(cmd, {cwd}); + +describe('Cloud Scheduler Sample Tests', () => { + let jobName; + + it('should create and delete a scheduler job', async () => { + const {stdout} = await exec( + `node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}` + ); + assert.match(stdout, /Created job/); + jobName = stdout.split('/').pop(); + }); + + it('should delete a scheduler job', async () => { + const {stdout} = await exec( + `node deleteJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` + ); + assert.match(stdout, /Job deleted/); + }); +}); + +describe('Server should respond to /log_payload', () => { + it('should log the payload', done => { + const body = Buffer.from('test'); + request + .post(`/log_payload`) + .type('raw') + .send(body) + .expect(200, /Printed job/, done); + }); +}); From 04cd748f1af97901fd80b6399782ff8e56486a50 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 19 Feb 2019 10:04:12 -0800 Subject: [PATCH 06/68] chore(deps): update dependency mocha to v6 chore(deps): update dependency mocha to v6 This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---| | mocha | devDependencies | major | `^5.2.0` -> `^6.0.0` | [homepage](https://mochajs.org/), [source](https://togithub.com/mochajs/mocha) | --- ### Release Notes
mochajs/mocha ### [`v6.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​600--2019-02-18) [Compare Source](https://togithub.com/mochajs/mocha/compare/v5.2.0...v6.0.0) #### :tada: Enhancements - [#​3726](https://togithub.com/mochajs/mocha/issues/3726): Add ability to unload files from `require` cache ([**@​plroebuck**](https://togithub.com/plroebuck)) #### :bug: Fixes - [#​3737](https://togithub.com/mochajs/mocha/issues/3737): Fix falsy values from options globals ([**@​plroebuck**](https://togithub.com/plroebuck)) - [#​3707](https://togithub.com/mochajs/mocha/issues/3707): Fix encapsulation issues for `Suite#_onlyTests` and `Suite#_onlySuites` ([**@​vkarpov15**](https://togithub.com/vkarpov15)) - [#​3711](https://togithub.com/mochajs/mocha/issues/3711): Fix diagnostic messages dealing with plurality and markup of output ([**@​plroebuck**](https://togithub.com/plroebuck)) - [#​3723](https://togithub.com/mochajs/mocha/issues/3723): Fix "reporter-option" to allow comma-separated options ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3722](https://togithub.com/mochajs/mocha/issues/3722): Fix code quality and performance of `lookupFiles` and `files` ([**@​plroebuck**](https://togithub.com/plroebuck)) - [#​3650](https://togithub.com/mochajs/mocha/issues/3650), [#​3654](https://togithub.com/mochajs/mocha/issues/3654): Fix noisy error message when no files found ([**@​craigtaub**](https://togithub.com/craigtaub)) - [#​3632](https://togithub.com/mochajs/mocha/issues/3632): Tests having an empty title are no longer confused with the "root" suite ([**@​juergba**](https://togithub.com/juergba)) - [#​3666](https://togithub.com/mochajs/mocha/issues/3666): Fix missing error codes ([**@​vkarpov15**](https://togithub.com/vkarpov15)) - [#​3684](https://togithub.com/mochajs/mocha/issues/3684): Fix exiting problem in Node.js v11.7.0+ ([**@​addaleax**](https://togithub.com/addaleax)) - [#​3691](https://togithub.com/mochajs/mocha/issues/3691): Fix `--delay` (and other boolean options) not working in all cases ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3692](https://togithub.com/mochajs/mocha/issues/3692): Fix invalid command-line argument usage not causing actual errors ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3698](https://togithub.com/mochajs/mocha/issues/3698), [#​3699](https://togithub.com/mochajs/mocha/issues/3699): Fix debug-related Node.js options not working in all cases ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3700](https://togithub.com/mochajs/mocha/issues/3700): Growl notifications now show the correct number of tests run ([**@​outsideris**](https://togithub.com/outsideris)) - [#​3686](https://togithub.com/mochajs/mocha/issues/3686): Avoid potential ReDoS when diffing large objects ([**@​cyjake**](https://togithub.com/cyjake)) - [#​3715](https://togithub.com/mochajs/mocha/issues/3715): Fix incorrect order of emitted events when used programmatically ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3706](https://togithub.com/mochajs/mocha/issues/3706): Fix regression wherein `--reporter-option`/`--reporter-options` did not support comma-separated key/value pairs ([**@​boneskull**](https://togithub.com/boneskull)) #### :book: Documentation - [#​3652](https://togithub.com/mochajs/mocha/issues/3652): Switch from Jekyll to Eleventy ([**@​Munter**](https://togithub.com/Munter)) #### :nut_and_bolt: Other - [#​3677](https://togithub.com/mochajs/mocha/issues/3677): Add error objects for createUnsupportedError and createInvalidExceptionError ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3733](https://togithub.com/mochajs/mocha/issues/3733): Removed unnecessary processing in post-processing hook ([**@​wanseob**](https://togithub.com/wanseob)) - [#​3730](https://togithub.com/mochajs/mocha/issues/3730): Update nyc to latest version ([**@​coreyfarrell**](https://togithub.com/coreyfarrell)) - [#​3648](https://togithub.com/mochajs/mocha/issues/3648), [#​3680](https://togithub.com/mochajs/mocha/issues/3680): Fixes to support latest versions of [unexpected](https://npm.im/unexpected) and [unexpected-sinon](https://npm.im/unexpected-sinon) ([**@​sunesimonsen**](https://togithub.com/sunesimonsen)) - [#​3638](https://togithub.com/mochajs/mocha/issues/3638): Add meta tag to site ([**@​MartijnCuppens**](https://togithub.com/MartijnCuppens)) - [#​3653](https://togithub.com/mochajs/mocha/issues/3653): Fix parts of test suite failing to run on Windows ([**@​boneskull**](https://togithub.com/boneskull))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`". :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-scheduler). #51 automerged by dpebot --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 5fa1071440..16ac79e58d 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -21,7 +21,7 @@ "devDependencies": { "chai": "^4.2.0", "execa": "^1.0.0", - "mocha": "^5.2.0", + "mocha": "^6.0.0", "supertest": "^3.3.0" } } From 8226a660bc32c9f68019eb18509d0ed6fb7fd419 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 9 Mar 2019 12:05:22 -0800 Subject: [PATCH 07/68] chore(deps): update dependency supertest to v4 chore(deps): update dependency supertest to v4 This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---| | supertest | devDependencies | major | [`^3.3.0` -> `^4.0.0`](https://diff.intrinsic.com/supertest/3.4.2/4.0.0) | [source](https://togithub.com/visionmedia/supertest) | --- ### Release Notes
visionmedia/supertest ### [`v4.0.0`](https://togithub.com/visionmedia/supertest/releases/v4.0.0) [Compare Source](https://togithub.com/visionmedia/supertest/compare/v3.4.2...v4.0.0) - Merge pull request [#​539](https://togithub.com/visionmedia/supertest/issues/539) from ozzywalsh/fix-agent-defaults [`abf6bc3`](https://togithub.com/visionmedia/supertest/commit/abf6bc3) - Merge pull request [#​554](https://togithub.com/visionmedia/supertest/issues/554) from visionmedia/use-trust-localhost [`5914936`](https://togithub.com/visionmedia/supertest/commit/5914936)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`". :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-scheduler). #58 automerged by dpebot --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 16ac79e58d..f60943446b 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -22,6 +22,6 @@ "chai": "^4.2.0", "execa": "^1.0.0", "mocha": "^6.0.0", - "supertest": "^3.3.0" + "supertest": "^4.0.0" } } From 0d6c23a57536c8bb0695ead1edbb4bc71096ea9d Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 11 Mar 2019 12:58:24 -0700 Subject: [PATCH 08/68] Release v0.2.0 (#61) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index f60943446b..aac81af3f0 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha system-test --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^0.1.2", + "@google-cloud/scheduler": "^0.2.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From db7a2a591ce1853c28b95e5344ceaf0357ed6630 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 4 Apr 2019 13:56:08 -0700 Subject: [PATCH 09/68] Release v0.3.0 (#71) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index aac81af3f0..5629d4d165 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha system-test --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^0.2.0", + "@google-cloud/scheduler": "^0.3.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 2223f1a1e0bc7f889ad6cbcf6be8a83a59f71c7f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 4 Apr 2019 15:55:07 -0700 Subject: [PATCH 10/68] refactor: use execSync for tests (#69) --- scheduler/package.json | 1 - scheduler/system-test/test.samples.js | 15 +++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/scheduler/package.json b/scheduler/package.json index 5629d4d165..ac7817d365 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -20,7 +20,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "execa": "^1.0.0", "mocha": "^6.0.0", "supertest": "^4.0.0" } diff --git a/scheduler/system-test/test.samples.js b/scheduler/system-test/test.samples.js index 67da83470e..f08c9f1a62 100644 --- a/scheduler/system-test/test.samples.js +++ b/scheduler/system-test/test.samples.js @@ -14,9 +14,8 @@ 'use strict'; -const path = require('path'); const {assert} = require('chai'); -const execa = require('execa'); +const {execSync} = require('child_process'); const supertest = require('supertest'); const app = require('../app.js'); const request = supertest(app); @@ -25,22 +24,22 @@ const PROJECT_ID = process.env.GCLOUD_PROJECT; const LOCATION_ID = process.env.LOCATION_ID || 'us-central1'; const SERVICE_ID = 'my-service'; -const cwd = path.join(__dirname, '../'); -const exec = cmd => execa.shell(cmd, {cwd}); - describe('Cloud Scheduler Sample Tests', () => { let jobName; it('should create and delete a scheduler job', async () => { - const {stdout} = await exec( + const stdout = execSync( `node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}` ); assert.match(stdout, /Created job/); - jobName = stdout.split('/').pop(); + jobName = stdout + .toString() + .split('/') + .pop(); }); it('should delete a scheduler job', async () => { - const {stdout} = await exec( + const stdout = execSync( `node deleteJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` ); assert.match(stdout, /Job deleted/); From 02eaf72b7a11b0c3ce56529e7beba18deec6ddd0 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 4 Apr 2019 18:34:39 -0700 Subject: [PATCH 11/68] refactor: wrap execSync with encoding: utf-8 (#73) --- scheduler/system-test/test.samples.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scheduler/system-test/test.samples.js b/scheduler/system-test/test.samples.js index f08c9f1a62..2db2742832 100644 --- a/scheduler/system-test/test.samples.js +++ b/scheduler/system-test/test.samples.js @@ -15,11 +15,13 @@ 'use strict'; const {assert} = require('chai'); -const {execSync} = require('child_process'); +const cp = require('child_process'); const supertest = require('supertest'); const app = require('../app.js'); const request = supertest(app); +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + const PROJECT_ID = process.env.GCLOUD_PROJECT; const LOCATION_ID = process.env.LOCATION_ID || 'us-central1'; const SERVICE_ID = 'my-service'; @@ -32,10 +34,7 @@ describe('Cloud Scheduler Sample Tests', () => { `node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}` ); assert.match(stdout, /Created job/); - jobName = stdout - .toString() - .split('/') - .pop(); + jobName = stdout.split('/').pop(); }); it('should delete a scheduler job', async () => { From ff452b53b32fe5ab87ad4483c895ad5f2ec6aabc Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 24 Apr 2019 15:35:54 -0700 Subject: [PATCH 12/68] docs: update to useful quickstart docs: update to useful quickstart * adds a quickstart that does more than simply pull in the library. * demonstrates the new `sample-metadata:` stanza we can provide in samples. - [x] Tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) CC: @steffnay #78 automerged by dpebot --- scheduler/createJob.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scheduler/createJob.js b/scheduler/createJob.js index ff418e3dc5..15cbd1ed77 100644 --- a/scheduler/createJob.js +++ b/scheduler/createJob.js @@ -13,6 +13,11 @@ * limitations under the License. */ +// sample-metadata: +// title: Create Job +// description: Create a job that posts to /log_payload on an App Engine service. +// usage: node createJob.js [project-id] [location-id] [app-engine-service-id] + /** * Create a job with an App Engine target via the Cloud Scheduler API */ @@ -57,4 +62,7 @@ async function createJob(projectId, locationId, serviceId) { } const args = process.argv.slice(2); -createJob(...args).catch(console.error); +createJob(...args).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); From 75231ae8d1b018d58939427c6432dde1040c5c6c Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 29 Apr 2019 18:46:15 -0700 Subject: [PATCH 13/68] test: add a smoke test and perform cleanup (#80) --- scheduler/package.json | 2 +- scheduler/system-test/.eslintrc.yml | 7 ------- scheduler/test/.eslintrc.yml | 3 +++ scheduler/{system-test => test}/test.samples.js | 0 4 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 scheduler/system-test/.eslintrc.yml create mode 100644 scheduler/test/.eslintrc.yml rename scheduler/{system-test => test}/test.samples.js (100%) diff --git a/scheduler/package.json b/scheduler/package.json index ac7817d365..f48bfa7c0c 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -11,7 +11,7 @@ "license": "Apache-2.0", "scripts": { "start": "node app.js", - "test": "mocha system-test --timeout 10000 --exit" + "test": "mocha --timeout 10000 --exit" }, "dependencies": { "@google-cloud/scheduler": "^0.3.0", diff --git a/scheduler/system-test/.eslintrc.yml b/scheduler/system-test/.eslintrc.yml deleted file mode 100644 index 752164361d..0000000000 --- a/scheduler/system-test/.eslintrc.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -env: - mocha: true -rules: - node/no-unpublished-require: off - node/no-unsupported-features: off - no-empty: off diff --git a/scheduler/test/.eslintrc.yml b/scheduler/test/.eslintrc.yml new file mode 100644 index 0000000000..6db2a46c53 --- /dev/null +++ b/scheduler/test/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +env: + mocha: true diff --git a/scheduler/system-test/test.samples.js b/scheduler/test/test.samples.js similarity index 100% rename from scheduler/system-test/test.samples.js rename to scheduler/test/test.samples.js From a483ece6f745a8bb7481467ba50a983d9b795677 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 13 May 2019 15:53:34 -0700 Subject: [PATCH 14/68] chore: release 1.0.0 (#95) * updated CHANGELOG.md * updated package.json * updated samples/package.json * switch to ga, which we're exporting now * docs: regenerate README to reflect GA --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index f48bfa7c0c..918e745b79 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^0.3.0", + "@google-cloud/scheduler": "^1.0.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From a1b42b8c28599c292f8669b098ebcd7cd8002bba Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 5 Jun 2019 09:52:59 -0700 Subject: [PATCH 15/68] chore: release 1.1.0 (#105) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 918e745b79..9a697416ba 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.0.0", + "@google-cloud/scheduler": "^1.1.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 872de47ca1f2c3c5b2d1f4d617f88f6f95e2a8c7 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 10 Jun 2019 17:20:04 -0700 Subject: [PATCH 16/68] chore(deps): npm audit fix (#106) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 9a697416ba..33de76635c 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^6.0.0", + "mocha": "^6.1.4", "supertest": "^4.0.0" } } From 93eb955e23dface76b5f547269f9173fd84d27ac Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 14 Jun 2019 08:06:02 -0700 Subject: [PATCH 17/68] chore: release 1.1.1 (#109) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 33de76635c..02ad97d7b7 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.1.0", + "@google-cloud/scheduler": "^1.1.1", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 116cb823ec2ae4b497dbcadca49f0411c4b90db5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 27 Jun 2019 00:30:00 -0700 Subject: [PATCH 18/68] chore: release 1.1.2 (#112) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 02ad97d7b7..794cf466ed 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.1.1", + "@google-cloud/scheduler": "^1.1.2", "body-parser": "^1.18.3", "express": "^4.16.4" }, From e58e45f682809b44967ec9243260a1b5805c357d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Aug 2019 09:53:34 -0700 Subject: [PATCH 19/68] chore: release 1.1.3 (#121) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 794cf466ed..8f0fa1b2e2 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.1.2", + "@google-cloud/scheduler": "^1.1.3", "body-parser": "^1.18.3", "express": "^4.16.4" }, From a02e2a624b97d406581f298c932058abacc6ac92 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 25 Aug 2019 19:31:40 -0700 Subject: [PATCH 20/68] chore: release 1.1.4 (#123) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 8f0fa1b2e2..66f3abf408 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.1.3", + "@google-cloud/scheduler": "^1.1.4", "body-parser": "^1.18.3", "express": "^4.16.4" }, From bca17457ec7af4886ec3816c8baa96ac762c3625 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 6 Sep 2019 08:39:17 -0700 Subject: [PATCH 21/68] chore: release 1.2.0 (#128) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 66f3abf408..07c854ac6c 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.1.4", + "@google-cloud/scheduler": "^1.2.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 2b7b1224e3a400426cfdc5f2b62128ab48930dc2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2019 13:31:30 -0700 Subject: [PATCH 22/68] chore: release 1.3.2 (#148) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 07c854ac6c..fd38e664be 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.2.0", + "@google-cloud/scheduler": "^1.3.2", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 106963c17bb5fc6390a838bd25a6b5c7f8794fb7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2019 14:24:45 -0800 Subject: [PATCH 23/68] chore: release 1.3.3 (#157) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index fd38e664be..726711fb9b 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.3.2", + "@google-cloud/scheduler": "^1.3.3", "body-parser": "^1.18.3", "express": "^4.16.4" }, From bc306e8be5151041c7f63f70daa849cbbca4c21a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 25 Nov 2019 08:57:49 -0800 Subject: [PATCH 24/68] chore: update license headers (#164) --- scheduler/createJob.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/scheduler/createJob.js b/scheduler/createJob.js index 15cbd1ed77..e912fcf850 100644 --- a/scheduler/createJob.js +++ b/scheduler/createJob.js @@ -1,17 +1,16 @@ -/** - * Copyright 2018, Google LLC - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // sample-metadata: // title: Create Job From 73bbaabb37d8380b5041ced8f38c465ce0a8ce9f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 30 Dec 2019 12:02:20 -0800 Subject: [PATCH 25/68] refactor: use explicit mocha imports (#173) * refactor: use explicit mocha imports * fix imports --- scheduler/test/.eslintrc.yml | 3 --- scheduler/test/test.samples.js | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 scheduler/test/.eslintrc.yml diff --git a/scheduler/test/.eslintrc.yml b/scheduler/test/.eslintrc.yml deleted file mode 100644 index 6db2a46c53..0000000000 --- a/scheduler/test/.eslintrc.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -env: - mocha: true diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index 2db2742832..b61655abc3 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const cp = require('child_process'); const supertest = require('supertest'); const app = require('../app.js'); From 3aa1106f9339eb8de2db7a8b2325d7bc8c863367 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2020 10:46:57 -0800 Subject: [PATCH 26/68] chore: release 1.4.0 * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 726711fb9b..fb1da21730 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.3.3", + "@google-cloud/scheduler": "^1.4.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From bca739bf52fd1084cf6cdfd114f62c39154e34e0 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 7 Jan 2020 00:15:56 +0200 Subject: [PATCH 27/68] chore(deps): update dependency mocha to v7 (#175) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index fb1da21730..3c64cdd38e 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^6.1.4", + "mocha": "^7.0.0", "supertest": "^4.0.0" } } From 95b33c2ed91431c035fce776d0c91a959201827a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2020 13:13:39 -0800 Subject: [PATCH 28/68] chore: release 1.4.1 (#177) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 3c64cdd38e..c134ccecbf 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.4.0", + "@google-cloud/scheduler": "^1.4.1", "body-parser": "^1.18.3", "express": "^4.16.4" }, From c49a18772aca29897165ed7dd5802153bfab44c8 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 23 Jan 2020 16:41:25 -0800 Subject: [PATCH 29/68] fix(samples): delete stale comment from sample (#182) Co-authored-by: Justin Beckwith --- scheduler/createJob.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/createJob.js b/scheduler/createJob.js index e912fcf850..257126886c 100644 --- a/scheduler/createJob.js +++ b/scheduler/createJob.js @@ -43,7 +43,7 @@ async function createJob(projectId, locationId, serviceId) { }, relativeUri: '/log_payload', httpMethod: 'POST', - body: Buffer.from('Hello World'), //.toString("base64"), + body: Buffer.from('Hello World'), }, schedule: '* * * * *', timeZone: 'America/Los_Angeles', From 5b2ff36196efc4033bd696160115a6aab6a04811 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2020 21:04:23 -0800 Subject: [PATCH 30/68] chore: release 1.4.2 (#186) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index c134ccecbf..f0dba1517b 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.4.1", + "@google-cloud/scheduler": "^1.4.2", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 8736416bfb8544ab1da42188c2dba82698059794 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2020 11:17:58 -0800 Subject: [PATCH 31/68] chore: release 1.4.3 (#197) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index f0dba1517b..0c60a50544 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.4.2", + "@google-cloud/scheduler": "^1.4.3", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 201b5d785fc176954998cb5b66a5e42c8a440f6e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 16:32:20 -0800 Subject: [PATCH 32/68] chore: release 1.5.0 (#203) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 0c60a50544..b5682592b9 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.4.3", + "@google-cloud/scheduler": "^1.5.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 6f954e5b02fdbc1c6018b3cbbd0001d86fed1379 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2020 14:18:38 -0700 Subject: [PATCH 33/68] chore: release 1.6.0 (#213) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index b5682592b9..09eca1ea40 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.5.0", + "@google-cloud/scheduler": "^1.6.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From bff5fd5652c98d933c2f7d3915c823902f5041aa Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 31 Mar 2020 13:45:33 -0700 Subject: [PATCH 34/68] feat!: drop node8 support, support for async iterators (#227) BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. New feature: methods with pagination now support async iteration. --- scheduler/test/test.samples.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index b61655abc3..9475624ab7 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -50,7 +50,7 @@ describe('Server should respond to /log_payload', () => { it('should log the payload', done => { const body = Buffer.from('test'); request - .post(`/log_payload`) + .post('/log_payload') .type('raw') .send(body) .expect(200, /Printed job/, done); From e96988f9fa9fa841c1745c4148d997a364d8e383 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 19:03:32 -0700 Subject: [PATCH 35/68] fix: drop unused files from package (#242) --- scheduler/.eslintrc.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/scheduler/.eslintrc.yml b/scheduler/.eslintrc.yml index 8ed0e67e47..282535f55f 100644 --- a/scheduler/.eslintrc.yml +++ b/scheduler/.eslintrc.yml @@ -1,5 +1,3 @@ --- rules: no-console: off - node/no-missing-require: off - no-warning-comments: off From 16e46e10ff9802276425d45e17f234c7db6aab5f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2020 14:52:56 -0700 Subject: [PATCH 36/68] chore: release 2.0.0 (#228) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 09eca1ea40..e91ba47cc5 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^1.6.0", + "@google-cloud/scheduler": "^2.0.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 7ab65bfc87d518ce88553d1c25caa231918c76d0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Jun 2020 17:51:24 +0200 Subject: [PATCH 37/68] chore(deps): update dependency mocha to v8 (#259) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/mocha/7.2.0/8.0.1) | --- ### Release Notes
mochajs/mocha ### [`v8.0.1`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​801--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v8.0.0...v8.0.1) The obligatory patch after a major. #### :bug: Fixes - [#​4328](https://togithub.com/mochajs/mocha/issues/4328): Fix `--parallel` when combined with `--watch` ([**@​boneskull**](https://togithub.com/boneskull)) ### [`v8.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​800--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v7.2.0...v8.0.0) In this major release, Mocha adds the ability to _run tests in parallel_. Better late than never! Please note the **breaking changes** detailed below. Let's welcome [**@​giltayar**](https://togithub.com/giltayar) and [**@​nicojs**](https://togithub.com/nicojs) to the maintenance team! #### :boom: Breaking Changes - [#​4164](https://togithub.com/mochajs/mocha/issues/4164): **Mocha v8.0.0 now requires Node.js v10.0.0 or newer.** Mocha no longer supports the Node.js v8.x line ("Carbon"), which entered End-of-Life at the end of 2019 ([**@​UlisesGascon**](https://togithub.com/UlisesGascon)) - [#​4175](https://togithub.com/mochajs/mocha/issues/4175): Having been deprecated with a warning since v7.0.0, **`mocha.opts` is no longer supported** ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND:** Replace `mocha.opts` with a [configuration file](https://mochajs.org/#configuring-mocha-nodejs). - [#​4260](https://togithub.com/mochajs/mocha/issues/4260): Remove `enableTimeout()` (`this.enableTimeout()`) from the context object ([**@​craigtaub**](https://togithub.com/craigtaub)) :sparkles: **WORKAROUND:** Replace usage of `this.enableTimeout(false)` in your tests with `this.timeout(0)`. - [#​4315](https://togithub.com/mochajs/mocha/issues/4315): The `spec` option no longer supports a comma-delimited list of files ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND**: Use an array instead (e.g., `"spec": "foo.js,bar.js"` becomes `"spec": ["foo.js", "bar.js"]`). - [#​4309](https://togithub.com/mochajs/mocha/issues/4309): Drop support for Node.js v13.x line, which is now End-of-Life ([**@​juergba**](https://togithub.com/juergba)) - [#​4282](https://togithub.com/mochajs/mocha/issues/4282): `--forbid-only` will throw an error even if exclusive tests are avoided via `--grep` or other means ([**@​arvidOtt**](https://togithub.com/arvidOtt)) - [#​4223](https://togithub.com/mochajs/mocha/issues/4223): The context object's `skip()` (`this.skip()`) in a "before all" (`before()`) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites ([**@​juergba**](https://togithub.com/juergba)) - [#​4178](https://togithub.com/mochajs/mocha/issues/4178): Remove previously soft-deprecated APIs ([**@​wnghdcjfe**](https://togithub.com/wnghdcjfe)): - `Mocha.prototype.ignoreLeaks()` - `Mocha.prototype.useColors()` - `Mocha.prototype.useInlineDiffs()` - `Mocha.prototype.hideDiff()` #### :tada: Enhancements - [#​4245](https://togithub.com/mochajs/mocha/issues/4245): Add ability to run tests in parallel for Node.js (see [docs](https://mochajs.org/#parallel-tests)) ([**@​boneskull**](https://togithub.com/boneskull)) :exclamation: See also [#​4244](https://togithub.com/mochajs/mocha/issues/4244); [Root Hook Plugins (docs)](https://mochajs.org/#root-hook-plugins) -- _root hooks must be defined via Root Hook Plugins to work in parallel mode_ - [#​4304](https://togithub.com/mochajs/mocha/issues/4304): `--require` now works with ES modules ([**@​JacobLey**](https://togithub.com/JacobLey)) - [#​4299](https://togithub.com/mochajs/mocha/issues/4299): In some circumstances, Mocha can run ES modules under Node.js v10 -- _use at your own risk!_ ([**@​giltayar**](https://togithub.com/giltayar)) #### :book: Documentation - [#​4246](https://togithub.com/mochajs/mocha/issues/4246): Add documentation for parallel mode and Root Hook plugins ([**@​boneskull**](https://togithub.com/boneskull)) #### :bug: Fixes (All bug fixes in Mocha v8.0.0 are also breaking changes, and are listed above)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-scheduler). --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index e91ba47cc5..f955b28d50 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "supertest": "^4.0.0" } } From f4cf6b4ae7f7debd9023e337e8c313d926e80fef Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2020 11:44:42 -0700 Subject: [PATCH 38/68] chore: release 2.1.0 (#260) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index f955b28d50..f5240d2779 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.0.0", + "@google-cloud/scheduler": "^2.1.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 47ea5243703560ca3a3eeb926217d035c7e17a08 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2020 13:12:52 -0700 Subject: [PATCH 39/68] chore: release 2.1.1 (#264) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index f5240d2779..5135d4ea8d 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.1.0", + "@google-cloud/scheduler": "^2.1.1", "body-parser": "^1.18.3", "express": "^4.16.4" }, From dc4405fe2c337804748edee8a0743b51dd20ff42 Mon Sep 17 00:00:00 2001 From: kelsk <38271546+kelsk@users.noreply.github.com> Date: Wed, 16 Sep 2020 22:26:12 -0700 Subject: [PATCH 40/68] docs(samples): add sample for updateJob (#265) --- scheduler/test/test.samples.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index 9475624ab7..50fbc6bfaf 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -38,6 +38,13 @@ describe('Cloud Scheduler Sample Tests', () => { jobName = stdout.split('/').pop(); }); + it('should update a scheduler job', async () => { + const stdout = execSync( + `node updateJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` + ); + assert.match(stdout, /Updated job/); + }); + it('should delete a scheduler job', async () => { const stdout = execSync( `node deleteJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` From acbbc524cb5a0b97c8440296c5462fbef81e8ee8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 19 Nov 2020 17:50:59 +0100 Subject: [PATCH 41/68] chore(deps): update dependency supertest to v6 (#308) --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 5135d4ea8d..57fd634182 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -21,6 +21,6 @@ "devDependencies": { "chai": "^4.2.0", "mocha": "^8.0.0", - "supertest": "^4.0.0" + "supertest": "^6.0.0" } } From e9ce5fe69563a7bf489f55e31029d9beca675ba6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:40:17 +0000 Subject: [PATCH 42/68] chore: release 2.1.2 (#312) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.2](https://www.github.com/googleapis/nodejs-scheduler/compare/v2.1.1...v2.1.2) (2020-11-25) ### Bug Fixes * **browser:** check for fetch on window ([#313](https://www.github.com/googleapis/nodejs-scheduler/issues/313)) ([5a7840a](https://www.github.com/googleapis/nodejs-scheduler/commit/5a7840acbe5cbd96be701c8d06a3ec350bf45cc1)) * do not modify options object, use defaultScopes ([#305](https://www.github.com/googleapis/nodejs-scheduler/issues/305)) ([7f8b30c](https://www.github.com/googleapis/nodejs-scheduler/commit/7f8b30c165d3de8beebb0e6704535b4eed7d817d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 57fd634182..3c46294014 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.1.1", + "@google-cloud/scheduler": "^2.1.2", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 55f2a6210e94b80d6516242021fa719bdff9fd86 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 9 Dec 2020 09:18:11 -0800 Subject: [PATCH 43/68] chore: release 2.1.3 (#315) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 3c46294014..e1bf76d8ad 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.1.2", + "@google-cloud/scheduler": "^2.1.3", "body-parser": "^1.18.3", "express": "^4.16.4" }, From c55fe9b00861f01658cce9bdfa3ec789939b9b77 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:38:10 +0000 Subject: [PATCH 44/68] chore: release 2.2.0 (#320) :robot: I have created a release \*beep\* \*boop\* --- ## [2.2.0](https://www.github.com/googleapis/nodejs-scheduler/compare/v2.1.3...v2.2.0) (2021-01-09) ### Features * introduces style enumeration ([#318](https://www.github.com/googleapis/nodejs-scheduler/issues/318)) ([173b34e](https://www.github.com/googleapis/nodejs-scheduler/commit/173b34ebaa92cdfb402e66ccca7b37d68bc35ddd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index e1bf76d8ad..dd486123f5 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.1.3", + "@google-cloud/scheduler": "^2.2.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From dc2cf99afe37a574e661482f38e4d080fdeba396 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 25 Jan 2021 16:41:20 -0800 Subject: [PATCH 45/68] test: intentional break to test flake bot (#324) --- scheduler/test/test.samples.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index 50fbc6bfaf..763c95cd15 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -50,6 +50,9 @@ describe('Cloud Scheduler Sample Tests', () => { `node deleteJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` ); assert.match(stdout, /Job deleted/); + // This is to test that flaky tests are appropriately reported, + // and will be rolled back immediately: + assert.strictEqual(true, false); }); }); From a9f27639b1217c42a9ba59bb709380759ddc0960 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 26 Jan 2021 09:41:37 -0800 Subject: [PATCH 46/68] Revert "test: intentional break to test flake bot (#324)" (#326) This reverts commit a622fc6eb2f8a4af755a45580968324269fa89a1. --- scheduler/test/test.samples.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index 763c95cd15..50fbc6bfaf 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -50,9 +50,6 @@ describe('Cloud Scheduler Sample Tests', () => { `node deleteJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` ); assert.match(stdout, /Job deleted/); - // This is to test that flaky tests are appropriately reported, - // and will be rolled back immediately: - assert.strictEqual(true, false); }); }); From df9a58ec956507b87bd25853ab7dcb20db2d3cc7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 May 2021 10:37:24 -0700 Subject: [PATCH 47/68] chore: release 2.2.1 (#359) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index dd486123f5..90367929a4 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.2.0", + "@google-cloud/scheduler": "^2.2.1", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 63c87eb9e7a26232b31f0795c963ed0aff365b17 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Jun 2021 18:07:12 -0700 Subject: [PATCH 48/68] chore: release 2.2.2 (#368) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 90367929a4..1aa8ce745d 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.2.1", + "@google-cloud/scheduler": "^2.2.2", "body-parser": "^1.18.3", "express": "^4.16.4" }, From cf581e5d9552fe0a1ce71a4372d79a1c3ebd70d4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:40:39 +0000 Subject: [PATCH 49/68] chore: release 2.2.3 (#378) :robot: I have created a release \*beep\* \*boop\* --- ### [2.2.3](https://www.github.com/googleapis/nodejs-scheduler/compare/v2.2.2...v2.2.3) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#377](https://www.github.com/googleapis/nodejs-scheduler/issues/377)) ([4e09949](https://www.github.com/googleapis/nodejs-scheduler/commit/4e0994968fa9fb08f5e7a5f8e9f7cbe96b62e4bf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 1aa8ce745d..4eea5043bf 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.2.2", + "@google-cloud/scheduler": "^2.2.3", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 84e138a6b5e7925919d6ef17c5c91c73c9a08e3f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Jun 2021 16:28:27 +0000 Subject: [PATCH 50/68] chore: release 2.2.4 (#386) :robot: I have created a release \*beep\* \*boop\* --- ### [2.2.4](https://www.github.com/googleapis/nodejs-scheduler/compare/v2.2.3...v2.2.4) (2021-06-30) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#384](https://www.github.com/googleapis/nodejs-scheduler/issues/384)) ([c36a09b](https://www.github.com/googleapis/nodejs-scheduler/commit/c36a09b5ef57c1fd1e9232d4c3eac54024ec5a15)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 4eea5043bf..e7084671a8 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.2.3", + "@google-cloud/scheduler": "^2.2.4", "body-parser": "^1.18.3", "express": "^4.16.4" }, From a82721c389324f4c3ecbd0ba461e70eb8d203519 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 1 Jul 2021 11:17:16 -0700 Subject: [PATCH 51/68] test: run system and sample tests with cloud build (#383) Co-authored-by: Benjamin E. Coe --- scheduler/test/test.samples.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index 50fbc6bfaf..521dfd8499 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -14,21 +14,26 @@ 'use strict'; +const {CloudSchedulerClient} = require('@google-cloud/scheduler'); const {assert} = require('chai'); -const {describe, it} = require('mocha'); +const {describe, it, before} = require('mocha'); const cp = require('child_process'); const supertest = require('supertest'); const app = require('../app.js'); const request = supertest(app); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); - -const PROJECT_ID = process.env.GCLOUD_PROJECT; const LOCATION_ID = process.env.LOCATION_ID || 'us-central1'; const SERVICE_ID = 'my-service'; describe('Cloud Scheduler Sample Tests', () => { let jobName; + let PROJECT_ID; + + before(async () => { + const client = new CloudSchedulerClient(); + PROJECT_ID = await client.getProjectId(); + }); it('should create and delete a scheduler job', async () => { const stdout = execSync( From 2ea5edabf7ceaa0dab32ad38293ca59b6d53805b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 09:09:50 -0700 Subject: [PATCH 52/68] chore: release 2.2.5 (#389) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index e7084671a8..0d8e791a48 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.2.4", + "@google-cloud/scheduler": "^2.2.5", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 8174c8f9d6624c7a0e3c71dc3de0066ee6422be0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 03:06:33 +0000 Subject: [PATCH 53/68] chore: release 2.2.6 (#398) :robot: I have created a release \*beep\* \*boop\* --- ### [2.2.6](https://www.github.com/googleapis/nodejs-scheduler/compare/v2.2.5...v2.2.6) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#397](https://www.github.com/googleapis/nodejs-scheduler/issues/397)) ([b0ec446](https://www.github.com/googleapis/nodejs-scheduler/commit/b0ec4469e3ef9cfa856620fda2c706a3ee5f1dcd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 0d8e791a48..902ce9ef69 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.2.5", + "@google-cloud/scheduler": "^2.2.6", "body-parser": "^1.18.3", "express": "^4.16.4" }, From c1c99c103e7f40178f0f9634504aae3fdbed353c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 10 Sep 2021 10:53:21 -0700 Subject: [PATCH 54/68] chore: release 2.3.0 (#400) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 902ce9ef69..11e513a562 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.2.6", + "@google-cloud/scheduler": "^2.3.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 0d1e6b7059a9e88c8a738081443146ec3e95a6c6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 19:42:14 +0000 Subject: [PATCH 55/68] docs(samples): add auto-generated samples for Node with api short name in region tag (#408) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 399287285 Source-Link: https://github.com/googleapis/googleapis/commit/15759865d1c54e3d46429010f7e472fe6c3d3715 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b27fff623a5d8d586b703b5e4919856abe7c2eb3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 11e513a562..9a5a430d07 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -3,7 +3,7 @@ "private": true, "main": "quickstart.js", "engines": { - "node": ">=8" + "node": ">=10" }, "files": [ "*.js" From c252b7bc256054cf961c3c6b7a967355678e3c46 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 19 May 2022 17:24:47 -0700 Subject: [PATCH 56/68] build!: update library to use Node 12 (#452) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build!: Update library to use Node 12 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 9a5a430d07..50f7a72b83 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -3,7 +3,7 @@ "private": true, "main": "quickstart.js", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" From 430f6fb9b1d1db6e0ec2e8f513d9f9d9a659342e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 26 May 2022 12:00:21 -0700 Subject: [PATCH 57/68] chore(main): release 3.0.0 (#453) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 50f7a72b83..bf63a35e31 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^2.3.0", + "@google-cloud/scheduler": "^3.0.0", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 511d3ca9cdd64c8a4493c4e207fb272e9edf2f81 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 19:10:14 +0000 Subject: [PATCH 58/68] chore(main): release 3.0.1 (#458) :robot: I have created a release *beep* *boop* --- ## [3.0.1](https://github.com/googleapis/nodejs-scheduler/compare/v3.0.0...v3.0.1) (2022-06-30) ### Bug Fixes * **docs:** describe fallback rest option ([#457](https://github.com/googleapis/nodejs-scheduler/issues/457)) ([e8e4c14](https://github.com/googleapis/nodejs-scheduler/commit/e8e4c14699b7c080634f287a3bcd2c6ac372ef1a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index bf63a35e31..2adb36a92f 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^3.0.0", + "@google-cloud/scheduler": "^3.0.1", "body-parser": "^1.18.3", "express": "^4.16.4" }, From b249fad5068a0f0015d81f634c6e82b59ce77794 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 2 Aug 2022 13:43:53 -0700 Subject: [PATCH 59/68] chore(main): release 3.0.2 (#462) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.2 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 2adb36a92f..5d009369ec 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^3.0.1", + "@google-cloud/scheduler": "^3.0.2", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 3916b616048321dd4f665d263e11d74a4361a50e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 26 Aug 2022 12:23:57 -0700 Subject: [PATCH 60/68] chore(main): release 3.0.3 (#466) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.3 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 5d009369ec..ec5ae44aa3 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^3.0.2", + "@google-cloud/scheduler": "^3.0.3", "body-parser": "^1.18.3", "express": "^4.16.4" }, From b4eda60dec86179c99853ff2b9f7c70c3871e23e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:09:26 -0700 Subject: [PATCH 61/68] chore(main): release 3.0.4 (#470) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.4 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index ec5ae44aa3..0bbb09c2c1 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^3.0.3", + "@google-cloud/scheduler": "^3.0.4", "body-parser": "^1.18.3", "express": "^4.16.4" }, From e8c24132eec6a241f0e56aed2b9af846511233b4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 16:55:21 -0800 Subject: [PATCH 62/68] chore(main): release 3.0.5 (#482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.5 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- scheduler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/package.json b/scheduler/package.json index 0bbb09c2c1..f953e0e264 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 10000 --exit" }, "dependencies": { - "@google-cloud/scheduler": "^3.0.4", + "@google-cloud/scheduler": "^3.0.5", "body-parser": "^1.18.3", "express": "^4.16.4" }, From 499ca51272a14972eb76e7dfbfeeafdf8cdc8244 Mon Sep 17 00:00:00 2001 From: ace-n Date: Mon, 14 Nov 2022 14:18:07 -0800 Subject: [PATCH 63/68] Add workflows config --- .github/workflows/scheduler.yaml | 67 ++++++++++++++++++++++++++++++++ .github/workflows/workflows.json | 1 + 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/scheduler.yaml diff --git a/.github/workflows/scheduler.yaml b/.github/workflows/scheduler.yaml new file mode 100644 index 0000000000..16d199d06e --- /dev/null +++ b/.github/workflows/scheduler.yaml @@ -0,0 +1,67 @@ +name: scheduler +on: + push: + branches: + - main + paths: + - 'scheduler/**' + pull_request: + paths: + - 'scheduler/**' + pull_request_target: + types: [labeled] + schedule: + - cron: '0 0 * * 0' +jobs: + test: + if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }} + runs-on: ubuntu-latest + timeout-minutes: 60 + permissions: + contents: 'write' + pull-requests: 'write' + id-token: 'write' + steps: + - uses: actions/checkout@v3.1.0 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - uses: 'google-github-actions/auth@v1.0.0' + with: + workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider' + service_account: 'kokoro-system-test@long-door-651.iam.gserviceaccount.com' + create_credentials_file: 'true' + access_token_lifetime: 600s + - uses: actions/setup-node@v3.5.1 + with: + node-version: 16 + - run: npm install + working-directory: scheduler + - run: npm test + working-directory: scheduler + env: + MOCHA_REPORTER_SUITENAME: scheduler + MOCHA_REPORTER_OUTPUT: scheduler_sponge_log.xml + MOCHA_REPORTER: xunit + - if: ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }} + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + try { + await github.rest.issues.removeLabel({ + name: 'actions:force-run', + owner: 'GoogleCloudPlatform', + repo: 'nodejs-docs-samples', + issue_number: context.payload.pull_request.number + }); + } catch (e) { + if (!e.message.includes('Label does not exist')) { + throw e; + } + } + - if: ${{ github.event_name == 'schedule'}} + run: | + curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L + chmod +x ./flakybot + ./flakybot --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} diff --git a/.github/workflows/workflows.json b/.github/workflows/workflows.json index 919d5a5cb3..09b61a0e87 100644 --- a/.github/workflows/workflows.json +++ b/.github/workflows/workflows.json @@ -54,6 +54,7 @@ "datacatalog/cloud-client", "datacatalog/quickstart", "datastore/functions", + "scheduler", "talent", "contact-center-insights", "workflows" From f2118932679717726f0fc11834a92d3681903a44 Mon Sep 17 00:00:00 2001 From: ace-n Date: Mon, 14 Nov 2022 14:18:38 -0800 Subject: [PATCH 64/68] Region tags: rm underscore --- scheduler/createJob.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scheduler/createJob.js b/scheduler/createJob.js index 257126886c..2b29031351 100644 --- a/scheduler/createJob.js +++ b/scheduler/createJob.js @@ -21,7 +21,7 @@ * Create a job with an App Engine target via the Cloud Scheduler API */ async function createJob(projectId, locationId, serviceId) { - // [START cloud_scheduler_create_job] + // [START cloudscheduler_create_job] const scheduler = require('@google-cloud/scheduler'); // Create a client. @@ -57,7 +57,7 @@ async function createJob(projectId, locationId, serviceId) { // Use the client to send the job creation request. const [response] = await client.createJob(request); console.log(`Created job: ${response.name}`); - // [END cloud_scheduler_create_job] + // [END cloudscheduler_create_job] } const args = process.argv.slice(2); From 4b5d837fa1b2b1aa242a3b798e2a9e8d25fb5aa6 Mon Sep 17 00:00:00 2001 From: ace-n Date: Mon, 14 Nov 2022 14:20:27 -0800 Subject: [PATCH 65/68] Remove tests for non-migrated samples --- scheduler/package.json | 3 +-- scheduler/test/test.samples.js | 29 +---------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/scheduler/package.json b/scheduler/package.json index f953e0e264..b089b4cf84 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -20,7 +20,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^8.0.0", - "supertest": "^6.0.0" + "mocha": "^8.0.0" } } diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index 521dfd8499..30cd65c597 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -18,9 +18,6 @@ const {CloudSchedulerClient} = require('@google-cloud/scheduler'); const {assert} = require('chai'); const {describe, it, before} = require('mocha'); const cp = require('child_process'); -const supertest = require('supertest'); -const app = require('../app.js'); -const request = supertest(app); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const LOCATION_ID = process.env.LOCATION_ID || 'us-central1'; @@ -35,36 +32,12 @@ describe('Cloud Scheduler Sample Tests', () => { PROJECT_ID = await client.getProjectId(); }); - it('should create and delete a scheduler job', async () => { + it('should create a scheduler job', async () => { const stdout = execSync( `node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}` ); assert.match(stdout, /Created job/); jobName = stdout.split('/').pop(); }); - - it('should update a scheduler job', async () => { - const stdout = execSync( - `node updateJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` - ); - assert.match(stdout, /Updated job/); - }); - - it('should delete a scheduler job', async () => { - const stdout = execSync( - `node deleteJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` - ); - assert.match(stdout, /Job deleted/); - }); }); -describe('Server should respond to /log_payload', () => { - it('should log the payload', done => { - const body = Buffer.from('test'); - request - .post('/log_payload') - .type('raw') - .send(body) - .expect(200, /Printed job/, done); - }); -}); From 6efad70af20bfc4b0c54965505928db3be25f232 Mon Sep 17 00:00:00 2001 From: ace-n Date: Mon, 14 Nov 2022 14:33:17 -0800 Subject: [PATCH 66/68] Lint --- scheduler/test/test.samples.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index 30cd65c597..db5d7dc740 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -24,7 +24,6 @@ const LOCATION_ID = process.env.LOCATION_ID || 'us-central1'; const SERVICE_ID = 'my-service'; describe('Cloud Scheduler Sample Tests', () => { - let jobName; let PROJECT_ID; before(async () => { @@ -37,7 +36,5 @@ describe('Cloud Scheduler Sample Tests', () => { `node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}` ); assert.match(stdout, /Created job/); - jobName = stdout.split('/').pop(); }); }); - From ec2a135668034567b6b5be29d75eca6e66a2627e Mon Sep 17 00:00:00 2001 From: ace-n Date: Mon, 14 Nov 2022 15:25:55 -0800 Subject: [PATCH 67/68] Add cleanup step to tests --- scheduler/test/test.samples.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index db5d7dc740..e79cb3d961 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -19,20 +19,27 @@ const {assert} = require('chai'); const {describe, it, before} = require('mocha'); const cp = require('child_process'); +const client = new CloudSchedulerClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const LOCATION_ID = process.env.LOCATION_ID || 'us-central1'; const SERVICE_ID = 'my-service'; describe('Cloud Scheduler Sample Tests', () => { - let PROJECT_ID; + let PROJECT_ID, stdout; before(async () => { - const client = new CloudSchedulerClient(); PROJECT_ID = await client.getProjectId(); }); + after(async () => { + let jobName = stdout && stdout.trim().split(' ').slice(-1); + if (jobName) { + await client.deleteJob({name: jobName}); + } + }) + it('should create a scheduler job', async () => { - const stdout = execSync( + stdout = execSync( `node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}` ); assert.match(stdout, /Created job/); From ac05fc2e55ab4bd1457d539af2237bc469bf5d2e Mon Sep 17 00:00:00 2001 From: ace-n Date: Mon, 14 Nov 2022 15:46:05 -0800 Subject: [PATCH 68/68] Lint --- scheduler/test/test.samples.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index e79cb3d961..0479a4708f 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -32,11 +32,11 @@ describe('Cloud Scheduler Sample Tests', () => { }); after(async () => { - let jobName = stdout && stdout.trim().split(' ').slice(-1); + const jobName = stdout && stdout.trim().split(' ').slice(-1); if (jobName) { await client.deleteJob({name: jobName}); } - }) + }); it('should create a scheduler job', async () => { stdout = execSync(