Skip to content

Commit a28d54e

Browse files
[CI] Health report integration tests use the new artifacts-api (#17274) (#17287)
migrate to the new artifacts-api (cherry picked from commit feb2b92) Co-authored-by: kaisecheng <[email protected]>
1 parent 80ff83e commit a28d54e

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

.buildkite/scripts/health-report-tests/bootstrap.py

+6-13
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class Bootstrap:
14-
ELASTIC_STACK_VERSIONS_URL = "https://artifacts-api.elastic.co/v1/versions"
14+
ELASTIC_STACK_RELEASED_VERSION_URL = "https://storage.googleapis.com/artifacts-api/releases/current/"
1515

1616
def __init__(self) -> None:
1717
f"""
@@ -42,20 +42,13 @@ def __init__(self) -> None:
4242
f"rerun again")
4343

4444
def __resolve_latest_stack_version_for(self, major_version: str) -> str:
45-
resolved_version = ""
46-
response = util.call_url_with_retry(self.ELASTIC_STACK_VERSIONS_URL)
47-
release_versions = response.json()["versions"]
48-
for release_version in reversed(release_versions):
49-
if release_version.find("SNAPSHOT") > 0:
50-
continue
51-
if release_version.split(".")[0] == major_version:
52-
print(f"Resolved latest version for {major_version} is {release_version}.")
53-
resolved_version = release_version
54-
break
45+
resp = util.call_url_with_retry(self.ELASTIC_STACK_RELEASED_VERSION_URL + major_version)
46+
release_version = resp.text.strip()
47+
print(f"Resolved latest version for {major_version} is {release_version}.")
5548

56-
if resolved_version == "":
49+
if release_version == "":
5750
raise ValueError(f"Cannot resolve latest version for {major_version} major")
58-
return resolved_version
51+
return release_version
5952

6053
def install_plugin(self, plugin_path: str) -> None:
6154
util.run_or_raise_error(

0 commit comments

Comments
 (0)