Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<distro>/`. 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

Expand Down
11 changes: 8 additions & 3 deletions tools/robostack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:<distro> 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:<distro> 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:
Expand Down
3 changes: 3 additions & 0 deletions tools/tests/test_bot_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down
Loading