Skip to content

Commit

Permalink
[CI] Health report integration tests use the new artifacts-api (#17274)
Browse files Browse the repository at this point in the history
migrate to the new artifacts-api
  • Loading branch information
kaisecheng authored Mar 6, 2025
1 parent d61a83a commit feb2b92
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions .buildkite/scripts/health-report-tests/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


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

def __init__(self) -> None:
f"""
Expand Down Expand Up @@ -43,20 +43,13 @@ def __init__(self) -> None:
f"rerun again")

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

if resolved_version == "":
if release_version == "":
raise ValueError(f"Cannot resolve latest version for {major_version} major")
return resolved_version
return release_version

def install_plugin(self, plugin_path: str) -> None:
util.run_or_raise_error(
Expand Down

0 comments on commit feb2b92

Please sign in to comment.