From 51ddd939c17843bf0be3fa027a80ad57137cc847 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 13 Dec 2024 07:24:13 -0600 Subject: [PATCH 1/2] fix: refresh before testing label --- conda_forge_tick/events/pr_events.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/conda_forge_tick/events/pr_events.py b/conda_forge_tick/events/pr_events.py index ec00c2b13..d15301e77 100644 --- a/conda_forge_tick/events/pr_events.py +++ b/conda_forge_tick/events/pr_events.py @@ -16,6 +16,17 @@ def _react_to_pr(uid: str, dry_run: bool = False) -> None: pr_json = LazyJson(f"pr_json/{uid}.json") with pr_json: + if pr_json.get("state", None) != "closed": + pr_data = refresh_pr(copy.deepcopy(pr_json.data), dry_run=dry_run) + if pr_data is not None: + if ( + "Last-Modified" in pr_json + and "Last-Modified" in pr_data + and pr_json["Last-Modified"] != pr_data["Last-Modified"] + ): + print("refreshed PR data", flush=True) + pr_json.update(pr_data) + if pr_json.get("state", None) != "closed": pr_data = close_out_labels(copy.deepcopy(pr_json.data), dry_run=dry_run) if pr_data is not None: From 693ec5a34cbdf72d7c7b112ad8b0a2301538cb7f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:24:44 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- conda_forge_tick/events/pr_events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda_forge_tick/events/pr_events.py b/conda_forge_tick/events/pr_events.py index d15301e77..1556ca9db 100644 --- a/conda_forge_tick/events/pr_events.py +++ b/conda_forge_tick/events/pr_events.py @@ -25,7 +25,7 @@ def _react_to_pr(uid: str, dry_run: bool = False) -> None: and pr_json["Last-Modified"] != pr_data["Last-Modified"] ): print("refreshed PR data", flush=True) - pr_json.update(pr_data) + pr_json.update(pr_data) if pr_json.get("state", None) != "closed": pr_data = close_out_labels(copy.deepcopy(pr_json.data), dry_run=dry_run)