From d07ec08a6636dc60e3fdb48ba96fc82a5c695437 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Fri, 26 Jun 2026 16:34:43 -0400 Subject: [PATCH] [v3-3-test] Move known_airflow_exceptions.txt out of scripts/ into generated/ (#69057) The check-no-new-airflow-exceptions hook keeps its allowlist baseline in scripts/ci/prek/known_airflow_exceptions.txt. That file is touched by any PR that legitimately adds, removes, or moves a raise AirflowException -- typically provider or core changes that have nothing to do with dev tooling. Because it lived under scripts/, boring-cyborg matched it against the scripts/**/* glob and auto-applied area:dev-tools and, worse, backport-to-v3-3-test, triggering wrong automated backports of unrelated provider PRs. Move the generated allowlist to generated/known_airflow_exceptions.txt, which no boring-cyborg rule matches, so editing it no longer looks like a dev-tools change. The hook script reads/writes it from the repo-root generated/ directory; .txt files carry no license header, so nothing else changes. (cherry picked from commit 78263d0c538ab489005b6ea1f104051a44fe60af) Co-authored-by: Jarek Potiuk --- .../ci/prek => generated}/known_airflow_exceptions.txt | 0 scripts/ci/prek/check_new_airflow_exception_usage.py | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) rename {scripts/ci/prek => generated}/known_airflow_exceptions.txt (100%) diff --git a/scripts/ci/prek/known_airflow_exceptions.txt b/generated/known_airflow_exceptions.txt similarity index 100% rename from scripts/ci/prek/known_airflow_exceptions.txt rename to generated/known_airflow_exceptions.txt diff --git a/scripts/ci/prek/check_new_airflow_exception_usage.py b/scripts/ci/prek/check_new_airflow_exception_usage.py index 88132824558b2..6ba97db865e50 100755 --- a/scripts/ci/prek/check_new_airflow_exception_usage.py +++ b/scripts/ci/prek/check_new_airflow_exception_usage.py @@ -23,8 +23,8 @@ # /// """Check that no new ``raise AirflowException`` usages are introduced. -All *existing* usages are recorded in ``known_airflow_exceptions.txt`` next to -this script as ``relative/path::N`` entries (one per file), where ``N`` is the +All *existing* usages are recorded in ``generated/known_airflow_exceptions.txt`` +as ``relative/path::N`` entries (one per file), where ``N`` is the maximum number of ``raise AirflowException`` occurrences allowed in that file. A file whose current count exceeds the recorded limit is treated as a violation – use a dedicated exception class instead. @@ -36,7 +36,7 @@ When a file's count has *decreased*, the allowlist entry is tightened automatically and the hook exits with a non-zero code so that pre-commit reports the modified allowlist — just stage - ``scripts/ci/prek/known_airflow_exceptions.txt`` and re-run. + ``generated/known_airflow_exceptions.txt`` and re-run. ``--all-files``: Walk the whole repository and check every ``.py`` file. @@ -201,7 +201,7 @@ def _check_airflow_exception_usage( "If this usage is intentional and pre-existing, run:\n\n" " [cyan]uv run ./scripts/ci/prek/check_new_airflow_exception_usage.py --generate[/cyan]\n\n" "to regenerate the allowlist, then commit the updated\n" - "[cyan]scripts/ci/prek/known_airflow_exceptions.txt[/cyan].", + "[cyan]generated/known_airflow_exceptions.txt[/cyan].", title="[red]❌ Check failed[/red]", border_style="red", ) @@ -239,7 +239,7 @@ def main(argv: list[str] | None = None) -> int: ) args = parser.parse_args(argv) - manager = AllowlistManager(Path(__file__).parent / "known_airflow_exceptions.txt") + manager = AllowlistManager(REPO_ROOT / "generated" / "known_airflow_exceptions.txt") if args.generate: return manager.generate()