diff --git a/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java b/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java index e51b427db4efb..9084d4deb5274 100644 --- a/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java +++ b/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java @@ -279,11 +279,16 @@ void execute(Terminal terminal, List pluginIds, boolean isBatch, Environ /** Downloads the plugin and returns the file it was downloaded to. */ private Path download(Terminal terminal, String pluginId, Path tmpDir, boolean isBatch) throws Exception { - if (OFFICIAL_PLUGINS.contains(pluginId)) { - final String url = getElasticUrl(terminal, getStagingHash(), Version.CURRENT, isSnapshot(), pluginId, Platforms.PLATFORM_NAME); - terminal.println("-> Downloading " + pluginId + " from elastic"); - return downloadAndValidate(terminal, url, tmpDir, true, isBatch); - } + // + // Disabled installing of plugins by name (https://github.com/opendistro-for-elasticsearch/search/issues/71) + // TODO: Once we have the new artifacts repository URL, We will uncomment this section and update the URLs. + // https://github.com/opendistro-for-elasticsearch/search/issues/100 + // + // if (OFFICIAL_PLUGINS.contains(pluginId)) { + // final String url = getElasticUrl(terminal, getStagingHash(), Version.CURRENT, isSnapshot(), pluginId, Platforms.PLATFORM_NAME); + // terminal.println("-> Downloading " + pluginId + " from elastic"); + // return downloadAndValidate(terminal, url, tmpDir, true, isBatch); + // } // now try as maven coordinates, a valid URL would only have a colon and slash String[] coordinates = pluginId.split(":"); diff --git a/distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java b/distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java index 9533c811db6da..35b408f56ea9c 100644 --- a/distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java +++ b/distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java @@ -990,6 +990,7 @@ public void assertInstallPluginFromUrl( ); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testOfficialPlugin() throws Exception { String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-" + Build.CURRENT.getQualifiedVersion() @@ -997,6 +998,7 @@ public void testOfficialPlugin() throws Exception { assertInstallPluginFromUrl("analysis-icu", "analysis-icu", url, null, false); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testOfficialPluginSnapshot() throws Exception { String url = String.format( Locale.ROOT, @@ -1007,6 +1009,7 @@ public void testOfficialPluginSnapshot() throws Exception { assertInstallPluginFromUrl("analysis-icu", "analysis-icu", url, "abc123", true); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testInstallReleaseBuildOfPluginOnSnapshotBuild() { String url = String.format( Locale.ROOT, @@ -1026,6 +1029,7 @@ public void testInstallReleaseBuildOfPluginOnSnapshotBuild() { ); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testOfficialPluginStaging() throws Exception { String url = "https://staging.elastic.co/" + Version.CURRENT @@ -1035,6 +1039,7 @@ public void testOfficialPluginStaging() throws Exception { assertInstallPluginFromUrl("analysis-icu", "analysis-icu", url, "abc123", false); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testOfficialPlatformPlugin() throws Exception { String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-" + Platforms.PLATFORM_NAME @@ -1044,6 +1049,7 @@ public void testOfficialPlatformPlugin() throws Exception { assertInstallPluginFromUrl("analysis-icu", "analysis-icu", url, null, false); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testOfficialPlatformPluginSnapshot() throws Exception { String url = String.format( Locale.ROOT, @@ -1055,6 +1061,7 @@ public void testOfficialPlatformPluginSnapshot() throws Exception { assertInstallPluginFromUrl("analysis-icu", "analysis-icu", url, "abc123", true); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testOfficialPlatformPluginStaging() throws Exception { String url = "https://staging.elastic.co/" + Version.CURRENT @@ -1099,6 +1106,7 @@ public void testMavenChecksumWithoutFilename() throws Exception { ); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testOfficialChecksumWithoutFilename() throws Exception { String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-" + Build.CURRENT.getQualifiedVersion() @@ -1122,6 +1130,7 @@ public void testOfficialChecksumWithoutFilename() throws Exception { assertThat(e.getMessage(), startsWith("Invalid checksum file")); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testOfficialShaMissing() throws Exception { String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-" + Build.CURRENT.getQualifiedVersion() @@ -1165,6 +1174,7 @@ public void testMavenShaMissing() throws Exception { assertEquals("Plugin checksum missing: " + url + ".sha1", e.getMessage()); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testInvalidShaFileMissingFilename() throws Exception { String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-" + Build.CURRENT.getQualifiedVersion() @@ -1188,6 +1198,7 @@ public void testInvalidShaFileMissingFilename() throws Exception { assertTrue(e.getMessage(), e.getMessage().startsWith("Invalid checksum file")); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testInvalidShaFileMismatchFilename() throws Exception { String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-" + Build.CURRENT.getQualifiedVersion() @@ -1211,6 +1222,7 @@ public void testInvalidShaFileMismatchFilename() throws Exception { assertThat(e, hasToString(matches("checksum file at \\[.*\\] is not for this plugin"))); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testInvalidShaFileContainingExtraLine() throws Exception { String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-" + Build.CURRENT.getQualifiedVersion() @@ -1234,6 +1246,7 @@ public void testInvalidShaFileContainingExtraLine() throws Exception { assertTrue(e.getMessage(), e.getMessage().startsWith("Invalid checksum file")); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testSha512Mismatch() throws Exception { String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-" + Build.CURRENT.getQualifiedVersion() @@ -1276,6 +1289,7 @@ public void testSha1Mismatch() throws Exception { assertTrue(e.getMessage(), e.getMessage().contains("SHA-1 mismatch, expected foobar")); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testPublicKeyIdMismatchToExpectedPublicKeyId() throws Exception { final String icu = "analysis-icu"; final String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/" @@ -1311,6 +1325,7 @@ public void testPublicKeyIdMismatchToExpectedPublicKeyId() throws Exception { assertThat(e, hasToString(containsString("key id [" + actualID + "] does not match expected key id [" + expectedID + "]"))); } + @AwaitsFix(bugUrl = "https://github.com/opendistro-for-elasticsearch/search/issues/100") public void testFailedSignatureVerification() throws Exception { final String icu = "analysis-icu"; final String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/"