From 5dcfef1c072395ef0b19dea7f54910592b3da611 Mon Sep 17 00:00:00 2001 From: shudarshon Date: Fri, 7 Feb 2020 14:16:27 +0800 Subject: [PATCH 01/30] test: testing artifact upload to s3 feature from ci pipeline --- .circleci/config.yml | 58 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e34cf8baa..84b9978265 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2.1 orbs: k8s: circleci/kubernetes@0.7.0 + s3: circleci/aws-s3@1.0.13 commands: git_checkout_from_cache: description: "Git checkout and save cache" @@ -46,14 +47,43 @@ commands: key: npm-v1-{{ checksum "package.json" }} paths: - "node_modules" - build: description: "Build" steps: - run: name: "yarn build" command: node_modules/gulp/bin/gulp.js build-min - + compress: + description: "Compress" + steps: + - run: + name: "Compress" + command: | + pushd www/ + tar -cvf artifact.tar * + mv artifact.tar ${OLDPWD}/ + upload_artifact: + description: "upload artifact to s3" + steps: + - s3/copy: + from: artifact.tar + to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}' # using ${CIRCLE_BRANCH} for separating build artifact by branch + aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID + aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY + aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION + upload_checksum: + description: "upload artifact checksum to s3" + steps: + - run: + name: + command: | + sha256sum artifact.tar | cut -d ' ' -f 1 > artifact-info.txt + - s3/copy: + from: artifact-info.txt + to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}' # using ${CIRCLE_BRANCH} for separating build artifact by branch + aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID + aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY + aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION docker: description: "Build and Push image to docker hub" parameters: @@ -114,10 +144,13 @@ jobs: - git_checkout_from_cache - npm_install - build - - docker: - target: "beta" - - k8s_deploy: - target: "beta" + - compress + - upload_artifact # uploading the built code to s3 to create a backup of key services separate from Kubernetes deployment + - upload_checksum # uploading compressed artifact checksum to cross match artifact fingerprint before actual deployment + #- docker: + # target: "beta" + #- k8s_deploy: + # target: "beta" release_production: docker: @@ -126,10 +159,13 @@ jobs: - git_checkout_from_cache - npm_install - build - - docker: - target: "production" - - k8s_deploy: - target: "production" + - compress + - upload_artifact # uploading the built code to s3 to create a backup of key services separate from Kubernetes deployment + - upload_checksum # uploading compressed artifact checksum to cross match artifact fingerprint before actual deployment + #- docker: + # target: "production" + #- k8s_deploy: + # target: "production" workflows: test: @@ -144,10 +180,12 @@ workflows: ignore: /.*/ tags: only: /^beta.*/ + context: binary-frontend-deploy - release_production: filters: branches: ignore: /.*/ tags: only: /^production.*/ + context: binary-frontend-deploy From 0784f40f5ebc5d15982fc6d976c1e763526c29a2 Mon Sep 17 00:00:00 2001 From: shudarshon Date: Fri, 7 Feb 2020 14:28:16 +0800 Subject: [PATCH 02/30] test: testing circleci by adding artifact uploading steps in testing workflow --- .circleci/config.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 84b9978265..4c66b81746 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -135,7 +135,11 @@ jobs: steps: - git_checkout_from_cache - npm_install - - npm_test + #- npm_test + - build + - compress + - upload_artifact # uploading the built code to s3 to create a backup of key services separate from Kubernetes deployment + - upload_checksum # uploading compressed artifact checksum to cross match artifact fingerprint before actual deployment release_beta: docker: @@ -170,8 +174,8 @@ jobs: workflows: test: jobs: - - test - + - test: + context: binary-frontend-deploy release: jobs: - release_beta: From 3f9cb7aeb4c308227bf31ca36d96a613fc7d7e44 Mon Sep 17 00:00:00 2001 From: shudarshon Date: Fri, 7 Feb 2020 14:37:10 +0800 Subject: [PATCH 03/30] fix: added slash after s3 bucket key --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c66b81746..4bde9d433f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,7 +67,7 @@ commands: steps: - s3/copy: from: artifact.tar - to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}' # using ${CIRCLE_BRANCH} for separating build artifact by branch + to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/' # using ${CIRCLE_BRANCH} for separating build artifact by branch aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION @@ -80,7 +80,7 @@ commands: sha256sum artifact.tar | cut -d ' ' -f 1 > artifact-info.txt - s3/copy: from: artifact-info.txt - to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}' # using ${CIRCLE_BRANCH} for separating build artifact by branch + to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/' # using ${CIRCLE_BRANCH} for separating build artifact by branch aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION From 8f1ea2daf0700fc4304a4dfaf8dc7d560375dcad Mon Sep 17 00:00:00 2001 From: shudarshon Date: Fri, 7 Feb 2020 18:22:07 +0800 Subject: [PATCH 04/30] remove: removed workflow context settings for release_beta jobs --- .circleci/config.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4bde9d433f..07bbe2fd42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -148,13 +148,10 @@ jobs: - git_checkout_from_cache - npm_install - build - - compress - - upload_artifact # uploading the built code to s3 to create a backup of key services separate from Kubernetes deployment - - upload_checksum # uploading compressed artifact checksum to cross match artifact fingerprint before actual deployment - #- docker: - # target: "beta" - #- k8s_deploy: - # target: "beta" + - docker: + target: "beta" + - k8s_deploy: + target: "beta" release_production: docker: @@ -184,7 +181,6 @@ workflows: ignore: /.*/ tags: only: /^beta.*/ - context: binary-frontend-deploy - release_production: filters: branches: From 982c1190922462c1aa1c325f636eb63e68f8cd58 Mon Sep 17 00:00:00 2001 From: shudarshon Date: Fri, 7 Feb 2020 18:47:32 +0800 Subject: [PATCH 05/30] test: testing uploading artifact and tagging with commit id --- .circleci/config.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07bbe2fd42..258591ebe7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,25 +62,25 @@ commands: pushd www/ tar -cvf artifact.tar * mv artifact.tar ${OLDPWD}/ + - run: + name: "Tag commit id as artifact identifer" + command: echo "${CIRCLE_SHA1}" > artifact-info.txt upload_artifact: description: "upload artifact to s3" steps: - s3/copy: from: artifact.tar - to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/' # using ${CIRCLE_BRANCH} for separating build artifact by branch + to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/' aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION + arguments: '--metadata "{\"x-amz-artifact-id\": \"${CIRCLE_SHA1}\" }"' upload_checksum: - description: "upload artifact checksum to s3" + description: "upload artifact commit id to s3" steps: - - run: - name: - command: | - sha256sum artifact.tar | cut -d ' ' -f 1 > artifact-info.txt - s3/copy: from: artifact-info.txt - to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/' # using ${CIRCLE_BRANCH} for separating build artifact by branch + to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/' aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION @@ -163,10 +163,10 @@ jobs: - compress - upload_artifact # uploading the built code to s3 to create a backup of key services separate from Kubernetes deployment - upload_checksum # uploading compressed artifact checksum to cross match artifact fingerprint before actual deployment - #- docker: - # target: "production" - #- k8s_deploy: - # target: "production" + - docker: + target: "production" + - k8s_deploy: + target: "production" workflows: test: @@ -187,5 +187,5 @@ workflows: ignore: /.*/ tags: only: /^production.*/ - context: binary-frontend-deploy + context: binary-frontend-artifact-upload From dbde849f972f9d455d711dbecbe9ec289e87f3dd Mon Sep 17 00:00:00 2001 From: shudarshon Date: Fri, 7 Feb 2020 18:55:30 +0800 Subject: [PATCH 06/30] test: testing pipeline by changing context name --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 258591ebe7..7593b41879 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -187,5 +187,5 @@ workflows: ignore: /.*/ tags: only: /^production.*/ - context: binary-frontend-artifact-upload + context: binary-frontend-deploy From c8fbd39008c343f80dc9b7035afc00a8cb314dc5 Mon Sep 17 00:00:00 2001 From: shudarshon Date: Fri, 7 Feb 2020 18:59:01 +0800 Subject: [PATCH 07/30] edit: reverting back production workflow context name --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7593b41879..258591ebe7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -187,5 +187,5 @@ workflows: ignore: /.*/ tags: only: /^production.*/ - context: binary-frontend-deploy + context: binary-frontend-artifact-upload From a345126d45787c7021e211c1f6129d2a7c1b093e Mon Sep 17 00:00:00 2001 From: shudarshon Date: Fri, 7 Feb 2020 19:04:43 +0800 Subject: [PATCH 08/30] remove: remove unnecessary steps needed for testing --- .circleci/config.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 258591ebe7..d1b5369d64 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -135,11 +135,7 @@ jobs: steps: - git_checkout_from_cache - npm_install - #- npm_test - - build - - compress - - upload_artifact # uploading the built code to s3 to create a backup of key services separate from Kubernetes deployment - - upload_checksum # uploading compressed artifact checksum to cross match artifact fingerprint before actual deployment + - npm_test release_beta: docker: From 20c69981a0afd8e3ab8656d58f38cc19bdeb79ad Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 10 Feb 2020 13:35:05 +0800 Subject: [PATCH 09/30] Update JS-Interpreter to 2.1.0 --- package-lock.json | 28 ++++++++++------------------ package.json | 3 ++- src/botPage/bot/Interpreter.js | 20 ++++++++++++++++++-- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index cd0e2300a2..d51f94522c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3022,10 +3022,8 @@ } }, "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true + "version": "github:aminmarashi/clone#d97b4f0ff3d3afebcaaf4a2ecc9c50fbce914900", + "from": "github:aminmarashi/clone#d97b4f" }, "clone-buffer": { "version": "1.0.0", @@ -9365,24 +9363,18 @@ "dev": true }, "js-interpreter": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/js-interpreter/-/js-interpreter-1.4.6.tgz", - "integrity": "sha1-DHv71+9qU8wbO6FtkGtji/CFUhQ=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/js-interpreter/-/js-interpreter-2.1.0.tgz", + "integrity": "sha512-ZaBpfhtBuWhySGjBwdpuuMH/loUXk5XNVNCOQs6rEImmzxr1NeFfYi4DtdDpB5t4pth3dmL46DcZP8W4SY9SVw==", "dev": true, "requires": { - "acorn": "^4.0.11", - "clone": "github:aminmarashi/clone#d97b4f" + "minimist": "^1.2.0" }, "dependencies": { - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", - "dev": true - }, - "clone": { - "version": "github:aminmarashi/clone#d97b4f0ff3d3afebcaaf4a2ecc9c50fbce914900", - "from": "github:aminmarashi/clone#d97b4f", + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } diff --git a/package.json b/package.json index 12cf1bb8fd..eda7a5102b 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "jquery": "^3.4.1", "jquery-ui": "1.12.1", "jquery-ui-css": "1.11.4", - "js-interpreter": "^1.4.6", + "js-interpreter": "^2.1.0", "json2csv": "^3.11.5", "lint-staged": "^8.1.7", "loader-utils": "^1.1.0", @@ -105,6 +105,7 @@ "@binary-com/smartcharts": "^0.6.1", "binary-style": "^0.2.4", "blockly": "github:google/blockly#59e5ac6", + "clone": "aminmarashi/clone#d97b4f", "commander": "^2.20.0", "concat-stream": "^2.0.0", "core-js": "^2.6.5", diff --git a/src/botPage/bot/Interpreter.js b/src/botPage/bot/Interpreter.js index 73eaac960d..bb409a0010 100644 --- a/src/botPage/bot/Interpreter.js +++ b/src/botPage/bot/Interpreter.js @@ -1,8 +1,20 @@ +import clone from 'clone'; import JSInterpreter from 'js-interpreter'; import { observer as globalObserver } from '../../common/utils/observer'; import { createScope } from './CliTools'; import Interface from './Interface'; +JSInterpreter.prototype.takeStateSnapshot = function() { + const newStateStack = clone(this.stateStack, undefined, undefined, undefined, true); + return newStateStack; +}; + +JSInterpreter.prototype.restoreStateSnapshot = function(snapshot) { + this.stateStack = clone(snapshot, undefined, undefined, undefined, true); + this.global = this.stateStack[0].scope; + this.initFunc_(this, this.global); +}; + const unrecoverableErrors = [ 'InsufficientBalance', 'CustomLimitsReached', @@ -169,7 +181,7 @@ export default class Interpreter { } } createAsync(interpreter, func) { - return interpreter.createAsyncFunction((...args) => { + const asyncFunc = (...args) => { const callback = args.pop(); func(...args.map(arg => interpreter.pseudoToNative(arg))) @@ -178,7 +190,11 @@ export default class Interpreter { this.loop(); }) .catch(e => this.$scope.observer.emit('Error', e)); - }); + }; + + // Manually assign length prop so JS-Interpreter doesn't ignore args. + Object.defineProperty(asyncFunc, 'length', { value: func.length + 1 }); + return interpreter.createAsyncFunction(asyncFunc); } hasStarted() { return !this.stopped; From 68a713b8aedb6f7aebb1223ff5a99100ce878fdf Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 10 Feb 2020 13:38:26 +0800 Subject: [PATCH 10/30] Add linting exceptions --- src/botPage/bot/Interpreter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/botPage/bot/Interpreter.js b/src/botPage/bot/Interpreter.js index bb409a0010..3ece72019e 100644 --- a/src/botPage/bot/Interpreter.js +++ b/src/botPage/bot/Interpreter.js @@ -4,6 +4,7 @@ import { observer as globalObserver } from '../../common/utils/observer'; import { createScope } from './CliTools'; import Interface from './Interface'; +/* eslint-disable func-names, no-underscore-dangle */ JSInterpreter.prototype.takeStateSnapshot = function() { const newStateStack = clone(this.stateStack, undefined, undefined, undefined, true); return newStateStack; @@ -14,6 +15,7 @@ JSInterpreter.prototype.restoreStateSnapshot = function(snapshot) { this.global = this.stateStack[0].scope; this.initFunc_(this, this.global); }; +/* eslint-enable */ const unrecoverableErrors = [ 'InsufficientBalance', From d58b939b1d51e28ac5db821ac62f9dac08400caf Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 10 Feb 2020 14:00:13 +0800 Subject: [PATCH 11/30] Trigger build From da54c1496a2c59edac4dcf97d50bccdd2d2e5c86 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 10 Feb 2020 17:15:56 +0800 Subject: [PATCH 12/30] Pass arrow functions to createAsync function --- src/botPage/bot/Interpreter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/botPage/bot/Interpreter.js b/src/botPage/bot/Interpreter.js index 3ece72019e..2a6582240f 100644 --- a/src/botPage/bot/Interpreter.js +++ b/src/botPage/bot/Interpreter.js @@ -70,9 +70,9 @@ export default class Interpreter { const pseudoBotIf = interpreter.nativeToPseudo(BotIf); - Object.entries(ticksIf).forEach(([name, f]) => - interpreter.setProperty(pseudoBotIf, name, this.createAsync(interpreter, f)) - ); + Object.entries(ticksIf).forEach(([name, f]) => { + interpreter.setProperty(pseudoBotIf, name, this.createAsync(interpreter, args => f(args))); + }); interpreter.setProperty( pseudoBotIf, From aeb3d36457d314d558bfff5edde52e4c9896c5c6 Mon Sep 17 00:00:00 2001 From: Amin Marashi Date: Tue, 11 Feb 2020 11:20:43 +0800 Subject: [PATCH 13/30] Add workaround for unknown args number --- src/botPage/bot/Interpreter.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/botPage/bot/Interpreter.js b/src/botPage/bot/Interpreter.js index 2a6582240f..7eb6a2dcb1 100644 --- a/src/botPage/bot/Interpreter.js +++ b/src/botPage/bot/Interpreter.js @@ -186,7 +186,15 @@ export default class Interpreter { const asyncFunc = (...args) => { const callback = args.pop(); - func(...args.map(arg => interpreter.pseudoToNative(arg))) + // Workaround for unknown number of args + const reversedArgs = args.slice().reverse(); + const firsDefinedArgIdx = reversedArgs.findIndex(arg => arg !== undefined); + + // Remove extra undefined args from end of the args + const functionArgs = firsDefinedArgIdx < 0 ? [] : reversedArgs.slice(firsDefinedArgIdx).reverse(); + // End of workaround + + func(...functionArgs.map(arg => interpreter.pseudoToNative(arg))) .then(rv => { callback(interpreter.nativeToPseudo(rv)); this.loop(); @@ -194,8 +202,10 @@ export default class Interpreter { .catch(e => this.$scope.observer.emit('Error', e)); }; - // Manually assign length prop so JS-Interpreter doesn't ignore args. - Object.defineProperty(asyncFunc, 'length', { value: func.length + 1 }); + // TODO: This is a workaround, create issue on original repo, once fixed + // remove this. We don't know how many args are going to be passed, so we + // assume a max of 100. + Object.defineProperty(asyncFunc, 'length', { value: 100 }); return interpreter.createAsyncFunction(asyncFunc); } hasStarted() { From 74f92fe405388eb50e0fc4580c082e1afccd3b00 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Tue, 11 Feb 2020 11:21:52 +0800 Subject: [PATCH 14/30] Revert passing arrow functions --- src/botPage/bot/Interpreter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/botPage/bot/Interpreter.js b/src/botPage/bot/Interpreter.js index 7eb6a2dcb1..421d488c09 100644 --- a/src/botPage/bot/Interpreter.js +++ b/src/botPage/bot/Interpreter.js @@ -71,7 +71,7 @@ export default class Interpreter { const pseudoBotIf = interpreter.nativeToPseudo(BotIf); Object.entries(ticksIf).forEach(([name, f]) => { - interpreter.setProperty(pseudoBotIf, name, this.createAsync(interpreter, args => f(args))); + interpreter.setProperty(pseudoBotIf, name, this.createAsync(interpreter, f)); }); interpreter.setProperty( From a85bcc4658c15bd671be70c5ab9747263360b548 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Wed, 12 Feb 2020 13:52:23 +0800 Subject: [PATCH 15/30] Set max args to variable for clarity --- src/botPage/bot/Interpreter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/botPage/bot/Interpreter.js b/src/botPage/bot/Interpreter.js index 421d488c09..c6b4ce1a05 100644 --- a/src/botPage/bot/Interpreter.js +++ b/src/botPage/bot/Interpreter.js @@ -205,7 +205,8 @@ export default class Interpreter { // TODO: This is a workaround, create issue on original repo, once fixed // remove this. We don't know how many args are going to be passed, so we // assume a max of 100. - Object.defineProperty(asyncFunc, 'length', { value: 100 }); + const MAX_ACCEPTABLE_FUNC_ARGS = 100; + Object.defineProperty(asyncFunc, 'length', { value: MAX_ACCEPTABLE_FUNC_ARGS + 1 }); return interpreter.createAsyncFunction(asyncFunc); } hasStarted() { From e6bad115a0fd6f6c1451c83aa410e56d602c910f Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 17 Feb 2020 11:57:13 +0800 Subject: [PATCH 16/30] Refactor + reload page on InvalidToken/AuthRequired --- src/botPage/bot/tools.js | 41 +++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/src/botPage/bot/tools.js b/src/botPage/bot/tools.js index 49f15f96b4..397e459682 100644 --- a/src/botPage/bot/tools.js +++ b/src/botPage/bot/tools.js @@ -99,12 +99,25 @@ const getBackoffDelay = (error, delayIndex) => { return linearIncrease * 1000; }; -export const shouldThrowError = (e, types = [], delayIndex = 0) => - e && - (!types - .concat(['CallError', 'WrongResponse', 'GetProposalFailure', 'RateLimit', 'DisconnectError']) - .includes(e.name) || - (e.name !== 'DisconnectError' && delayIndex > maxRetries)); +export const shouldThrowError = (error, types = [], delayIndex = 0) => { + if (!error) { + return false; + } + + const defaultErrors = ['CallError', 'WrongResponse', 'GetProposalFailure', 'RateLimit', 'DisconnectError']; + + const errors = types.concat(defaultErrors); + + if (errors.includes(error.name)) { + // If error is unrecoverable, throw error. + return true; + } else if (error.name !== 'DisconnectError' && delayIndex > maxRetries) { + // If exceeded maxRetries, throw error. + return true; + } + + return false; +}; export const recoverFromError = (f, r, types, delayIndex) => new Promise((resolve, reject) => { @@ -125,14 +138,24 @@ export const recoverFromError = (f, r, types, delayIndex) => }); }); -export const doUntilDone = (f, types) => { +export const doUntilDone = (func, errorTypes) => { let delayIndex = 0; + const criticalErrors = ['InvalidToken', 'AuthorizationRequired']; return new Promise((resolve, reject) => { + delayIndex++; + const repeat = () => { - recoverFromError(f, (errorCode, makeDelay) => makeDelay().then(repeat), types, delayIndex++) + const makeDelayFunc = (errorCode, makeDelay) => makeDelay().then(repeat); + recoverFromError(func, makeDelayFunc, errorTypes, delayIndex) .then(resolve) - .catch(reject); + .catch(e => { + reject(e); + + if (criticalErrors.includes(e.name)) { + window.location.reload(); + } + }); }; repeat(); }); From 7cae2ccb5cf347166b322fea3e2ad3570dbc66b3 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 17 Feb 2020 11:57:43 +0800 Subject: [PATCH 17/30] Remove empty line --- src/botPage/bot/tools.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/botPage/bot/tools.js b/src/botPage/bot/tools.js index 397e459682..c494d41af0 100644 --- a/src/botPage/bot/tools.js +++ b/src/botPage/bot/tools.js @@ -105,7 +105,6 @@ export const shouldThrowError = (error, types = [], delayIndex = 0) => { } const defaultErrors = ['CallError', 'WrongResponse', 'GetProposalFailure', 'RateLimit', 'DisconnectError']; - const errors = types.concat(defaultErrors); if (errors.includes(error.name)) { From 7db8f67fb58555c6710360816d5a7cddb7bc08f9 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 17 Feb 2020 13:14:49 +0800 Subject: [PATCH 18/30] Throw TrackJSError, supply meta data --- src/botPage/bot/TradeEngine/Proposal.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/botPage/bot/TradeEngine/Proposal.js b/src/botPage/bot/TradeEngine/Proposal.js index 8fced7acd7..18d450e68d 100644 --- a/src/botPage/bot/TradeEngine/Proposal.js +++ b/src/botPage/bot/TradeEngine/Proposal.js @@ -1,6 +1,7 @@ import { translate } from '../../../common/i18n'; import { tradeOptionToProposal, doUntilDone } from '../tools'; import { proposalsReady, clearProposals } from './state/actions'; +import { TrackJSError } from '../../view/logger'; export default Engine => class Proposal extends Engine { @@ -30,7 +31,11 @@ export default Engine => }); if (!toBuy) { - throw Error(translate('Selected proposal does not exist')); + throw new TrackJSError( + 'CustomInvalidProposal', + translate('Selected proposal does not exist'), + Array.from(this.data.get('proposals')).map(proposal => proposal[1]) + ); } return { From 18e5abc0dbad0030758adfbef1a1e7251617005f Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 17 Feb 2020 13:27:03 +0800 Subject: [PATCH 19/30] Relay correct error to TrackJS --- src/botPage/bot/TradeEngine/Proposal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/botPage/bot/TradeEngine/Proposal.js b/src/botPage/bot/TradeEngine/Proposal.js index 18d450e68d..c508ef9408 100644 --- a/src/botPage/bot/TradeEngine/Proposal.js +++ b/src/botPage/bot/TradeEngine/Proposal.js @@ -23,7 +23,8 @@ export default Engine => this.data.get('proposals').forEach(proposal => { if (proposal.contractType === contractType) { if (proposal.error) { - throw Error(proposal.error.error.error.message); + const { error } = proposal.error; + throw new TrackJSError(error.error.code, error.error.message, error); } else { toBuy = proposal; } From 8b799cb320e4a4178070e22e12952f0e31664f2c Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 17 Feb 2020 13:34:39 +0800 Subject: [PATCH 20/30] Remove isRequired prop on PropTypes --- src/botPage/view/LogTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/botPage/view/LogTable.js b/src/botPage/view/LogTable.js index a2a06d4acf..b8f413afb1 100644 --- a/src/botPage/view/LogTable.js +++ b/src/botPage/view/LogTable.js @@ -24,7 +24,7 @@ export default class LogTable extends Component { type : PropTypes.string, timestamp: PropTypes.string, message : PropTypes.string, - }).isRequired, + }), }; constructor() { super(); From 08bd3a12d6de2d71411c8fff92e841a64a5f13ed Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 17 Feb 2020 14:59:57 +0800 Subject: [PATCH 21/30] Promise all subscriptions to be executed --- src/botPage/bot/TradeEngine/Proposal.js | 55 +++++++++++++------------ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/src/botPage/bot/TradeEngine/Proposal.js b/src/botPage/bot/TradeEngine/Proposal.js index c508ef9408..b76ed969e2 100644 --- a/src/botPage/bot/TradeEngine/Proposal.js +++ b/src/botPage/bot/TradeEngine/Proposal.js @@ -52,34 +52,37 @@ export default Engine => this.store.dispatch(clearProposals()); } requestProposals() { - this.proposalTemplates.map(proposal => - doUntilDone(() => - this.api - .subscribeToPriceForContractProposal(proposal) - // eslint-disable-next-line consistent-return - .catch(e => { - if (e && e.name === 'RateLimit') { - return Promise.reject(e); - } - - const errorCode = e.error && e.error.error && e.error.error.code; - - if (errorCode === 'ContractBuyValidationError') { - const { uuid } = e.error.echo_req.passthrough; - - if (!this.data.hasIn(['forgetProposals', uuid])) { - this.data = this.data.setIn(['proposals', uuid], { - ...proposal, - contractType: proposal.contract_type, - error : e, - }); + Promise.all( + this.proposalTemplates.map(proposal => + doUntilDone(() => + this.api + .subscribeToPriceForContractProposal(proposal) + // eslint-disable-next-line consistent-return + .catch(e => { + if (e && e.name === 'RateLimit') { + return Promise.reject(e); } - } else { - this.$scope.observer.emit('Error', e); - } - }) + + const errorCode = e.error && e.error.error && e.error.error.code; + + if (errorCode === 'ContractBuyValidationError') { + const { uuid } = e.error.echo_req.passthrough; + + if (!this.data.hasIn(['forgetProposals', uuid])) { + // Add to proposals map with error. Will later be shown to user, see selectProposal. + this.data = this.data.setIn(['proposals', uuid], { + ...proposal, + contractType: proposal.contract_type, + error : e, + }); + } + } else { + this.$scope.observer.emit('Error', e); + } + }) + ) ) - ); + ).catch(e => this.$scope.observer.emit('Error', e)); } observeProposals() { this.listen('proposal', r => { From 1bbaaff8f1ef08197ec3e2253dc14a11313be358 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 17 Feb 2020 17:02:13 +0800 Subject: [PATCH 22/30] Minor refactor --- src/botPage/bot/TradeEngine/Proposal.js | 45 ++++++++++++------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/botPage/bot/TradeEngine/Proposal.js b/src/botPage/bot/TradeEngine/Proposal.js index b76ed969e2..159a339c9f 100644 --- a/src/botPage/bot/TradeEngine/Proposal.js +++ b/src/botPage/bot/TradeEngine/Proposal.js @@ -55,31 +55,30 @@ export default Engine => Promise.all( this.proposalTemplates.map(proposal => doUntilDone(() => - this.api - .subscribeToPriceForContractProposal(proposal) - // eslint-disable-next-line consistent-return - .catch(e => { - if (e && e.name === 'RateLimit') { - return Promise.reject(e); + this.api.subscribeToPriceForContractProposal(proposal).catch(e => { + if (e && e.name === 'RateLimit') { + return e; + } + + const errorCode = e.error && e.error.error && e.error.error.code; + + if (errorCode === 'ContractBuyValidationError') { + const { uuid } = e.error.echo_req.passthrough; + + if (!this.data.hasIn(['forgetProposals', uuid])) { + // Add to proposals map with error. Will later be shown to user, see selectProposal. + this.data = this.data.setIn(['proposals', uuid], { + ...proposal, + ...proposal.passthrough, + error: e, + }); } - const errorCode = e.error && e.error.error && e.error.error.code; - - if (errorCode === 'ContractBuyValidationError') { - const { uuid } = e.error.echo_req.passthrough; - - if (!this.data.hasIn(['forgetProposals', uuid])) { - // Add to proposals map with error. Will later be shown to user, see selectProposal. - this.data = this.data.setIn(['proposals', uuid], { - ...proposal, - contractType: proposal.contract_type, - error : e, - }); - } - } else { - this.$scope.observer.emit('Error', e); - } - }) + return null; + } + + return e; + }) ) ) ).catch(e => this.$scope.observer.emit('Error', e)); From 10912f443d08f2ea12f43caf00f1168cacdcbbb1 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Mon, 17 Feb 2020 17:02:41 +0800 Subject: [PATCH 23/30] Remove ContractBuyValidationError from unrecoverable errors --- src/botPage/bot/Interpreter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/botPage/bot/Interpreter.js b/src/botPage/bot/Interpreter.js index 73eaac960d..1c7a1bd01d 100644 --- a/src/botPage/bot/Interpreter.js +++ b/src/botPage/bot/Interpreter.js @@ -8,7 +8,6 @@ const unrecoverableErrors = [ 'CustomLimitsReached', 'OfferingsValidationError', 'InvalidCurrency', - 'ContractBuyValidationError', 'NotDefaultCurrency', 'PleaseAuthenticate', 'FinancialAssessmentRequired', From 1b3a462aab0f4f22f2e132624086158814f5aad7 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Tue, 18 Feb 2020 15:58:36 +0800 Subject: [PATCH 24/30] Revert return value --- src/botPage/bot/TradeEngine/Proposal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/botPage/bot/TradeEngine/Proposal.js b/src/botPage/bot/TradeEngine/Proposal.js index 159a339c9f..e421dc7114 100644 --- a/src/botPage/bot/TradeEngine/Proposal.js +++ b/src/botPage/bot/TradeEngine/Proposal.js @@ -57,7 +57,7 @@ export default Engine => doUntilDone(() => this.api.subscribeToPriceForContractProposal(proposal).catch(e => { if (e && e.name === 'RateLimit') { - return e; + return Promise.reject(e); } const errorCode = e.error && e.error.error && e.error.error.code; From 0bde3cdc123cbf43113ba3d98715e16db9f5c93d Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Tue, 18 Feb 2020 18:03:35 +0800 Subject: [PATCH 25/30] Throw rather than returning values --- src/botPage/bot/TradeEngine/Proposal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/botPage/bot/TradeEngine/Proposal.js b/src/botPage/bot/TradeEngine/Proposal.js index e421dc7114..e9203b3379 100644 --- a/src/botPage/bot/TradeEngine/Proposal.js +++ b/src/botPage/bot/TradeEngine/Proposal.js @@ -57,7 +57,7 @@ export default Engine => doUntilDone(() => this.api.subscribeToPriceForContractProposal(proposal).catch(e => { if (e && e.name === 'RateLimit') { - return Promise.reject(e); + throw e; } const errorCode = e.error && e.error.error && e.error.error.code; @@ -77,7 +77,7 @@ export default Engine => return null; } - return e; + throw e; }) ) ) From c33eb942d692864d16c2f537596cbc6ed4066806 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Tue, 18 Feb 2020 18:04:04 +0800 Subject: [PATCH 26/30] Add auth errors --- src/botPage/bot/tools.js | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/botPage/bot/tools.js b/src/botPage/bot/tools.js index c494d41af0..9008c5987c 100644 --- a/src/botPage/bot/tools.js +++ b/src/botPage/bot/tools.js @@ -105,9 +105,14 @@ export const shouldThrowError = (error, types = [], delayIndex = 0) => { } const defaultErrors = ['CallError', 'WrongResponse', 'GetProposalFailure', 'RateLimit', 'DisconnectError']; + const authErrors = ['InvalidToken', 'AuthorizationRequired']; const errors = types.concat(defaultErrors); - if (errors.includes(error.name)) { + if (authErrors.includes(error.name)) { + // If auth error, reload page. + window.location.reload(); + return true; + } else if (!errors.includes(error.name)) { // If error is unrecoverable, throw error. return true; } else if (error.name !== 'DisconnectError' && delayIndex > maxRetries) { @@ -137,24 +142,14 @@ export const recoverFromError = (f, r, types, delayIndex) => }); }); -export const doUntilDone = (func, errorTypes) => { +export const doUntilDone = (f, types) => { let delayIndex = 0; - const criticalErrors = ['InvalidToken', 'AuthorizationRequired']; return new Promise((resolve, reject) => { - delayIndex++; - const repeat = () => { - const makeDelayFunc = (errorCode, makeDelay) => makeDelay().then(repeat); - recoverFromError(func, makeDelayFunc, errorTypes, delayIndex) + recoverFromError(f, (errorCode, makeDelay) => makeDelay().then(repeat), types, delayIndex++) .then(resolve) - .catch(e => { - reject(e); - - if (criticalErrors.includes(e.name)) { - window.location.reload(); - } - }); + .catch(reject); }; repeat(); }); From 8fb0d06f64126c7bf571700ad7a3563288d67692 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Thu, 20 Feb 2020 11:16:56 +0800 Subject: [PATCH 27/30] Verify size of proposal templates array --- src/botPage/bot/TradeEngine/Proposal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/botPage/bot/TradeEngine/Proposal.js b/src/botPage/bot/TradeEngine/Proposal.js index e9203b3379..a2a5c0e3ad 100644 --- a/src/botPage/bot/TradeEngine/Proposal.js +++ b/src/botPage/bot/TradeEngine/Proposal.js @@ -129,7 +129,7 @@ export default Engine => checkProposalReady() { const proposals = this.data.get('proposals'); - if (proposals && proposals.size) { + if (proposals && proposals.size === this.proposalTemplates.length) { const isSameWithTemplate = this.proposalTemplates.every(p => this.data.hasIn(['proposals', p.passthrough.uuid]) ); From de15f3741cfca812a17be855194463719eff969a Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Thu, 20 Feb 2020 11:39:07 +0800 Subject: [PATCH 28/30] Update package-lock.json --- package-lock.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package-lock.json b/package-lock.json index d51f94522c..f85a178a3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15330,6 +15330,12 @@ "replace-ext": "^1.0.0" }, "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, "replace-ext": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", From 9e7c99e0f116e265b6c5409cb0703395ccac2972 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Fri, 21 Feb 2020 17:13:18 +0800 Subject: [PATCH 29/30] Update interpreter to 2.2.0 --- package-lock.json | 6 +++--- package.json | 2 +- src/botPage/bot/Interpreter.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index f85a178a3c..51ba19a628 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9363,9 +9363,9 @@ "dev": true }, "js-interpreter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/js-interpreter/-/js-interpreter-2.1.0.tgz", - "integrity": "sha512-ZaBpfhtBuWhySGjBwdpuuMH/loUXk5XNVNCOQs6rEImmzxr1NeFfYi4DtdDpB5t4pth3dmL46DcZP8W4SY9SVw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/js-interpreter/-/js-interpreter-2.2.0.tgz", + "integrity": "sha512-eZq/kAEjxahuGowG91tWLVgzPuLGGqyakTFF7JPlblV6b/Uu9EOnYxs5EOSVQlKwHoq7MND0gu1zk3OGs5a6Iw==", "dev": true, "requires": { "minimist": "^1.2.0" diff --git a/package.json b/package.json index eda7a5102b..bebe152b02 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "jquery": "^3.4.1", "jquery-ui": "1.12.1", "jquery-ui-css": "1.11.4", - "js-interpreter": "^2.1.0", + "js-interpreter": "^2.2.0", "json2csv": "^3.11.5", "lint-staged": "^8.1.7", "loader-utils": "^1.1.0", diff --git a/src/botPage/bot/Interpreter.js b/src/botPage/bot/Interpreter.js index b0c41397fd..42633ae81c 100644 --- a/src/botPage/bot/Interpreter.js +++ b/src/botPage/bot/Interpreter.js @@ -12,8 +12,8 @@ JSInterpreter.prototype.takeStateSnapshot = function() { JSInterpreter.prototype.restoreStateSnapshot = function(snapshot) { this.stateStack = clone(snapshot, undefined, undefined, undefined, true); - this.global = this.stateStack[0].scope; - this.initFunc_(this, this.global); + this.globalObject = this.stateStack[0].scope.object; + this.initFunc_(this, this.globalObject); }; /* eslint-enable */ From cc86f90874dec6d4a0f091c583892ac9cf71a256 Mon Sep 17 00:00:00 2001 From: shudarshon Date: Tue, 25 Feb 2020 17:12:54 +0800 Subject: [PATCH 30/30] remove: removed unneeded context setting from test job --- .circleci/config.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d1b5369d64..55baccb028 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,8 +12,8 @@ commands: - source-v1-{{ .Branch }}-{{ .Revision }} - source-v1-{{ .Branch }}- - source-v1- - - run: - name: Fetch git tags + - run: + name: Fetch git tags command: | mkdir -p ~/.ssh echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ' >> ~/.ssh/known_hosts @@ -24,7 +24,7 @@ commands: fi - checkout - run: - name: Compress git objects + name: Compress git objects command: git gc - save_cache: name: Git save cache @@ -68,7 +68,7 @@ commands: upload_artifact: description: "upload artifact to s3" steps: - - s3/copy: + - s3/copy: from: artifact.tar to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/' aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID @@ -78,7 +78,7 @@ commands: upload_checksum: description: "upload artifact commit id to s3" steps: - - s3/copy: + - s3/copy: from: artifact-info.txt to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/' aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID @@ -91,13 +91,13 @@ commands: type: string steps: - setup_remote_docker - - run: + - run: name: Building docker image for << parameters.target >> command: | build_tag="${CIRCLE_SHA1}" [ "<< parameters.target >>" == "beta" ] && build_tag="beta-${CIRCLE_SHA1}" docker build -t ${DOCKHUB_ORGANISATION}/binary-static-bot:${build_tag} . - - run: + - run: name: Pushing Image to docker hub command: | build_tag="${CIRCLE_SHA1}" @@ -111,7 +111,7 @@ commands: type: string steps: - k8s/install-kubectl - - run: + - run: name: Deploying to k8s cluster for service binary-bot-beta command: | build_tag="${CIRCLE_SHA1}" @@ -148,7 +148,7 @@ jobs: target: "beta" - k8s_deploy: target: "beta" - + release_production: docker: - image: circleci/node:12.13.0-stretch @@ -167,8 +167,7 @@ jobs: workflows: test: jobs: - - test: - context: binary-frontend-deploy + - test release: jobs: - release_beta: @@ -184,4 +183,3 @@ workflows: tags: only: /^production.*/ context: binary-frontend-artifact-upload -