From c6b78a3c6fa6775b8e697f243cc75e9f19658246 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 17 Sep 2020 11:14:19 -0700 Subject: [PATCH 01/22] feat!: initial library generation (#8) --- workflows/README.md | 68 ++++++++++++++++++++++++++++++ workflows/create-execution.js | 41 ++++++++++++++++++ workflows/package.json | 22 ++++++++++ workflows/quickstart.js | 42 ++++++++++++++++++ workflows/test/create-execution.js | 40 ++++++++++++++++++ workflows/test/quickstart.js | 35 +++++++++++++++ 6 files changed, 248 insertions(+) create mode 100644 workflows/README.md create mode 100644 workflows/create-execution.js create mode 100644 workflows/package.json create mode 100644 workflows/quickstart.js create mode 100644 workflows/test/create-execution.js create mode 100644 workflows/test/quickstart.js diff --git a/workflows/README.md b/workflows/README.md new file mode 100644 index 0000000000..032f9b2508 --- /dev/null +++ b/workflows/README.md @@ -0,0 +1,68 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Workflows: Node.js Samples](https://github.com/googleapis/nodejs-workflows) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Create-execution](#create-execution) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-workflows#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Create-execution + +View the [source code](https://github.com/googleapis/nodejs-workflows/blob/master/samples/create-execution.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-workflows&page=editor&open_in_editor=samples/create-execution.js,samples/README.md) + +__Usage:__ + + +`node samples/create-execution.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-workflows/blob/master/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-workflows&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-workflows&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/workflows/docs/ diff --git a/workflows/create-execution.js b/workflows/create-execution.js new file mode 100644 index 0000000000..799d3e7646 --- /dev/null +++ b/workflows/create-execution.js @@ -0,0 +1,41 @@ +// Copyright 2020 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. + +'use strict'; + +async function main(projectId, location, name) { + // [START workflows_create_execution] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + // const projectId = 'my-project'; + // const location = 'us-central1'; + // const name = 'my-test-workflow'; + const {ExecutionsClient} = require('@google-cloud/workflows'); + const client = new ExecutionsClient(); + async function createExecution() { + const [resp] = await client.createExecution({ + parent: client.workflowPath(projectId, location, name), + }); + console.info(`name: ${resp.name}`); + } + createExecution(); + // [END workflows_create_execution] +} + +process.on('unhandledRejection', (err) => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/workflows/package.json b/workflows/package.json new file mode 100644 index 0000000000..d368baaf10 --- /dev/null +++ b/workflows/package.json @@ -0,0 +1,22 @@ +{ + "name": "nodejs-workflows-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=10" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/workflows": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.3.0", + "mocha": "^8.1.1" + } +} diff --git a/workflows/quickstart.js b/workflows/quickstart.js new file mode 100644 index 0000000000..90be4deac9 --- /dev/null +++ b/workflows/quickstart.js @@ -0,0 +1,42 @@ +// Copyright 2020 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. + +'use strict'; + +async function main(projectId, location) { + // [START workflows_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + // const projectId = 'my-project'; + // const location = 'us-central1'; + const {WorkflowsClient} = require('@google-cloud/workflows'); + const client = new WorkflowsClient(); + async function listWorkflows() { + const [workflows] = await client.listWorkflows({ + parent: client.locationPath(projectId, location), + }); + for (const workflow of workflows) { + console.info(`name: ${workflow.name}`); + } + } + listWorkflows(); + // [END workflows_quickstart] +} + +process.on('unhandledRejection', (err) => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/workflows/test/create-execution.js b/workflows/test/create-execution.js new file mode 100644 index 0000000000..77cc1d2e23 --- /dev/null +++ b/workflows/test/create-execution.js @@ -0,0 +1,40 @@ +// Copyright 2020 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. + +'use strict'; + +const path = require('path'); +const assert = require('assert'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); + +const execSync = (cmd) => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const project = process.env.GCLOUD_PROJECT; +const location = 'us-central1'; +const workflow = 'test-workflow-dont-delete'; + +describe('create-execution', () => { + it('should create an execution', async () => { + const output = execSync( + `node ./create-execution.js ${project} ${location} ${workflow}`, + { + cwd, + } + ); + assert(output.match(/name: projects.*executions.*/)); + }); +}); diff --git a/workflows/test/quickstart.js b/workflows/test/quickstart.js new file mode 100644 index 0000000000..12d1c0a80e --- /dev/null +++ b/workflows/test/quickstart.js @@ -0,0 +1,35 @@ +// Copyright 2020 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. + +'use strict'; + +const path = require('path'); +const assert = require('assert'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); + +const execSync = (cmd) => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const project = process.env.GCLOUD_PROJECT; + +describe('Quickstart', () => { + it('should run quickstart', async () => { + const output = execSync(`node ./quickstart.js ${project} us-central1`, { + cwd, + }); + assert(output.match(/name: projects.*/)); + }); +}); From 9ba0c64c7549082cf48ee8a50fc03fb65efc174b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 17 Sep 2020 11:20:38 -0700 Subject: [PATCH 02/22] chore: release 1.0.0 (#11) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index d368baaf10..5aea68d1a9 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^0.1.0" + "@google-cloud/workflows": "^1.0.0" }, "devDependencies": { "c8": "^7.3.0", From 21848317f8c19bdab82aa2352385a2db0df196fc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2020 12:53:56 -0800 Subject: [PATCH 03/22] chore: release 1.0.1 (#21) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 5aea68d1a9..75b554fd98 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.0.0" + "@google-cloud/workflows": "^1.0.1" }, "devDependencies": { "c8": "^7.3.0", From 3538eafc0cc7544faf860626435c435a46e1be8d 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:42:18 +0000 Subject: [PATCH 04/22] chore: release 1.0.2 (#24) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.2](https://www.github.com/googleapis/nodejs-workflows/compare/v1.0.1...v1.0.2) (2020-11-25) ### Bug Fixes * better fallback feature detection, jsdoc update ([#23](https://www.github.com/googleapis/nodejs-workflows/issues/23)) ([2d4e44d](https://www.github.com/googleapis/nodejs-workflows/commit/2d4e44d789185b02735acb295c2431d9f02441e5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 75b554fd98..bec2a3b888 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.0.1" + "@google-cloud/workflows": "^1.0.2" }, "devDependencies": { "c8": "^7.3.0", From 3b5e629873631af9d7c0e3b420ecfc739a97c117 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:04 +0000 Subject: [PATCH 05/22] chore: release 1.1.0 (#31) :robot: I have created a release \*beep\* \*boop\* --- ## [1.1.0](https://www.github.com/googleapis/nodejs-workflows/compare/v1.0.2...v1.1.0) (2021-01-09) ### Features * adds style enumeration ([#30](https://www.github.com/googleapis/nodejs-workflows/issues/30)) ([de3c259](https://www.github.com/googleapis/nodejs-workflows/commit/de3c259d08dae7edd775310c0db35fa089f58db3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index bec2a3b888..c1f917027b 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.0.2" + "@google-cloud/workflows": "^1.1.0" }, "devDependencies": { "c8": "^7.3.0", From 4cbf01805fcc1b025e20edede78268bb64cc2d78 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 16:40:29 -0700 Subject: [PATCH 06/22] chore: release 1.2.0 (#53) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index c1f917027b..934c01b64c 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.1.0" + "@google-cloud/workflows": "^1.2.0" }, "devDependencies": { "c8": "^7.3.0", From eb9903448bdaa7eac03f075731940d1b87285096 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:09:30 -0700 Subject: [PATCH 07/22] chore: release 1.2.1 (#62) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 934c01b64c..591a28cae7 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.2.0" + "@google-cloud/workflows": "^1.2.1" }, "devDependencies": { "c8": "^7.3.0", From 5cfaa0356182227bad3f46a68ca5860d98b072d6 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:46 +0000 Subject: [PATCH 08/22] chore: release 1.2.2 (#70) :robot: I have created a release \*beep\* \*boop\* --- ### [1.2.2](https://www.github.com/googleapis/nodejs-workflows/compare/v1.2.1...v1.2.2) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#69](https://www.github.com/googleapis/nodejs-workflows/issues/69)) ([8e001de](https://www.github.com/googleapis/nodejs-workflows/commit/8e001de596a68c4705086ece713f1c8712462739)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 591a28cae7..36ce582cd1 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.2.1" + "@google-cloud/workflows": "^1.2.2" }, "devDependencies": { "c8": "^7.3.0", From 75b7fdadd59b7fe1fb536a6a45147b169de21ed9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 15:54:35 +0000 Subject: [PATCH 09/22] chore: release 1.2.3 (#76) :robot: I have created a release \*beep\* \*boop\* --- ### [1.2.3](https://www.github.com/googleapis/nodejs-workflows/compare/v1.2.2...v1.2.3) (2021-06-29) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#75](https://www.github.com/googleapis/nodejs-workflows/issues/75)) ([878255f](https://www.github.com/googleapis/nodejs-workflows/commit/878255f1c9e8be666f469eb35d486efa6ebb3e20)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 36ce582cd1..32003aeaf4 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.2.2" + "@google-cloud/workflows": "^1.2.3" }, "devDependencies": { "c8": "^7.3.0", From 2836065d9371e462dcced9147a90240b97f85eab Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:20:37 +0000 Subject: [PATCH 10/22] chore: release 1.2.4 (#79) :robot: I have created a release \*beep\* \*boop\* --- ### [1.2.4](https://www.github.com/googleapis/nodejs-workflows/compare/v1.2.3...v1.2.4) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#78](https://www.github.com/googleapis/nodejs-workflows/issues/78)) ([5e2c265](https://www.github.com/googleapis/nodejs-workflows/commit/5e2c2659d25c2927db2e93091ccd426909a079e5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 32003aeaf4..fc8321e852 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.2.3" + "@google-cloud/workflows": "^1.2.4" }, "devDependencies": { "c8": "^7.3.0", From 9fa9c847d8441842e9c7b4c8b44d333e9146ed80 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 00:46:27 +0000 Subject: [PATCH 11/22] chore: release 1.2.5 (#81) :robot: I have created a release \*beep\* \*boop\* --- ### [1.2.5](https://www.github.com/googleapis/nodejs-workflows/compare/v1.2.4...v1.2.5) (2021-07-21) ### Bug Fixes * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#80](https://www.github.com/googleapis/nodejs-workflows/issues/80)) ([0b782cf](https://www.github.com/googleapis/nodejs-workflows/commit/0b782cff0eddcd158fcbd272c76e54e35b6d336c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index fc8321e852..4b37122ea6 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.2.4" + "@google-cloud/workflows": "^1.2.5" }, "devDependencies": { "c8": "^7.3.0", From 3bb0fb76a1e20048a18806daba7383ae07cf72c8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:06:42 +0000 Subject: [PATCH 12/22] chore: release 1.2.6 (#88) :robot: I have created a release \*beep\* \*boop\* --- ### [1.2.6](https://www.github.com/googleapis/nodejs-workflows/compare/v1.2.5...v1.2.6) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#87](https://www.github.com/googleapis/nodejs-workflows/issues/87)) ([ccc4a47](https://www.github.com/googleapis/nodejs-workflows/commit/ccc4a47846bbc6a8725a3abecf899cbacf6a10a6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 4b37122ea6..215d79b9f8 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.2.5" + "@google-cloud/workflows": "^1.2.6" }, "devDependencies": { "c8": "^7.3.0", From 836f05941b5fdc4fcdfee9b8e2329272a1b7bc00 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:56:23 +0000 Subject: [PATCH 13/22] chore: release 1.3.0 (#90) :robot: I have created a release \*beep\* \*boop\* --- ## [1.3.0](https://www.github.com/googleapis/nodejs-workflows/compare/v1.2.6...v1.3.0) (2021-08-23) ### Features * turns on self-signed JWT feature flag ([#89](https://www.github.com/googleapis/nodejs-workflows/issues/89)) ([c17023b](https://www.github.com/googleapis/nodejs-workflows/commit/c17023b8091a2372ff12ee8dd622bf1db82bcefa)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 215d79b9f8..86f755011b 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.2.6" + "@google-cloud/workflows": "^1.3.0" }, "devDependencies": { "c8": "^7.3.0", From 96235599619687b962767b1546097804e8c3c970 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 9 Sep 2021 10:38:15 -0700 Subject: [PATCH 14/22] fix(build): migrate to using main branch (#92) --- workflows/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflows/README.md b/workflows/README.md index 032f9b2508..0380a3d653 100644 --- a/workflows/README.md +++ b/workflows/README.md @@ -32,7 +32,7 @@ Before running the samples, make sure you've followed the steps outlined in ### Create-execution -View the [source code](https://github.com/googleapis/nodejs-workflows/blob/master/samples/create-execution.js). +View the [source code](https://github.com/googleapis/nodejs-workflows/blob/main/samples/create-execution.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-workflows&page=editor&open_in_editor=samples/create-execution.js,samples/README.md) @@ -49,7 +49,7 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-workflows/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-workflows/blob/main/samples/quickstart.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-workflows&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) From 039d243c943867096601f52726bf0dae47dcf2ae Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 9 Sep 2021 17:48:35 +0000 Subject: [PATCH 15/22] chore: release 1.3.1 (#93) :robot: I have created a release \*beep\* \*boop\* --- ### [1.3.1](https://www.github.com/googleapis/nodejs-workflows/compare/v1.3.0...v1.3.1) (2021-09-09) ### Bug Fixes * **build:** migrate to using main branch ([#92](https://www.github.com/googleapis/nodejs-workflows/issues/92)) ([1f6e084](https://www.github.com/googleapis/nodejs-workflows/commit/1f6e084c99b648f9e02a5067ef6e7be4c04c1392)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 86f755011b..2b7ddff4b4 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.3.0" + "@google-cloud/workflows": "^1.3.1" }, "devDependencies": { "c8": "^7.3.0", From 613da9d22d43b6f53c9ecf7865076a1c78fb0564 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 8 Nov 2021 17:24:15 +0000 Subject: [PATCH 16/22] chore: release 1.4.0 (#107) :robot: I have created a release \*beep\* \*boop\* --- ## [1.4.0](https://www.github.com/googleapis/nodejs-workflows/compare/v1.3.1...v1.4.0) (2021-11-08) ### Features * add a stack_trace field to the Error messages specifying where the error occured feat: add call_log_level field to Execution messages doc: clarify requirement to escape strings within JSON arguments ([#106](https://www.github.com/googleapis/nodejs-workflows/issues/106)) ([7ba49ae](https://www.github.com/googleapis/nodejs-workflows/commit/7ba49ae965a80e5a44e7add4d626524635c2f3e1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 2b7ddff4b4..4896f44e8a 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.3.1" + "@google-cloud/workflows": "^1.4.0" }, "devDependencies": { "c8": "^7.3.0", From 8d459ee7d39905ffe5e4ec568744b22e56c59b17 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Fri, 20 May 2022 10:58:17 -0700 Subject: [PATCH 17/22] build!: update library to use Node 12 (#140) * build!: Update library to use Node 12 Co-authored-by: Owl Bot --- workflows/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflows/package.json b/workflows/package.json index 4896f44e8a..6b12918186 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" @@ -19,4 +19,4 @@ "c8": "^7.3.0", "mocha": "^8.1.1" } -} +} \ No newline at end of file From 1ca3311af4c9fea41de35c557417136de7ec2839 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 26 May 2022 11:51:18 -0700 Subject: [PATCH 18/22] chore(main): release 2.0.0 (#142) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 6b12918186..70dceacaa2 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^1.4.0" + "@google-cloud/workflows": "^2.0.0" }, "devDependencies": { "c8": "^7.3.0", From 272cb7e361beabff5618db4482c5fe05df466739 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:36:16 +0000 Subject: [PATCH 19/22] chore(main): release 2.1.0 (#147) :robot: I have created a release *beep* *boop* --- ## [2.1.0](https://github.com/googleapis/nodejs-workflows/compare/v2.0.0...v2.1.0) (2022-06-29) ### Features * support regapic LRO ([#146](https://github.com/googleapis/nodejs-workflows/issues/146)) ([a513afb](https://github.com/googleapis/nodejs-workflows/commit/a513afb8499dd3e377b0c43ee31aeaacbf39c0e9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 70dceacaa2..8e51098b57 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^2.0.0" + "@google-cloud/workflows": "^2.1.0" }, "devDependencies": { "c8": "^7.3.0", From 5a9295e42435de86de4fa1ebe9606c958a83f707 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:10:10 -0700 Subject: [PATCH 20/22] chore(main): release 2.1.1 (#157) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- workflows/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/package.json b/workflows/package.json index 8e51098b57..e6543e213d 100644 --- a/workflows/package.json +++ b/workflows/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/workflows": "^2.1.0" + "@google-cloud/workflows": "^2.1.1" }, "devDependencies": { "c8": "^7.3.0", From 7fa7ab23ff43c54fd0ba96a854236d412f4313db Mon Sep 17 00:00:00 2001 From: Roger Martinez Date: Thu, 10 Nov 2022 13:36:18 -0800 Subject: [PATCH 21/22] prettier replacements --- workflows/create-execution.js | 2 +- workflows/quickstart.js | 2 +- workflows/test/create-execution.js | 2 +- workflows/test/quickstart.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/workflows/create-execution.js b/workflows/create-execution.js index 799d3e7646..c554f5beb7 100644 --- a/workflows/create-execution.js +++ b/workflows/create-execution.js @@ -34,7 +34,7 @@ async function main(projectId, location, name) { // [END workflows_create_execution] } -process.on('unhandledRejection', (err) => { +process.on('unhandledRejection', err => { console.error(err.message); process.exitCode = 1; }); diff --git a/workflows/quickstart.js b/workflows/quickstart.js index 90be4deac9..c96bbd1406 100644 --- a/workflows/quickstart.js +++ b/workflows/quickstart.js @@ -35,7 +35,7 @@ async function main(projectId, location) { // [END workflows_quickstart] } -process.on('unhandledRejection', (err) => { +process.on('unhandledRejection', err => { console.error(err.message); process.exitCode = 1; }); diff --git a/workflows/test/create-execution.js b/workflows/test/create-execution.js index 77cc1d2e23..9ebdb8a755 100644 --- a/workflows/test/create-execution.js +++ b/workflows/test/create-execution.js @@ -19,7 +19,7 @@ const assert = require('assert'); const cp = require('child_process'); const {describe, it} = require('mocha'); -const execSync = (cmd) => cp.execSync(cmd, {encoding: 'utf-8'}); +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const cwd = path.join(__dirname, '..'); diff --git a/workflows/test/quickstart.js b/workflows/test/quickstart.js index 12d1c0a80e..420abc4dba 100644 --- a/workflows/test/quickstart.js +++ b/workflows/test/quickstart.js @@ -19,7 +19,7 @@ const assert = require('assert'); const cp = require('child_process'); const {describe, it} = require('mocha'); -const execSync = (cmd) => cp.execSync(cmd, {encoding: 'utf-8'}); +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const cwd = path.join(__dirname, '..'); From 0e2fbf4241e6c617175fc283462101f88df05a50 Mon Sep 17 00:00:00 2001 From: Roger Martinez Date: Thu, 10 Nov 2022 13:47:26 -0800 Subject: [PATCH 22/22] add workflows to github workflows config --- .github/workflows/workflows.json | 3 +- .github/workflows/workflows.yaml | 67 ++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/workflows.yaml diff --git a/.github/workflows/workflows.json b/.github/workflows/workflows.json index 852a6be0d3..36ee104fd7 100644 --- a/.github/workflows/workflows.json +++ b/.github/workflows/workflows.json @@ -50,5 +50,6 @@ "datacatalog/quickstart", "datastore/functions", "talent", - "contact-center-insights" + "contact-center-insights", + "workflows" ] diff --git a/.github/workflows/workflows.yaml b/.github/workflows/workflows.yaml new file mode 100644 index 0000000000..da30c911c2 --- /dev/null +++ b/.github/workflows/workflows.yaml @@ -0,0 +1,67 @@ +name: workflows +on: + push: + branches: + - main + paths: + - 'workflows/**' + pull_request: + paths: + - 'workflows/**' + 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@v0.8.3' + 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: workflows + - run: npm test + working-directory: workflows + env: + MOCHA_REPORTER_SUITENAME: workflows + MOCHA_REPORTER_OUTPUT: workflows_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}}