From b831d3d8351f149628137bce98f07bbf7ec1bbf1 Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Sat, 8 Aug 2026 10:39:08 -0400 Subject: [PATCH] Skip CI builds for PRs that only touch build/test-irrelevant files Docs, GitHub Actions config, the legacy Makefile build, unreachable demo apps, and dev-only tooling scripts can't affect the outcome of this buildbot's CMake configure/build/ctest pipeline, so PRs touching only those paths no longer schedule a build. Also authenticates the GitHub PR-files API lookup (via the existing GITHUB_TOKEN) to reduce the chance of a rate-limited/truncated file list; the filter fails open (never skips) when the file list is empty. Co-Authored-By: Claude Sonnet 5 --- master/master.cfg | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/master/master.cfg b/master/master.cfg index daa6b9b..ea156d3 100644 --- a/master/master.cfg +++ b/master/master.cfg @@ -2,6 +2,7 @@ # ex: set syntax=python: # vim: set syntax=python: # comment +import fnmatch import logging import operator import os @@ -1078,6 +1079,77 @@ def create_builders(): c["builders"] = list(create_builders()) + +# Paths that cannot affect the outcome of this buildbot's CMake configure/build/ctest +# pipeline (it never invokes the legacy Makefile, builds docs, runs pip packaging, or +# runs clang-tidy/pre-commit). fnmatch's `*` already matches across `/`, so these behave +# like `**` globs without needing separate syntax. +_IGNORABLE_PATH_GLOBS = [ + # GitHub Actions / GitHub metadata -- this buildbot doesn't use GH Actions at all + ".github/*", + # Root-level and nested docs + "*.md", + "doc/*", # Doxygen docs; WITH_DOCS is OFF by default + "LICENSE.txt", + # Repo/editor/tooling metadata that never reaches CMake or ctest + ".gitignore", + ".gitattributes", + ".gitmodules", + ".gdbinit", + ".lldbinit", + ".clang-format", + ".clang-format-ignore", + ".clang-tidy", + ".git-blame-ignore-revs", + ".devcontainer/*", + ".claude/*", + ".idea/*", + # Coverage / pre-commit / lint configs and scripts (not run by this buildbot) + "codecov.yml", + ".pre-commit-config.yaml", + "run-clang-format.sh", + "run-clang-tidy.sh", + # pip packaging -- buildbot builds python bindings via CMake+uv directly, + # never via packaging/pip's sdist/wheel path + "packaging/*", + # Legacy `make`-based build -- this buildbot only builds via CMake + "Makefile", + "Makefile.inc", + "*/Makefile", + "*/Makefile.inc", + "apps/support/*", # legacy-make helpers only (Makefile.inc, viz_auto.sh) + # Apps that apps/CMakeLists.txt never builds + "apps/HelloAndroid/*", + "apps/HelloAndroidCamera2/*", + "apps/HelloiOS/*", + "apps/HelloWasm/*", + # Dev-only tools/ scripts not wired into tools/CMakeLists.txt or any test target + "tools/find_inverse.cpp", + "tools/check_cmake_file_lists.py", + "tools/check_cmake_style.py", + "tools/clang-tidy-filter.sh", + "tools/gdbhalide.py", + "tools/lldbhalide.py", + "tools/Halide.natvis", + "tools/halide_config.make.tpl", + "tools/makelib.sh", + "tools/run-coverage.sh", +] + + +def _is_ignorable_path(path): + return any(fnmatch.fnmatchcase(path, pattern) for pattern in _IGNORABLE_PATH_GLOBS) + + +def is_change_important(change): + files = change.files + if not files: + # Fail open: an empty/missing file list (e.g. a rate-limited or + # unauthenticated GitHub API call) must never cause a build to be skipped. + return True + return any(not _is_ignorable_path(f) for f in files) + + c["schedulers"] = [ AnyBranchScheduler( name="halide-main", @@ -1085,6 +1157,8 @@ c["schedulers"] = [ category="pull", branch_fn=lambda br: br != "main", ), + fileIsImportant=is_change_important, + onlyImportant=True, builderNames=[b1.name for b1 in c["builders"]], ), ForceScheduler( @@ -1247,6 +1321,7 @@ c["www"] = { "secret": WEBHOOK_TOKEN, "skips": [], "class": SafeGitHubEventHandler, + "token": GITHUB_TOKEN, }, }, }