From 4546fd6942f00a9d195fd1a7031c329e53b17a20 Mon Sep 17 00:00:00 2001 From: Paige Rubendall <64206430+paigerube14@users.noreply.github.com> Date: Mon, 20 May 2024 11:48:27 -0400 Subject: [PATCH] Getting build urls for when uuid and baseline are set (#32) rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED Signed-off-by: Paige Rubendall --- orion.py | 5 ++++- utils/orion_funcs.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/orion.py b/orion.py index ce0e6ea..cf80293 100644 --- a/orion.py +++ b/orion.py @@ -67,7 +67,8 @@ def orion(**kwargs): benchmarkIndex=test['benchmarkIndex'] uuid = kwargs["uuid"] baseline = kwargs["baseline"] - match = Matcher(index="ospst-perf-scale-ci-*", + index = "ospst-perf-scale-ci-*" + match = Matcher(index=index, level=level, ES_URL=ES_URL, verify_certs=False) if uuid == "": metadata = orion_funcs.get_metadata(test, logger) @@ -85,6 +86,8 @@ def orion(**kwargs): else: uuids = [uuid for uuid in re.split(' |,',baseline) if uuid] uuids.append(uuid) + buildUrls = orion_funcs.get_build_urls(index, uuids,match) + index=benchmarkIndex if metadata["benchmark.keyword"] in ["ingress-perf","k8s-netperf"] : ids = uuids diff --git a/utils/orion_funcs.py b/utils/orion_funcs.py index 0d7909d..dc54020 100644 --- a/utils/orion_funcs.py +++ b/utils/orion_funcs.py @@ -118,6 +118,24 @@ def get_metadata(test,logger): return metadata +def get_build_urls(index, uuids,match): + """Gets metadata of the run from each test + to get the build url + + Args: + uuids (list): str list of uuid to find build urls of + match: the fmatch instance + + + Returns: + dict: dictionary of the metadata + """ + + test = match.getResults("",uuids,index,{}) + buildUrls = {run["uuid"]: run["buildUrl"] for run in test} + return buildUrls + + def filter_metadata(uuid,match,logger): """Gets metadata of the run from each test