You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2026/04/26 13:48:53 UTC
(airflow) branch v3-2-test updated: Teach boring-cyborg prek hook about {paths, targetBranchFilter} rules (#65872)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-2-test by this push:
new e6accdde66c Teach boring-cyborg prek hook about {paths, targetBranchFilter} rules (#65872)
e6accdde66c is described below
commit e6accdde66c05d25d8c1ce05c45144065c2e526a
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sun Apr 26 15:48:46 2026 +0200
Teach boring-cyborg prek hook about {paths, targetBranchFilter} rules (#65872)
Backport of the prek-script half of #65386 to fix static checks on
v3-2-test after #65610 added a backport-to-airflow-ctl-v0-1-test rule
in dict form ({paths, targetBranchFilter}). The legacy script on
v3-2-test only understood the flat list-of-globs form, so it flagged
`paths` and `targetBranchFilter` as unused glob patterns and failed
the check.
The .github/boring-cyborg.yml YAML changes from #65386 are intentionally
omitted: those targeted the `backport-to-v3-2-test` rule that lives on
main, which has no analogue on this branch (here it is
`backport-to-v3-1-test` and the existing list form continues to work).
---
scripts/ci/prek/boring_cyborg.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/scripts/ci/prek/boring_cyborg.py b/scripts/ci/prek/boring_cyborg.py
index 4db81cc0d5c..5e9ef359ffb 100755
--- a/scripts/ci/prek/boring_cyborg.py
+++ b/scripts/ci/prek/boring_cyborg.py
@@ -46,8 +46,14 @@ if CONFIG_KEY not in cyborg_config:
raise SystemExit(f"Missing section {CONFIG_KEY}")
errors = []
-# Check if all patterns in the cyborg config are existing in the repository
-for label, patterns in cyborg_config[CONFIG_KEY].items():
+# Each label rule is either a list of glob patterns (legacy form) or an object
+# with `paths` and an optional `targetBranchFilter` (see kaxil/boring-cyborg#112).
+# Only the glob patterns in `paths` need to exist in the repository.
+for label, rule in cyborg_config[CONFIG_KEY].items():
+ if isinstance(rule, dict):
+ patterns = rule.get("paths", [])
+ else:
+ patterns = rule
for pattern in patterns:
try:
next(Path(AIRFLOW_ROOT_PATH).glob(pattern))