From 38acced902f014ec89531d0e4ff47e7bb07b9252 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Thu, 25 Feb 2021 12:35:57 -0500 Subject: [PATCH 1/5] =?UTF-8?q?chore:=20=F0=9F=A4=96=20support=20api=5Ferr?= =?UTF-8?q?ors=20and=20drop=20errors=20format=20flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/electron-app/src/boundary-cli.js | 7 +++++-- ui/desktop/electron-app/src/spawn-promise.js | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ui/desktop/electron-app/src/boundary-cli.js b/ui/desktop/electron-app/src/boundary-cli.js index 2227687ed..e42255ea4 100644 --- a/ui/desktop/electron-app/src/boundary-cli.js +++ b/ui/desktop/electron-app/src/boundary-cli.js @@ -18,8 +18,10 @@ const escapeAndValidateBase62 = (str) => { }; module.exports = { + // Check boundary cli existence exists: () => Boolean(cliPath()), + // Initiate connection and return output connect: (target_id, token, host_id) => { const addr = origin.origin; @@ -33,13 +35,13 @@ module.exports = { `-target-id=${sanitized.target_id}`, `-token=${sanitized.token}`, `-addr=${addr}`, - '-format=json', - '--output-json-errors' + '-format=json' ]; if (host_id) command.push(`-host-id=${sanitized.host_id}`) return spawnAsyncJSONPromise(command); }, + // Returns JSON-formatted version information from the CLI version: () => { const command = [ '-v' ]; @@ -54,4 +56,5 @@ module.exports = { return { gitRevision, versionNumber, formatted }; return rawOutput; } + } diff --git a/ui/desktop/electron-app/src/spawn-promise.js b/ui/desktop/electron-app/src/spawn-promise.js index ba08e2685..47afae96d 100644 --- a/ui/desktop/electron-app/src/spawn-promise.js +++ b/ui/desktop/electron-app/src/spawn-promise.js @@ -52,8 +52,10 @@ module.exports = { childProcess.stderr.on('data', (data) => { errorStream += data.toString(); const jsonData = jsonify(errorStream); - const error = jsonData ? jsonData.error : undefined; - if (jsonData) reject(new Error(error)); + if (jsonData) { + const error = jsonData.api_error || jsonData.error; + reject(new Error(error)); + } }); }); }, From 06c6b18f330d8d261cae2628127743c4eb7d1d79 Mon Sep 17 00:00:00 2001 From: 99 Date: Fri, 26 Feb 2021 15:23:31 -0800 Subject: [PATCH 2/5] debug tag --- .github/workflows/ui-release-trigger.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ui-release-trigger.yml b/.github/workflows/ui-release-trigger.yml index 324d04801..2d20572ea 100644 --- a/.github/workflows/ui-release-trigger.yml +++ b/.github/workflows/ui-release-trigger.yml @@ -9,12 +9,12 @@ jobs: trigger-circleci-release: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@master + - uses: actions/checkout@v2 - name: Trigger Release job - env: - TAG: ${{ github.event.release.tag_name }} run: | + echo "Triggering release with a TAG ${GITHUB_REF#refs/tags/}" + curl -u ${{ secrets.CIRCLE_TOKEN }}: -X POST --header "Content-Type: application/json" \ - -d '{ "branch": "main", "parameters": {"TAG": "'${TAG}'" }}' \ + -d '{ "branch": "main", "parameters": {"TAG": "${GITHUB_REF#refs/tags/}" }}' \ https://circleci.com/api/v2/project/github/hashicorp/boundary-ui-releases/pipeline + From 71148c3f77495fe6852e2cc733943bbf4c9ac664 Mon Sep 17 00:00:00 2001 From: 99 Date: Fri, 26 Feb 2021 17:43:20 -0800 Subject: [PATCH 3/5] debug tag --- .github/workflows/ui-release-trigger.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ui-release-trigger.yml b/.github/workflows/ui-release-trigger.yml index 2d20572ea..02e107c99 100644 --- a/.github/workflows/ui-release-trigger.yml +++ b/.github/workflows/ui-release-trigger.yml @@ -17,4 +17,3 @@ jobs: curl -u ${{ secrets.CIRCLE_TOKEN }}: -X POST --header "Content-Type: application/json" \ -d '{ "branch": "main", "parameters": {"TAG": "${GITHUB_REF#refs/tags/}" }}' \ https://circleci.com/api/v2/project/github/hashicorp/boundary-ui-releases/pipeline - From c8a843e843a2cd39cb54234d12d80df4266bbea6 Mon Sep 17 00:00:00 2001 From: 99 Date: Sat, 27 Feb 2021 11:01:26 -0800 Subject: [PATCH 4/5] Fix a tag parameter for the release pipeline --- .github/workflows/ui-release-trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-release-trigger.yml b/.github/workflows/ui-release-trigger.yml index 02e107c99..06dd46c0f 100644 --- a/.github/workflows/ui-release-trigger.yml +++ b/.github/workflows/ui-release-trigger.yml @@ -15,5 +15,5 @@ jobs: echo "Triggering release with a TAG ${GITHUB_REF#refs/tags/}" curl -u ${{ secrets.CIRCLE_TOKEN }}: -X POST --header "Content-Type: application/json" \ - -d '{ "branch": "main", "parameters": {"TAG": "${GITHUB_REF#refs/tags/}" }}' \ + -d '{ "branch": "main", "parameters": {"TAG": ${GITHUB_REF#refs/tags/} }}' \ https://circleci.com/api/v2/project/github/hashicorp/boundary-ui-releases/pipeline From 6ed036a35e1611004f0f30afe68c39f9b548ab5c Mon Sep 17 00:00:00 2001 From: 99 <5048814+99@users.noreply.github.com> Date: Mon, 1 Mar 2021 14:38:10 -0800 Subject: [PATCH 5/5] Update .github/workflows/ui-release-trigger.yml Co-authored-by: Sam Salisbury --- .github/workflows/ui-release-trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-release-trigger.yml b/.github/workflows/ui-release-trigger.yml index 06dd46c0f..10683ba54 100644 --- a/.github/workflows/ui-release-trigger.yml +++ b/.github/workflows/ui-release-trigger.yml @@ -15,5 +15,5 @@ jobs: echo "Triggering release with a TAG ${GITHUB_REF#refs/tags/}" curl -u ${{ secrets.CIRCLE_TOKEN }}: -X POST --header "Content-Type: application/json" \ - -d '{ "branch": "main", "parameters": {"TAG": ${GITHUB_REF#refs/tags/} }}' \ + -d '{ "branch": "main", "parameters": {"TAG": "'${GITHUB_REF#refs/tags/}'" }}' \ https://circleci.com/api/v2/project/github/hashicorp/boundary-ui-releases/pipeline