From a34a647ec3a4749e835fcab34921a4b09672cb3f Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 19 Sep 2024 11:11:50 +0530 Subject: [PATCH 1/2] fix: make migration check very aggressive --- agent/bench.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agent/bench.py b/agent/bench.py index e98749fa..82173447 100644 --- a/agent/bench.py +++ b/agent/bench.py @@ -1156,9 +1156,8 @@ def should_rebuild_frontend(file: str) -> bool: def should_migrate_sites(file: str) -> bool: return _should_run_phase( file, - ["hooks.py"], + ["hooks.py", ".json"], ["patches"], - ["*/doctype/*/*.json"], ) From eab0f2eb970a2f93e139ae11c84b25d448dd2f17 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 19 Sep 2024 11:20:12 +0530 Subject: [PATCH 2/2] fix: skip diff if hashes are the same --- agent/bench.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/agent/bench.py b/agent/bench.py index 82173447..5955ce80 100644 --- a/agent/bench.py +++ b/agent/bench.py @@ -941,6 +941,11 @@ def _pull_app_change(self, app: BenchUpdateApp) -> list[str]: new_hash: str = app["hash"] old_hash: str = exec("git rev-parse HEAD")["output"] + if old_hash == new_hash: + # Remove remote, url might be private + exec(f"git remote remove {remote}") + return [] + # Fetch new hash and get changed files exec(f"git fetch --depth 1 {remote} {new_hash}") diff: str = exec(f"git diff --name-only {old_hash} {new_hash}")["output"]