From 791add0131946b450f4593d7ed8149abb4d39d20 Mon Sep 17 00:00:00 2001 From: nuwang <2070605+nuwang@users.noreply.github.com> Date: Thu, 15 Jun 2023 19:37:20 +0530 Subject: [PATCH 01/18] Slugify username received from oidc --- lib/galaxy/authnz/custos_authnz.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/galaxy/authnz/custos_authnz.py b/lib/galaxy/authnz/custos_authnz.py index dfab6fcdca8..11d1fda5764 100644 --- a/lib/galaxy/authnz/custos_authnz.py +++ b/lib/galaxy/authnz/custos_authnz.py @@ -381,6 +381,7 @@ class CustosAuthnz(IdentityProvider): username = userinfo.get("preferred_username", userinfo["email"]) if "@" in username: username = username.split("@")[0] # username created from username portion of email + username = util.ready_name_for_url(username) if trans.sa_session.query(trans.app.model.User).filter_by(username=username).first(): # if username already exists in database, append integer and iterate until unique username found count = 0 From 51fa5fc1ef303acba0f156df6883b1f19be5f3dc Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Mon, 24 Jul 2023 13:22:30 +0200 Subject: [PATCH 02/18] Display one broadcast notification at a time --- .../Broadcasts/BroadcastsOverlay.vue | 120 ++++++++++-------- 1 file changed, 66 insertions(+), 54 deletions(-) diff --git a/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue b/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue index d729843a901..e2423a5eff9 100644 --- a/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue +++ b/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue @@ -1,13 +1,16 @@ From b113a1b988cb19f98393f6052c63393d7f7b9c54 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:18:10 +0200 Subject: [PATCH 03/18] Add remaining broadcasts indicator Helps manage the expectations when multiple broadcasts will be displayed. --- .../Notifications/Broadcasts/BroadcastsOverlay.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue b/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue index e2423a5eff9..a93167e365d 100644 --- a/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue +++ b/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue @@ -22,6 +22,11 @@ const { renderMarkdown } = useMarkdown({ openLinksInNewPage: true }); const currentBroadcast = computed(() => getNextActiveBroadcast()); +const remainingBroadcastsCountText = computed(() => { + const count = activeBroadcasts.value.length - 1; + return count > 0 ? `${count} more` : ""; +}); + function getNextActiveBroadcast(): BroadcastNotification | undefined { return activeBroadcasts.value.sort(sortByPublicationTime).at(0); } @@ -94,6 +99,9 @@ function onDismiss(item: BroadcastNotification) { Dismiss +
+ {{ remainingBroadcastsCountText }}... +
From 0b09a6df69543948acc68d85c0d186fd769dcc6e Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Mon, 24 Jul 2023 15:40:44 +0200 Subject: [PATCH 04/18] Add unit tests for BroadcastsOverlay component --- .../Broadcasts/BroadcastsOverlay.test.ts | 81 +++++++++++++++++++ .../Broadcasts/BroadcastsOverlay.vue | 6 +- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 client/src/components/Notifications/Broadcasts/BroadcastsOverlay.test.ts diff --git a/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.test.ts b/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.test.ts new file mode 100644 index 00000000000..9c423edb6dd --- /dev/null +++ b/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.test.ts @@ -0,0 +1,81 @@ +import { setActivePinia } from "pinia"; +import flushPromises from "flush-promises"; +import { getLocalVue } from "@tests/jest/helpers"; +import { createTestingPinia } from "@pinia/testing"; +import BroadcastsOverlay from "./BroadcastsOverlay.vue"; +import { shallowMount } from "@vue/test-utils"; +import { type BroadcastNotification, useBroadcastsStore } from "@/stores/broadcastsStore"; + +const localVue = getLocalVue(true); + +const now = new Date(); +const inTwoMonths = new Date(now.setMonth(now.getMonth() + 2)); + +function generateBroadcastNotification(id: string): BroadcastNotification { + return { + id: id, + create_time: now.toISOString(), + update_time: now.toISOString(), + publication_time: now.toISOString(), + expiration_time: inTwoMonths.toISOString(), + source: "testing", + variant: "info", + content: { + subject: `Test subject ${id}`, + message: `Test message ${id}`, + }, + }; +} + +const FAKE_BROADCASTS: BroadcastNotification[] = [ + generateBroadcastNotification("1"), + generateBroadcastNotification("2"), +]; + +async function mountBroadcastsOverlayWith(broadcasts: BroadcastNotification[] = []) { + const pinia = createTestingPinia(); + setActivePinia(pinia); + + const broadcastsStore = useBroadcastsStore(); + broadcastsStore.broadcasts = broadcasts; + + const spyOnDismissBroadcast = jest.spyOn(broadcastsStore, "dismissBroadcast"); + spyOnDismissBroadcast.mockImplementation(async (broadcast) => { + broadcastsStore.broadcasts = broadcastsStore.broadcasts.filter((b) => b.id !== broadcast.id); + }); + + const wrapper = shallowMount(BroadcastsOverlay, { + localVue, + pinia, + }); + + await flushPromises(); + return wrapper; +} + +describe("BroadcastsOverlay.vue", () => { + it("should not render anything when there is no broadcast", async () => { + const wrapper = await mountBroadcastsOverlayWith(); + + expect(wrapper.exists()).toBe(true); + expect(wrapper.html()).toBe(""); + }); + + it("should render only one broadcast at a time", async () => { + const wrapper = await mountBroadcastsOverlayWith(FAKE_BROADCASTS); + expect(wrapper.findAll(".broadcast-message")).toHaveLength(1); + expect(wrapper.find(".broadcast-message").text()).toContain("Test message 1"); + }); + + it("should render the next broadcast when the current one is dismissed", async () => { + const wrapper = await mountBroadcastsOverlayWith(FAKE_BROADCASTS); + expect(wrapper.findAll(".broadcast-message")).toHaveLength(1); + expect(wrapper.find(".broadcast-message").text()).toContain("Test message 1"); + + const dismissButton = wrapper.find("#dismiss-button"); + await dismissButton.trigger("click"); + + expect(wrapper.findAll(".broadcast-message")).toHaveLength(1); + expect(wrapper.find(".broadcast-message").text()).toContain("Test message 2"); + }); +}); diff --git a/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue b/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue index a93167e365d..d6dcd19fcb8 100644 --- a/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue +++ b/client/src/components/Notifications/Broadcasts/BroadcastsOverlay.vue @@ -95,7 +95,11 @@ function onDismiss(item: BroadcastNotification) { - + Dismiss From 963d2f6ba9039ad929b9f4c0d34330f9c9dca91a Mon Sep 17 00:00:00 2001 From: Brian Wheeler Date: Mon, 24 Jul 2023 09:13:53 -0400 Subject: [PATCH 05/18] Fix send_file so media player works Make sure there's a valid start/end time when generating headers --- lib/galaxy/web/framework/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/web/framework/base.py b/lib/galaxy/web/framework/base.py index 361524d94b1..866f79d2453 100644 --- a/lib/galaxy/web/framework/base.py +++ b/lib/galaxy/web/framework/base.py @@ -539,9 +539,9 @@ def send_file(start_response, trans, body): start = None end = None if trans.request.range: - start = trans.request.range.start - end = trans.request.range.end - file_size = trans.response.headers["content-length"] + start = int(trans.request.range.start) + file_size = int(trans.response.headers["content-length"]) + end = int(file_size if end is None else trans.request.range.end) trans.response.headers["content-length"] = str(end - start) trans.response.headers["content-range"] = f"bytes {start}-{end - 1}/{file_size}" trans.response.status = 206 From dc8849660e1e782178a23a63c5cc3e206fb882e1 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 24 Jul 2023 15:44:11 +0200 Subject: [PATCH 06/18] Fix linting --- lib/galaxy/web/framework/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/web/framework/base.py b/lib/galaxy/web/framework/base.py index 866f79d2453..f9da4bd472e 100644 --- a/lib/galaxy/web/framework/base.py +++ b/lib/galaxy/web/framework/base.py @@ -541,7 +541,7 @@ def send_file(start_response, trans, body): if trans.request.range: start = int(trans.request.range.start) file_size = int(trans.response.headers["content-length"]) - end = int(file_size if end is None else trans.request.range.end) + end = int(file_size if end is None else trans.request.range.end) trans.response.headers["content-length"] = str(end - start) trans.response.headers["content-range"] = f"bytes {start}-{end - 1}/{file_size}" trans.response.status = 206 From 7c6bee2aa52edbf42604df291a13466b4477f5ad Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Mon, 24 Jul 2023 09:42:40 -0400 Subject: [PATCH 07/18] Fix release notes webhook tag handling for RC. --- config/plugins/webhooks/news/script.js | 35 ++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/config/plugins/webhooks/news/script.js b/config/plugins/webhooks/news/script.js index a0d0f63a09d..ca497aa52e8 100644 --- a/config/plugins/webhooks/news/script.js +++ b/config/plugins/webhooks/news/script.js @@ -6,11 +6,11 @@ } } - function newsSeen() { + function newsSeen(currentGalaxyVersion) { // When it's seen, remove fa, add far. const newsIconSpan = document.querySelector("#news .fa-bullhorn"); newsIconSpan.classList.remove("fa-fade"); - window.localStorage.setItem("galaxy-news-seen-release", Galaxy.config.version_major); + window.localStorage.setItem("galaxy-news-seen-release", currentGalaxyVersion); } function newsUnseen() { @@ -50,23 +50,26 @@ el.parentNode.replaceChild(clean, el); let currentGalaxyVersion = Galaxy.config.version_major; + const lastSeenVersion = window.localStorage.getItem("galaxy-news-seen-release"); - // If we're at the 23.1 release candidate, we want to show the 23.0 release notes still. - // This should be the last release using this hack -- new notification - // system will provide notes moving forward - - if (currentGalaxyVersion == "23.1" && Galaxy.config.version_minor.startsWith("rc")) { - currentGalaxyVersion = "23.0"; + // If we're at a deployed release candidate, just mark it seen and show + // the previous notes if someone clicks the link. RC notes won't exist. + if (Galaxy.config.version_minor.startsWith("rc")) { + // If we, for whatever reason, need to do this again just add + // another case here. It's not worth parsing and doing version + // math, and we should be able to drop preferring notifications + // framework moving forward in 23.2 + if (currentGalaxyVersion == "23.1") { + currentGalaxyVersion = "23.0"; + } + newsSeen(currentGalaxyVersion); + } else if (lastSeenVersion != currentGalaxyVersion) { + newsUnseen(); + } else { + newsSeen(currentGalaxyVersion); } const releaseNotes = `https://docs.galaxyproject.org/en/latest/releases/${currentGalaxyVersion}_announce_user.html`; - const lastSeenVersion = window.localStorage.getItem("galaxy-news-seen-release"); - // Check that they've seen the current version's release notes. - if (lastSeenVersion != currentGalaxyVersion) { - newsUnseen(); - } else { - newsSeen(); - } clean.addEventListener("click", (e) => { e.preventDefault(); @@ -92,7 +95,7 @@ }); } document.getElementById("news-container").style.visibility = "visible"; - newsSeen(); + newsSeen(currentGalaxyVersion); }); }); From f74de0752e8c14b680a01bdeffec4c1a81587175 Mon Sep 17 00:00:00 2001 From: Mira Kuntz Date: Tue, 25 Jul 2023 09:38:51 +0200 Subject: [PATCH 08/18] fix robots.txt and favicon.ico --- lib/galaxy/web/framework/middleware/static.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/web/framework/middleware/static.py b/lib/galaxy/web/framework/middleware/static.py index b8be61974ad..998131a946b 100644 --- a/lib/galaxy/web/framework/middleware/static.py +++ b/lib/galaxy/web/framework/middleware/static.py @@ -18,7 +18,10 @@ class CacheableStaticURLParser(StaticURLParser): def __call__(self, environ, start_response): path_info = environ.get("PATH_INFO", "") - if not path_info: + script_name = environ.get("SCRIPT_NAME", "") + if script_name == "/robots.txt" or script_name == "/favicon.ico": + filename = script_name.replace("/", "") + elif not path_info: # See if this is a static file hackishly mapped. if os.path.exists(self.directory) and os.path.isfile(self.directory): app = FileApp(self.directory) @@ -26,7 +29,7 @@ class CacheableStaticURLParser(StaticURLParser): app.cache_control(max_age=int(self.cache_seconds)) return app(environ, start_response) return self.add_slash(environ, start_response) - if path_info == "/": + elif path_info == "/": # @@: This should obviously be configurable filename = "index.html" else: From fd26e7cd242c463bcca406d859463a64af8cbd54 Mon Sep 17 00:00:00 2001 From: Mira Kuntz Date: Tue, 25 Jul 2023 09:39:13 +0200 Subject: [PATCH 09/18] fix hostname matching --- lib/galaxy/web/framework/middleware/static.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/web/framework/middleware/static.py b/lib/galaxy/web/framework/middleware/static.py index 998131a946b..1ac00814c57 100644 --- a/lib/galaxy/web/framework/middleware/static.py +++ b/lib/galaxy/web/framework/middleware/static.py @@ -39,7 +39,7 @@ class CacheableStaticURLParser(StaticURLParser): host = environ.get("HTTP_HOST") if self.directory_per_host and host: for host_key, host_val in self.directory_per_host.items(): - if host_key in host: + if host_key == host: directory = host_val break From af797d92b4705180b0a0a497d3ccd3f283992e3c Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Thu, 13 Apr 2023 13:43:05 +0200 Subject: [PATCH 10/18] fix linter: duplicated label check duplicated labels may be OK if there are filters --- lib/galaxy/tool_util/linters/outputs.py | 9 ++++++++- test/unit/tool_util/test_tool_linters.py | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/tool_util/linters/outputs.py b/lib/galaxy/tool_util/linters/outputs.py index 8232cbab891..24252c7b37e 100644 --- a/lib/galaxy/tool_util/linters/outputs.py +++ b/lib/galaxy/tool_util/linters/outputs.py @@ -45,7 +45,14 @@ def lint_output(tool_xml, lint_ctx): label = output.attrib.get("label", "${tool.name} on ${on_string}") if label in labels: - lint_ctx.error(f"Tool output [{name}] uses duplicated label '{label}'", node=output) + filter_node = output.find(".//filter") + if filter_node is not None: + lint_ctx.info( + f"Tool output [{name}] uses duplicated label '{label}', double check if filters imply disjoint cases", + node=output + ) + else: + lint_ctx.error(f"Tool output [{name}] uses duplicated label '{label}'", node=output) labels.add(label) format_set = False diff --git a/test/unit/tool_util/test_tool_linters.py b/test/unit/tool_util/test_tool_linters.py index f2b2db004df..7b8b63f05b2 100644 --- a/test/unit/tool_util/test_tool_linters.py +++ b/test/unit/tool_util/test_tool_linters.py @@ -566,6 +566,12 @@ OUTPUTS_DUPLICATED_NAME_LABEL = """ + + a condition + + + another condition + """ @@ -1492,8 +1498,12 @@ def test_outputs_discover_tool_provided_metadata(lint_ctx): def test_outputs_duplicated_name_label(lint_ctx): tool_source = get_xml_tool_source(OUTPUTS_DUPLICATED_NAME_LABEL) run_lint(lint_ctx, outputs.lint_output, tool_source) - assert "2 outputs found." in lint_ctx.info_messages - assert len(lint_ctx.info_messages) == 1 + assert "4 outputs found." in lint_ctx.info_messages + assert ( + "Tool output [yet_another_valid_name] uses duplicated label 'same label may be OK if there is a filter', double check if filters imply disjoint cases" + in lint_ctx.info_messages + ) + assert len(lint_ctx.info_messages) == 2 assert not lint_ctx.valid_messages assert not lint_ctx.warn_messages assert "Tool output [valid_name] has duplicated name" in lint_ctx.error_messages From 2775005b8e2e4f0dfdb1a7b00319a85d0bf515f8 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 9 May 2023 15:26:03 +0200 Subject: [PATCH 11/18] make duplicated label a warning --- lib/galaxy/tool_util/linters/outputs.py | 2 +- test/unit/tool_util/test_tool_linters.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/tool_util/linters/outputs.py b/lib/galaxy/tool_util/linters/outputs.py index 24252c7b37e..7faa597d812 100644 --- a/lib/galaxy/tool_util/linters/outputs.py +++ b/lib/galaxy/tool_util/linters/outputs.py @@ -52,7 +52,7 @@ def lint_output(tool_xml, lint_ctx): node=output ) else: - lint_ctx.error(f"Tool output [{name}] uses duplicated label '{label}'", node=output) + lint_ctx.warn(f"Tool output [{name}] uses duplicated label '{label}'", node=output) labels.add(label) format_set = False diff --git a/test/unit/tool_util/test_tool_linters.py b/test/unit/tool_util/test_tool_linters.py index 7b8b63f05b2..f63b302f2f8 100644 --- a/test/unit/tool_util/test_tool_linters.py +++ b/test/unit/tool_util/test_tool_linters.py @@ -1505,10 +1505,10 @@ def test_outputs_duplicated_name_label(lint_ctx): ) assert len(lint_ctx.info_messages) == 2 assert not lint_ctx.valid_messages - assert not lint_ctx.warn_messages + assert len(lint_ctx.warn_messages) == 1 + assert "Tool output [valid_name] uses duplicated label '${tool.name} on ${on_string}'" in lint_ctx.warn_messages assert "Tool output [valid_name] has duplicated name" in lint_ctx.error_messages - assert "Tool output [valid_name] uses duplicated label '${tool.name} on ${on_string}'" in lint_ctx.error_messages - assert len(lint_ctx.error_messages) == 2 + assert len(lint_ctx.error_messages) == 1 def test_stdio_default_for_default_profile(lint_ctx): From c684e0b305693fd768281eb70a7a1bd5c49038b1 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 9 May 2023 16:13:12 +0200 Subject: [PATCH 12/18] also warn in case of a filter --- lib/galaxy/tool_util/linters/outputs.py | 2 +- test/unit/tool_util/test_tool_linters.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/tool_util/linters/outputs.py b/lib/galaxy/tool_util/linters/outputs.py index 7faa597d812..346c580df59 100644 --- a/lib/galaxy/tool_util/linters/outputs.py +++ b/lib/galaxy/tool_util/linters/outputs.py @@ -47,7 +47,7 @@ def lint_output(tool_xml, lint_ctx): if label in labels: filter_node = output.find(".//filter") if filter_node is not None: - lint_ctx.info( + lint_ctx.warn( f"Tool output [{name}] uses duplicated label '{label}', double check if filters imply disjoint cases", node=output ) diff --git a/test/unit/tool_util/test_tool_linters.py b/test/unit/tool_util/test_tool_linters.py index f63b302f2f8..e9ea77589cf 100644 --- a/test/unit/tool_util/test_tool_linters.py +++ b/test/unit/tool_util/test_tool_linters.py @@ -1499,14 +1499,14 @@ def test_outputs_duplicated_name_label(lint_ctx): tool_source = get_xml_tool_source(OUTPUTS_DUPLICATED_NAME_LABEL) run_lint(lint_ctx, outputs.lint_output, tool_source) assert "4 outputs found." in lint_ctx.info_messages + assert len(lint_ctx.info_messages) == 1 + assert not lint_ctx.valid_messages + assert len(lint_ctx.warn_messages) == 2 + assert "Tool output [valid_name] uses duplicated label '${tool.name} on ${on_string}'" in lint_ctx.warn_messages assert ( "Tool output [yet_another_valid_name] uses duplicated label 'same label may be OK if there is a filter', double check if filters imply disjoint cases" - in lint_ctx.info_messages + in lint_ctx.warn_messages ) - assert len(lint_ctx.info_messages) == 2 - assert not lint_ctx.valid_messages - assert len(lint_ctx.warn_messages) == 1 - assert "Tool output [valid_name] uses duplicated label '${tool.name} on ${on_string}'" in lint_ctx.warn_messages assert "Tool output [valid_name] has duplicated name" in lint_ctx.error_messages assert len(lint_ctx.error_messages) == 1 From da8fc06e5af50c7fd50f46a161d8d2cb8528d2a6 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Tue, 25 Jul 2023 13:28:36 +0200 Subject: [PATCH 13/18] more black --- lib/galaxy/tool_util/linters/outputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/tool_util/linters/outputs.py b/lib/galaxy/tool_util/linters/outputs.py index 346c580df59..e3de862b883 100644 --- a/lib/galaxy/tool_util/linters/outputs.py +++ b/lib/galaxy/tool_util/linters/outputs.py @@ -49,7 +49,7 @@ def lint_output(tool_xml, lint_ctx): if filter_node is not None: lint_ctx.warn( f"Tool output [{name}] uses duplicated label '{label}', double check if filters imply disjoint cases", - node=output + node=output, ) else: lint_ctx.warn(f"Tool output [{name}] uses duplicated label '{label}'", node=output) From 37977ebed52dd8403ce3de582e84ccd26ef4613c Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 25 Jul 2023 14:11:04 +0200 Subject: [PATCH 14/18] Bump version of chromedriver setup action --- .github/workflows/selenium.yaml | 2 +- .github/workflows/selenium_beta.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/selenium.yaml b/.github/workflows/selenium.yaml index 5f976103001..0b96a35182e 100644 --- a/.github/workflows/selenium.yaml +++ b/.github/workflows/selenium.yaml @@ -66,7 +66,7 @@ jobs: - uses: mvdbeek/gha-yarn-cache@master with: yarn-lock-file: 'galaxy root/client/yarn.lock' - - uses: nanasess/setup-chromedriver@v1 + - uses: nanasess/setup-chromedriver@v2 - name: Run tests run: ./run_tests.sh --coverage -selenium lib/galaxy_test/selenium -- --num-shards=3 --shard-id=${{ matrix.chunk }} working-directory: 'galaxy root' diff --git a/.github/workflows/selenium_beta.yaml b/.github/workflows/selenium_beta.yaml index 88b080899b7..511d0d375b3 100644 --- a/.github/workflows/selenium_beta.yaml +++ b/.github/workflows/selenium_beta.yaml @@ -68,7 +68,7 @@ jobs: - uses: mvdbeek/gha-yarn-cache@master with: yarn-lock-file: 'galaxy root/client/yarn.lock' - - uses: nanasess/setup-chromedriver@v1 + - uses: nanasess/setup-chromedriver@v2 - name: Run tests run: ./run_tests.sh --coverage -selenium lib/galaxy_test/selenium -- --num-shards=3 --shard-id=${{ matrix.chunk }} working-directory: 'galaxy root' From eee86327ab70c3df5063cf78891318bcddfa58f0 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 26 Jul 2023 10:42:30 +0200 Subject: [PATCH 15/18] Use upstream command to install chrome and chromedriver --- .github/workflows/selenium.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/selenium.yaml b/.github/workflows/selenium.yaml index 0b96a35182e..0125d8258f7 100644 --- a/.github/workflows/selenium.yaml +++ b/.github/workflows/selenium.yaml @@ -66,7 +66,8 @@ jobs: - uses: mvdbeek/gha-yarn-cache@master with: yarn-lock-file: 'galaxy root/client/yarn.lock' - - uses: nanasess/setup-chromedriver@v2 + - run: npx @puppeteer/browsers install chrome@stable + - run: npx @puppeteer/browsers install chromedriver@stable - name: Run tests run: ./run_tests.sh --coverage -selenium lib/galaxy_test/selenium -- --num-shards=3 --shard-id=${{ matrix.chunk }} working-directory: 'galaxy root' From b56d785d4e66f446200c38e6d8ed132b59e44f7f Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 26 Jul 2023 11:46:13 +0200 Subject: [PATCH 16/18] Use action --- .github/workflows/selenium.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/selenium.yaml b/.github/workflows/selenium.yaml index 0125d8258f7..3811352cc6e 100644 --- a/.github/workflows/selenium.yaml +++ b/.github/workflows/selenium.yaml @@ -66,8 +66,7 @@ jobs: - uses: mvdbeek/gha-yarn-cache@master with: yarn-lock-file: 'galaxy root/client/yarn.lock' - - run: npx @puppeteer/browsers install chrome@stable - - run: npx @puppeteer/browsers install chromedriver@stable + - uses: mvdbeek/setup-chromedriver@chromedriver_puppeteer - name: Run tests run: ./run_tests.sh --coverage -selenium lib/galaxy_test/selenium -- --num-shards=3 --shard-id=${{ matrix.chunk }} working-directory: 'galaxy root' From 989551ddddd1ce5432d937ad079a0a59ceea660d Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 26 Jul 2023 12:06:15 +0200 Subject: [PATCH 17/18] Externalize selenium setup with reusable workflow --- .github/workflows/selenium.yaml | 4 +++- .github/workflows/setup_selenium.yaml | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/setup_selenium.yaml diff --git a/.github/workflows/selenium.yaml b/.github/workflows/selenium.yaml index 3811352cc6e..edb9773025d 100644 --- a/.github/workflows/selenium.yaml +++ b/.github/workflows/selenium.yaml @@ -21,8 +21,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + setup-selenium: + uses: ./.github/workflows/setup_selenium.yaml test: name: Test + needs: setup-selenium runs-on: ubuntu-latest strategy: fail-fast: false @@ -66,7 +69,6 @@ jobs: - uses: mvdbeek/gha-yarn-cache@master with: yarn-lock-file: 'galaxy root/client/yarn.lock' - - uses: mvdbeek/setup-chromedriver@chromedriver_puppeteer - name: Run tests run: ./run_tests.sh --coverage -selenium lib/galaxy_test/selenium -- --num-shards=3 --shard-id=${{ matrix.chunk }} working-directory: 'galaxy root' diff --git a/.github/workflows/setup_selenium.yaml b/.github/workflows/setup_selenium.yaml new file mode 100644 index 00000000000..4bbf7ddcfa2 --- /dev/null +++ b/.github/workflows/setup_selenium.yaml @@ -0,0 +1,8 @@ +on: + workflow_call: +jobs: + setup_chromedriver: + runs-on: ubuntu-latest + steps: + - name: Install chromedriver + uses: mvdbeek/setup-chromedriver@chromedriver_puppeteer From b9c07a7fb9c200dbb50356e02f76f09f00240be9 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 26 Jul 2023 12:29:36 +0200 Subject: [PATCH 18/18] Use reusable workflow in all selenium workflows --- .github/workflows/integration_selenium.yaml | 4 +++- .github/workflows/selenium_beta.yaml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_selenium.yaml b/.github/workflows/integration_selenium.yaml index 8e73ba98f2b..710221926b8 100644 --- a/.github/workflows/integration_selenium.yaml +++ b/.github/workflows/integration_selenium.yaml @@ -21,8 +21,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + setup-selenium: + uses: ./.github/workflows/setup_selenium.yaml test: name: Test + needs: setup-selenium runs-on: ubuntu-latest strategy: matrix: @@ -66,7 +69,6 @@ jobs: - uses: mvdbeek/gha-yarn-cache@master with: yarn-lock-file: 'galaxy root/client/yarn.lock' - - uses: nanasess/setup-chromedriver@v1 - name: Run tests run: ./run_tests.sh --coverage -integration test/integration_selenium working-directory: 'galaxy root' diff --git a/.github/workflows/selenium_beta.yaml b/.github/workflows/selenium_beta.yaml index 511d0d375b3..58a1825cee1 100644 --- a/.github/workflows/selenium_beta.yaml +++ b/.github/workflows/selenium_beta.yaml @@ -23,8 +23,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + setup-selenium: + uses: ./.github/workflows/setup_selenium.yaml test: name: Test + needs: setup-selenium runs-on: ubuntu-latest strategy: fail-fast: false @@ -68,7 +71,6 @@ jobs: - uses: mvdbeek/gha-yarn-cache@master with: yarn-lock-file: 'galaxy root/client/yarn.lock' - - uses: nanasess/setup-chromedriver@v2 - name: Run tests run: ./run_tests.sh --coverage -selenium lib/galaxy_test/selenium -- --num-shards=3 --shard-id=${{ matrix.chunk }} working-directory: 'galaxy root'