From 43f5f121906694c59bdc8b87216adb9be07d1679 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 5 May 2022 13:09:29 -0400 Subject: [PATCH 1/3] Plug clientBuildInfo into Galaxy app Documentation; fix eslint no-undef --- client/src/app/galaxy.js | 7 +++++++ client/webpack.config.js | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client/src/app/galaxy.js b/client/src/app/galaxy.js index 86dd4f59728..793079fdf51 100644 --- a/client/src/app/galaxy.js +++ b/client/src/app/galaxy.js @@ -293,6 +293,13 @@ GalaxyApp.prototype.debuggingNamespaces = function _debuggingNamespaces(namespac } }; +GalaxyApp.prototype.clientBuildInfo = { + /* global __targetEnv__, __buildTimestamp__ */ + // These are plugged in from webpack/DefinePlugin at client build time. + env: __targetEnv__, + buildTimestamp: __buildTimestamp__, +}; + /** string rep */ GalaxyApp.prototype.toString = function toString() { const userEmail = this.user ? this.user.get("email") || "(anonymous)" : "uninitialized"; diff --git a/client/webpack.config.js b/client/webpack.config.js index 12124cf8adc..508cb322add 100644 --- a/client/webpack.config.js +++ b/client/webpack.config.js @@ -72,9 +72,7 @@ module.exports = (env = {}, argv = {}) => { }, libs: { name: "libs", - test: new RegExp( - `node_modules[\\/](?!(${modulesExcludedFromLibs})[\\/])|galaxy/scripts/libs` - ), + test: new RegExp(`node_modules[\\/](?!(${modulesExcludedFromLibs})[\\/])|galaxy/scripts/libs`), chunks: "all", priority: -10, }, @@ -193,6 +191,10 @@ module.exports = (env = {}, argv = {}) => { Buffer: ["buffer", "Buffer"], process: "process/browser", }), + new webpack.DefinePlugin({ + __targetEnv__: JSON.stringify(targetEnv), + __buildTimestamp__: JSON.stringify(new Date().toISOString()), + }), new VueLoaderPlugin(), new MiniCssExtractPlugin({ filename: "[name].css", From a0fcec1d472d1752b719072df4be0a3908b08eed Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 5 May 2022 13:43:05 -0400 Subject: [PATCH 2/3] Attach to basic onload instead of GalaxyApp; no need to hang it off the object --- client/src/app/galaxy.js | 7 ------- client/src/config/development.js | 2 ++ client/src/config/production.js | 2 ++ client/src/onload/index.js | 3 ++- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/client/src/app/galaxy.js b/client/src/app/galaxy.js index 793079fdf51..86dd4f59728 100644 --- a/client/src/app/galaxy.js +++ b/client/src/app/galaxy.js @@ -293,13 +293,6 @@ GalaxyApp.prototype.debuggingNamespaces = function _debuggingNamespaces(namespac } }; -GalaxyApp.prototype.clientBuildInfo = { - /* global __targetEnv__, __buildTimestamp__ */ - // These are plugged in from webpack/DefinePlugin at client build time. - env: __targetEnv__, - buildTimestamp: __buildTimestamp__, -}; - /** string rep */ GalaxyApp.prototype.toString = function toString() { const userEmail = this.user ? this.user.get("email") || "(anonymous)" : "uninitialized"; diff --git a/client/src/config/development.js b/client/src/config/development.js index 04b763f0a47..58b4fb45d69 100644 --- a/client/src/config/development.js +++ b/client/src/config/development.js @@ -7,4 +7,6 @@ export default { revs_limit: 1, pageSize: 50, }, + /* global __buildTimestamp__ */ + buildTimestamp: __buildTimestamp__, }; diff --git a/client/src/config/production.js b/client/src/config/production.js index 617c605ecad..2b4dcd4f6b5 100644 --- a/client/src/config/production.js +++ b/client/src/config/production.js @@ -7,4 +7,6 @@ export default { revs_limit: 1, pageSize: 60, }, + /* global __buildTimestamp__ */ + buildTimestamp: __buildTimestamp__, }; diff --git a/client/src/onload/index.js b/client/src/onload/index.js index bd637657363..7630899a4c3 100644 --- a/client/src/onload/index.js +++ b/client/src/onload/index.js @@ -19,5 +19,6 @@ export { getRootFromIndexLink } from "./getRootFromIndexLink"; import config from "config"; if (!config.testBuild === true) { - console.log("Configs:", config.name, config); + console.log(`Galaxy Client '${config.name}' build, dated ${config.buildTimestamp}`); + console.debug("Full configuration:", config); } From 0a3ca4f8b569f65a5f80daeba172c4ee25ec1461 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 5 May 2022 19:49:19 -0400 Subject: [PATCH 3/3] Decorate userHistories jest test for retry for now --- client/src/components/providers/UserHistories.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/components/providers/UserHistories.test.js b/client/src/components/providers/UserHistories.test.js index ee809bb337d..83bca5d8e27 100644 --- a/client/src/components/providers/UserHistories.test.js +++ b/client/src/components/providers/UserHistories.test.js @@ -10,6 +10,10 @@ let historySummaries; let fullHistories; let currentHistoryId; +// These history tests can be flaky, so we allow a few retries while we work out +// what's going on. +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + const resetTestData = () => { const ids = [1, 2, 3, 4]; currentHistoryId = ids[0];