diff --git a/README.md b/README.md index 8908e6034..762ccf27b 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,8 @@ of a distribution uses `full_rebuild: true` there. A new build number goes into and all of them as soon as it touches anything outside `distros//`. To limit that (e.g. a humble rebuild that also changes `shared/` or `tools/`), add the label `build:humble` (one per distribution to build), then push or re-run the build: adding a -label doesn't start one by itself. Nothing has to be reset before merging. +label doesn't start one by itself. Nothing has to be reset before merging. A PR that +changes no packages (tooling, CI, docs) gets `build:none`: only the checks run. ### CI diff --git a/tools/robostack.py b/tools/robostack.py index 27f4fa887..2eeaf674e 100644 --- a/tools/robostack.py +++ b/tools/robostack.py @@ -481,10 +481,15 @@ def generate_gha(distro: str, args: list[str]) -> int: return 0 +NO_BUILD_LABEL = "build:none" # only the checks (tooling, CI or docs changes) + + def build_distros(changed: list[str], labels: list[str]) -> list[str]: - """The distributions a pull request builds: those of its build: labels when it - has any (e.g. a rebuild of one distribution that also touches shared files), else the - changed ones.""" + """The distributions a pull request builds: none with the build:none label, those of + its build: labels when it has any (e.g. a rebuild of one distribution that also + touches shared files), else the changed ones.""" + if NO_BUILD_LABEL in labels: + return [] selected = sorted({label.split(":", 1)[1] for label in labels if label.startswith("build:")}) unknown = sorted(set(selected) - set(distros())) if unknown: diff --git a/tools/tests/test_bot_commands.py b/tools/tests/test_bot_commands.py index 674428625..f2a278821 100644 --- a/tools/tests/test_bot_commands.py +++ b/tools/tests/test_bot_commands.py @@ -230,6 +230,9 @@ def test_build_distros_labels_override_the_changed_ones(): assert rs.build_distros(["humble", "jazzy"], ["automerge"]) == ["humble", "jazzy"] assert rs.build_distros(rs.distros(), ["build:humble", "automerge"]) == ["humble"] assert rs.build_distros([], ["build:rolling", "build:humble"]) == ["humble", "rolling"] + # only the checks + assert rs.build_distros(rs.distros(), ["build:none"]) == [] + assert rs.build_distros(rs.distros(), ["build:none", "build:humble"]) == [] with pytest.raises(SystemExit): rs.build_distros([], ["build:kinetic"])