From 3f576768fd61113d2f13978d062428cbe4b00c27 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:15:11 -0700 Subject: [PATCH] Correct the generated path for downloading plugins by their names on Windows (#4953) (#4972) * Correct the generated path for downloading plugins by their names on Windows Signed-off-by: Miki * Update snapshot for unit test Signed-off-by: Kawika Avilla * Add link for integration to lycheeexlude Signed-off-by: Kawika Avilla --------- Signed-off-by: Miki Signed-off-by: Kawika Avilla Co-authored-by: Kawika Avilla (cherry picked from commit 43fe5d50bb9bb1d16dc98640eff2468c567c0bc2) Signed-off-by: github-actions[bot] # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] --- .lycheeexclude | 1 + src/cli_plugin/install/settings.js | 5 +++-- src/cli_plugin/install/settings.test.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.lycheeexclude b/.lycheeexclude index 5bb9c969dad1..67ed88344a25 100644 --- a/.lycheeexclude +++ b/.lycheeexclude @@ -124,3 +124,4 @@ http://helpmenow.com/problem2 https://sass-lang.com/* http://api.jquery.com/* http://brandonaaron.net +https://www.circl.lu/doc/misp/ diff --git a/src/cli_plugin/install/settings.js b/src/cli_plugin/install/settings.js index 2b0c34bfcd37..cfd576f8ff5a 100644 --- a/src/cli_plugin/install/settings.js +++ b/src/cli_plugin/install/settings.js @@ -42,10 +42,11 @@ function generateUrls({ version, plugin }) { } function generatePluginUrl(version, plugin) { - const platform = process.platform === 'win32' ? 'windows' : process.platform; + const [platform, type] = + process.platform === 'win32' ? ['windows', 'zip'] : [process.platform, 'tar']; const arch = process.arch === 'arm64' ? 'arm64' : 'x64'; - return `${LATEST_PLUGIN_BASE_URL}/${version}/latest/${platform}/${arch}/tar/builds/opensearch-dashboards/plugins/${plugin}-${version}.zip`; + return `${LATEST_PLUGIN_BASE_URL}/${version}/latest/${platform}/${arch}/${type}/builds/opensearch-dashboards/plugins/${plugin}-${version}.zip`; } export function parseMilliseconds(val) { diff --git a/src/cli_plugin/install/settings.test.js b/src/cli_plugin/install/settings.test.js index ac7cf94e6761..60313e3fe9b8 100644 --- a/src/cli_plugin/install/settings.test.js +++ b/src/cli_plugin/install/settings.test.js @@ -157,7 +157,7 @@ describe('parse function', function () { "timeout": 0, "urls": Array [ "plugin name", - "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/1234/latest/windows/x64/tar/builds/opensearch-dashboards/plugins/plugin name-1234.zip", + "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/1234/latest/windows/x64/zip/builds/opensearch-dashboards/plugins/plugin name-1234.zip", ], "version": 1234, "workingPath": /plugins/.plugin.installing,