Skip to content

Commit 2fffd78

Browse files
authored
Use no-kpi subdomains for tests downloading artifacts (#64502)
This commit converts build code that downloads distributions or other artifacts to use the new no-kpi subdomain, and removes the formerly used no-kpi header.
1 parent cfe43b7 commit 2fffd78

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDownloadPlugin.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@
3434
import org.gradle.api.artifacts.dsl.DependencyHandler;
3535
import org.gradle.api.artifacts.repositories.IvyArtifactRepository;
3636
import org.gradle.api.artifacts.type.ArtifactTypeDefinition;
37-
import org.gradle.api.credentials.HttpHeaderCredentials;
3837
import org.gradle.api.internal.artifacts.ArtifactAttributes;
3938
import org.gradle.api.provider.Provider;
40-
import org.gradle.authentication.http.HttpHeaderAuthentication;
4139

4240
import java.util.Comparator;
4341

@@ -146,12 +144,6 @@ private static void addIvyRepo(Project project, String name, String url, String
146144
repo.setName(name);
147145
repo.setUrl(url);
148146
repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
149-
// this header is not a credential but we hack the capability to send this header to avoid polluting our download stats
150-
repo.credentials(HttpHeaderCredentials.class, creds -> {
151-
creds.setName("X-Elastic-No-KPI");
152-
creds.setValue("1");
153-
});
154-
repo.getAuthentication().create("header", HttpHeaderAuthentication.class);
155147
repo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
156148
});
157149
project.getRepositories().exclusiveContent(exclusiveContentRepository -> {
@@ -164,8 +156,8 @@ private static void setupDownloadServiceRepo(Project project) {
164156
if (project.getRepositories().findByName(DOWNLOAD_REPO_NAME) != null) {
165157
return;
166158
}
167-
addIvyRepo(project, DOWNLOAD_REPO_NAME, "https://artifacts.elastic.co", FAKE_IVY_GROUP);
168-
addIvyRepo(project, SNAPSHOT_REPO_NAME, "https://snapshots.elastic.co", FAKE_SNAPSHOT_IVY_GROUP);
159+
addIvyRepo(project, DOWNLOAD_REPO_NAME, "https://artifacts-no-kpi.elastic.co", FAKE_IVY_GROUP);
160+
addIvyRepo(project, SNAPSHOT_REPO_NAME, "https://snapshots-no-kpi.elastic.co", FAKE_SNAPSHOT_IVY_GROUP);
169161
}
170162

171163
/**

client/sniffer/src/test/resources/create_test_nodes_info.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ pushd ${work} >> /dev/null
2222
echo Working in ${work}
2323

2424
wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.0.0/elasticsearch-2.0.0.tar.gz
25-
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz
26-
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.tar.gz
25+
wget https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz
26+
wget https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.tar.gz
2727
sha1sum -c - << __SHAs
2828
e369d8579bd3a2e8b5344278d5043f19f14cac88 elasticsearch-2.0.0.tar.gz
2929
d25f6547bccec9f0b5ea7583815f96a6f50849e0 elasticsearch-5.0.0.tar.gz

distribution/docker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ext.expansions = { Architecture architecture, boolean oss, DockerBase base, bool
5757
sourceElasticsearch = """
5858
RUN curl --retry 8 -S -L \\
5959
--output /opt/elasticsearch.tar.gz \\
60-
https://artifacts.elastic.co/downloads/elasticsearch/$elasticsearch
60+
https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/$elasticsearch
6161
""".trim()
6262
}
6363

x-pack/plugin/sql/qa/jdbc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ subprojects {
3636
repositories {
3737
maven {
3838
// Repository for downloading BWC compatible JDBC driver releases
39-
url = 'https://artifacts.elastic.co/maven'
39+
url = 'https://artifacts-no-kpi.elastic.co/maven'
4040
}
4141
}
4242

0 commit comments

Comments
 (0)