From df1fc51cf94fee511f840132e594680bcbbf1f68 Mon Sep 17 00:00:00 2001 From: w-bonelli Date: Sun, 6 Aug 2023 09:29:20 -0400 Subject: [PATCH 1/2] fix(build_docs.py): filter benchmark artifacts by branch --- distribution/build_docs.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/distribution/build_docs.py b/distribution/build_docs.py index 37d5ad57fa6..94289def394 100644 --- a/distribution/build_docs.py +++ b/distribution/build_docs.py @@ -16,8 +16,12 @@ import pytest from flaky import flaky from modflow_devtools.build import meson_build -from modflow_devtools.download import (download_and_unzip, download_artifact, - get_release, list_artifacts) +from modflow_devtools.download import ( + download_and_unzip, + download_artifact, + get_release, + list_artifacts, +) from modflow_devtools.markers import requires_exe, requires_github from modflow_devtools.misc import is_in_ci, run_cmd, set_dir @@ -112,6 +116,9 @@ def download_benchmarks( key=lambda a: datetime.strptime(a["created_at"], "%Y-%m-%dT%H:%M:%SZ"), reverse=True, ) + artifacts = [ + a for a in artifacts if a["head_branch"] == "develop" # todo make configurable + ] most_recent = next(iter(artifacts), None) print(f"Found most recent benchmarks (artifact {most_recent['id']})") if most_recent: From ec1d64f4b7a33061927466d6260cf56070063985 Mon Sep 17 00:00:00 2001 From: Wes Bonelli Date: Mon, 7 Aug 2023 10:26:45 -0400 Subject: [PATCH 2/2] fix artifact branch name access --- distribution/build_docs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/build_docs.py b/distribution/build_docs.py index 94289def394..353ba713a31 100644 --- a/distribution/build_docs.py +++ b/distribution/build_docs.py @@ -117,7 +117,7 @@ def download_benchmarks( reverse=True, ) artifacts = [ - a for a in artifacts if a["head_branch"] == "develop" # todo make configurable + a for a in artifacts if a["workflow_run"]["head_branch"] == "develop" # todo make configurable ] most_recent = next(iter(artifacts), None) print(f"Found most recent benchmarks (artifact {most_recent['id']})")