|
2 | 2 | # ex: set syntax=python: |
3 | 3 | # vim: set syntax=python: |
4 | 4 | # comment |
| 5 | +import fnmatch |
5 | 6 | import logging |
6 | 7 | import operator |
7 | 8 | import os |
@@ -1078,13 +1079,86 @@ def create_builders(): |
1078 | 1079 |
|
1079 | 1080 | c["builders"] = list(create_builders()) |
1080 | 1081 |
|
| 1082 | + |
| 1083 | +# Paths that cannot affect the outcome of this buildbot's CMake configure/build/ctest |
| 1084 | +# pipeline (it never invokes the legacy Makefile, builds docs, runs pip packaging, or |
| 1085 | +# runs clang-tidy/pre-commit). fnmatch's `*` already matches across `/`, so these behave |
| 1086 | +# like `**` globs without needing separate syntax. |
| 1087 | +_IGNORABLE_PATH_GLOBS = [ |
| 1088 | + # GitHub Actions / GitHub metadata -- this buildbot doesn't use GH Actions at all |
| 1089 | + ".github/*", |
| 1090 | + # Root-level and nested docs |
| 1091 | + "*.md", |
| 1092 | + "doc/*", # Doxygen docs; WITH_DOCS is OFF by default |
| 1093 | + "LICENSE.txt", |
| 1094 | + # Repo/editor/tooling metadata that never reaches CMake or ctest |
| 1095 | + ".gitignore", |
| 1096 | + ".gitattributes", |
| 1097 | + ".gitmodules", |
| 1098 | + ".gdbinit", |
| 1099 | + ".lldbinit", |
| 1100 | + ".clang-format", |
| 1101 | + ".clang-format-ignore", |
| 1102 | + ".clang-tidy", |
| 1103 | + ".git-blame-ignore-revs", |
| 1104 | + ".devcontainer/*", |
| 1105 | + ".claude/*", |
| 1106 | + ".idea/*", |
| 1107 | + # Coverage / pre-commit / lint configs and scripts (not run by this buildbot) |
| 1108 | + "codecov.yml", |
| 1109 | + ".pre-commit-config.yaml", |
| 1110 | + "run-clang-format.sh", |
| 1111 | + "run-clang-tidy.sh", |
| 1112 | + # pip packaging -- buildbot builds python bindings via CMake+uv directly, |
| 1113 | + # never via packaging/pip's sdist/wheel path |
| 1114 | + "packaging/*", |
| 1115 | + # Legacy `make`-based build -- this buildbot only builds via CMake |
| 1116 | + "Makefile", |
| 1117 | + "Makefile.inc", |
| 1118 | + "*/Makefile", |
| 1119 | + "*/Makefile.inc", |
| 1120 | + "apps/support/*", # legacy-make helpers only (Makefile.inc, viz_auto.sh) |
| 1121 | + # Apps that apps/CMakeLists.txt never builds |
| 1122 | + "apps/HelloAndroid/*", |
| 1123 | + "apps/HelloAndroidCamera2/*", |
| 1124 | + "apps/HelloiOS/*", |
| 1125 | + "apps/HelloWasm/*", |
| 1126 | + # Dev-only tools/ scripts not wired into tools/CMakeLists.txt or any test target |
| 1127 | + "tools/find_inverse.cpp", |
| 1128 | + "tools/check_cmake_file_lists.py", |
| 1129 | + "tools/check_cmake_style.py", |
| 1130 | + "tools/clang-tidy-filter.sh", |
| 1131 | + "tools/gdbhalide.py", |
| 1132 | + "tools/lldbhalide.py", |
| 1133 | + "tools/Halide.natvis", |
| 1134 | + "tools/halide_config.make.tpl", |
| 1135 | + "tools/makelib.sh", |
| 1136 | + "tools/run-coverage.sh", |
| 1137 | +] |
| 1138 | + |
| 1139 | + |
| 1140 | +def _is_ignorable_path(path): |
| 1141 | + return any(fnmatch.fnmatchcase(path, pattern) for pattern in _IGNORABLE_PATH_GLOBS) |
| 1142 | + |
| 1143 | + |
| 1144 | +def is_change_important(change): |
| 1145 | + files = change.files |
| 1146 | + if not files: |
| 1147 | + # Fail open: an empty/missing file list (e.g. a rate-limited or |
| 1148 | + # unauthenticated GitHub API call) must never cause a build to be skipped. |
| 1149 | + return True |
| 1150 | + return any(not _is_ignorable_path(f) for f in files) |
| 1151 | + |
| 1152 | + |
1081 | 1153 | c["schedulers"] = [ |
1082 | 1154 | AnyBranchScheduler( |
1083 | 1155 | name="halide-main", |
1084 | 1156 | change_filter=ChangeFilter( |
1085 | 1157 | category="pull", |
1086 | 1158 | branch_fn=lambda br: br != "main", |
1087 | 1159 | ), |
| 1160 | + fileIsImportant=is_change_important, |
| 1161 | + onlyImportant=True, |
1088 | 1162 | builderNames=[b1.name for b1 in c["builders"]], |
1089 | 1163 | ), |
1090 | 1164 | ForceScheduler( |
@@ -1247,6 +1321,7 @@ c["www"] = { |
1247 | 1321 | "secret": WEBHOOK_TOKEN, |
1248 | 1322 | "skips": [], |
1249 | 1323 | "class": SafeGitHubEventHandler, |
| 1324 | + "token": GITHUB_TOKEN, |
1250 | 1325 | }, |
1251 | 1326 | }, |
1252 | 1327 | } |
|
0 commit comments