From ad0935319037af39e10de53ea486b29dc61d5a9d Mon Sep 17 00:00:00 2001 From: berkay8987 Date: Tue, 24 Nov 2026 13:14:46 +0300 Subject: [PATCH] PR checks: files built into xcl.exe outside src need a regression run runtime() only counted paths under crates/xcl/src/, so a PR that changed only crates/xcl/data/stubdb.toml (compiled in with include_str! and deciding how imports are routed), crates/xcl/build.rs, crates/xcl/Cargo.toml, the workspace Cargo.toml (release profile) or Cargo.lock was not asked for xcl-smoke runs. These paths now count as runtime too. Fixes #964 Co-Authored-By: Claude Opus 5.5 --- scripts/pr_check.py | 10 +++++++++- scripts/test_pr_check.py | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/pr_check.py b/scripts/pr_check.py index 592808f42c..c5dedec2b8 100644 --- a/scripts/pr_check.py +++ b/scripts/pr_check.py @@ -44,8 +44,16 @@ def number(s): return int(m.group(1)) if m else None +# outside crates/xcl/src but built into xcl.exe: compiled-in data (stubdb.toml), the build script, +# dependency versions and the release profile +RUNTIME_DIRS = ("crates/xcl/src/", "crates/xcl/data/") +RUNTIME_FILES = ("crates/xcl/build.rs", "crates/xcl/Cargo.toml", "Cargo.toml", "Cargo.lock") + + def runtime(path): - return path.startswith("crates/xcl/src/") and "/tests" not in path and not path.endswith("tests.rs") + if path in RUNTIME_FILES: + return True + return path.startswith(RUNTIME_DIRS) and "/tests" not in path and not path.endswith("tests.rs") def check(body, head, files, is_main_ancestor, *, test_only=False): diff --git a/scripts/test_pr_check.py b/scripts/test_pr_check.py index faa0defef4..25ad17499d 100644 --- a/scripts/test_pr_check.py +++ b/scripts/test_pr_check.py @@ -36,6 +36,20 @@ def test_test_paths_do_not_need_approval(self): self.assertEqual([], check(BODY, HEAD, files, lambda _: False)) +class RuntimeOutsideSrcTests(unittest.TestCase): + def test_files_built_into_xcl_need_smoke(self): + for path in ("crates/xcl/data/stubdb.toml", "crates/xcl/build.rs", "crates/xcl/Cargo.toml", + "Cargo.toml", "Cargo.lock"): + problems = check(BODY, HEAD, [changed(path)], lambda _: False) + self.assertEqual(2, len(problems), path) + self.assertTrue(all("Regression run" in problem for problem in problems), path) + + def test_other_crates_and_scripts_do_not_need_smoke(self): + files = [changed("tests/testtitle/Cargo.toml"), changed("tests/testgamedll/src/lib.rs"), + changed("scripts/smoke.ps1"), changed("README.md")] + self.assertEqual([], check(BODY, HEAD, files, lambda _: False)) + + class SmokeBlockTests(unittest.TestCase): def test_two_blocks_in_one_fence_are_two_blocks(self): body = ("```\nxcl-smoke v1\ncommit: 1111111aaaa\ntitle: G\nseconds: 60\n\n"