From 86363541b47ec91ad3147bd1532b859310278cc7 Mon Sep 17 00:00:00 2001 From: Michael Padon Date: Thu, 30 Aug 2018 10:25:40 -0500 Subject: [PATCH 1/6] Add pre-release version of percy-js for testing --- index.js | 11 ++++------- package.json | 2 +- yarn.lock | 6 +++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index a7f4d62d..b0f7a076 100644 --- a/index.js +++ b/index.js @@ -157,7 +157,8 @@ module.exports = { isPercyEnabled = false; } - if (token && repo && isPercyEnabled) { + if (token && isPercyEnabled) { + console.warn('[percy] Percy is running.'); percyClient = new PercyClient({ token: token, apiUrl: apiUrl, @@ -166,15 +167,11 @@ module.exports = { }); } else { isPercyEnabled = false; - - if (environment.ci && !token) { + console.warn('[percy] Percy is not running.'); + if (!token) { console.warn( '[percy][WARNING] Percy is disabled, no PERCY_TOKEN environment variable found.') } - if (environment.ci && !repo) { - console.warn( - '[percy][WARNING] Percy is disabled, no PERCY_PROJECT environment variable found.') - } } if (!isPercyEnabled) { return; } diff --git a/package.json b/package.json index 86855efc..36107892 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "body-parser": "^1.15.0", "ember-cli-babel": "^6.10.0", "es6-promise-pool": "^2.4.1", - "percy-client": "^2.10.0", + "percy-client": "https://github.com/percy/percy-js.git#map/update-build-creation-endpoint", "walk": "^2.3.9" }, "ember-addon": { diff --git a/yarn.lock b/yarn.lock index 78c1ac7b..fc1b970e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5433,9 +5433,9 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -percy-client@^2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/percy-client/-/percy-client-2.10.0.tgz#9e70e5c51dc32721ea72fd35efe4b18657e897a6" +"percy-client@https://github.com/percy/percy-js.git#map/update-build-creation-endpoint": + version "2.11.0" + resolved "https://github.com/percy/percy-js.git#aafc22504ccda932f763f7f9def39c9a64222c29" dependencies: base64-js "^1.2.3" bluebird "^3.5.1" From c7c7b6509dda68e4e671f08fbdaadbb9dfe5b65d Mon Sep 17 00:00:00 2001 From: Michael Padon Date: Thu, 30 Aug 2018 21:15:53 -0500 Subject: [PATCH 2/6] Bump percy-client --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index fc1b970e..eab77c42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5434,8 +5434,8 @@ path-type@^1.0.0: pinkie-promise "^2.0.0" "percy-client@https://github.com/percy/percy-js.git#map/update-build-creation-endpoint": - version "2.11.0" - resolved "https://github.com/percy/percy-js.git#aafc22504ccda932f763f7f9def39c9a64222c29" + version "2.11.1" + resolved "https://github.com/percy/percy-js.git#90adb9882817a1200537db998b60b8678671f276" dependencies: base64-js "^1.2.3" bluebird "^3.5.1" From dbf34da8bbd2b8b91b9e4102a7d5bcb036559273 Mon Sep 17 00:00:00 2001 From: Michael Padon Date: Fri, 31 Aug 2018 16:19:56 -0500 Subject: [PATCH 3/6] Remove repo from createBuild client call --- index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.js b/index.js index b0f7a076..58c2ecf6 100644 --- a/index.js +++ b/index.js @@ -149,8 +149,6 @@ module.exports = { var token = process.env.PERCY_TOKEN; var apiUrl = process.env.PERCY_API; // Optional. - var environment = new Environment(process.env); - var repo = environment.repo; // Disable if Percy is explicitly disabled or if this is not an 'ember test' run. if (process.env.PERCY_ENABLE == '0' || process.env.EMBER_ENV !== 'test') { @@ -182,7 +180,7 @@ module.exports = { }); // Initialize the percy client and a new build. - percyBuildPromise = percyClient.createBuild(repo, {resources: resources}); + percyBuildPromise = percyClient.createBuild({resources: resources}); // Return a promise and only resolve when all build resources are uploaded, which // ensures that the output build dir is still available to be read from before deleted. From 89393124bb8dab35d701bd3a58310fe22a843fc9 Mon Sep 17 00:00:00 2001 From: Michael Padon Date: Tue, 4 Sep 2018 14:30:56 -0500 Subject: [PATCH 4/6] Bump percy-client to v3.0.0 --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 36107892..de5890c5 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "body-parser": "^1.15.0", "ember-cli-babel": "^6.10.0", "es6-promise-pool": "^2.4.1", - "percy-client": "https://github.com/percy/percy-js.git#map/update-build-creation-endpoint", + "percy-client": "^3.0.0", "walk": "^2.3.9" }, "ember-addon": { diff --git a/yarn.lock b/yarn.lock index eab77c42..97e73a20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5433,9 +5433,9 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -"percy-client@https://github.com/percy/percy-js.git#map/update-build-creation-endpoint": - version "2.11.1" - resolved "https://github.com/percy/percy-js.git#90adb9882817a1200537db998b60b8678671f276" +percy-client@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/percy-client/-/percy-client-3.0.0.tgz#86289f8224817cf550c9b21aaf994b7fa16f291d" dependencies: base64-js "^1.2.3" bluebird "^3.5.1" From f5d0b350f048b5aea2abbdec167f247f38f929b3 Mon Sep 17 00:00:00 2001 From: Michael Padon Date: Tue, 4 Sep 2018 14:43:22 -0500 Subject: [PATCH 5/6] Remove unused Environment import --- index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/index.js b/index.js index 58c2ecf6..1d7d694e 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,6 @@ var fs = require('fs'); var bodyParser = require('body-parser'); var PercyClient = require('percy-client'); -var Environment = require('percy-client/dist/environment'); var PromisePool = require('es6-promise-pool'); // Some build assets we never want to upload. From 382cb5dd45b5bdee520810e3e40e5618b87b9fae Mon Sep 17 00:00:00 2001 From: Michael Padon Date: Thu, 6 Sep 2018 14:27:06 -0500 Subject: [PATCH 6/6] Remove logging when percy is not running --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1d7d694e..083320b1 100644 --- a/index.js +++ b/index.js @@ -55,6 +55,7 @@ module.exports = { _clientInfo: function() { if(!this._clientInfoCache) { + // eslint-disable-next-line node/no-missing-require var version = require('./package.json').version; this._clientInfoCache = `${this.name}/${version}`; } @@ -164,7 +165,6 @@ module.exports = { }); } else { isPercyEnabled = false; - console.warn('[percy] Percy is not running.'); if (!token) { console.warn( '[percy][WARNING] Percy is disabled, no PERCY_TOKEN environment variable found.')