You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Andrushika (via GitHub)" <gi...@apache.org> on 2026/09/16 10:29:04 UTC

[PR] Add new command breeze verify to suggest local checks for changed files [airflow]

Andrushika opened a new pull request, #73241:
URL: https://github.com/apache/airflow/pull/73241

   ## Result
   
   A new developer-facing (and agent-facing) breeze command. 
   It reads your diff and lists the exact commands CI would run for it, so you can run them locally instead of guessing. 
   Dry-run only for now. **The plan is to add `--run` next, so the same command can really execute the list.**
   
   <img width="1261" height="493" alt="image" src="https://github.com/user-attachments/assets/b60ff7f1-6e22-4986-9120-b536e31c461b" />
   
   ## Why
   
   Before opening a PR, AGENTS.md step 7 asks an agent to find the tests CI would run for the change and run the relevant ones locally. The tool for that is `breeze ci selective-check`, which was built for the build-info job in CI: it reads one commit and prints outputs like `run-unit-tests=true` for the workflows to consume. It does not say which command each output maps to, so a contributor still has to read `ci-amd.yml`, `run-unit-tests.yml` and `run_unit_tests.sh` to get a `breeze testing` line. 
   
   In practice people, and agents, guess from file paths instead. That misses rules like "a core change also runs provider tests" or "a change under `dev/breeze/` runs everything", and ends as a red CI later or "push and see".
   
   ## What
   
   Add `breeze verify`. It feeds the working-tree diff against `--base-ref` to the same `SelectiveChecks` class, unchanged, and lists the commands for the default CI matrix cell (default Python, sqlite). Nothing is executed. This shape is temporary: a follow-up adds `--run` and moves the listing under `--dry-run`, with a lean mode for changes that make CI run everything.
   
   I considered a flag on `breeze ci selective-check` instead, but that group is CI-facing and its inputs assume a CI context. The plan builder is a standalone function, so moving it there is a small change if it's preferred.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Fable 5.1); reviewed with Codex (gpt-5.6-sol)
   
   Generated-by: Claude Code (Fable 5.1) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #73241:
URL: https://github.com/apache/airflow/pull/73241


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "Andrushika (via GitHub)" <gi...@apache.org>.
Andrushika commented on code in PR #73241:
URL: https://github.com/apache/airflow/pull/73241#discussion_r4080583171


##########
dev/breeze/src/airflow_breeze/utils/verification_plan.py:
##########
@@ -0,0 +1,159 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import json
+import shlex
+from dataclasses import asdict, dataclass
+from typing import Any
+
+from airflow_breeze.utils.selective_checks import SelectiveChecks
+
+
+@dataclass(frozen=True)
+class VerificationItem:
+    kind: str
+    command: str
+    runs_in: str
+
+
+# SelectiveChecks flag -> (kind, command, runs_in) of the CI job(s) that flag gates.
+# Mirrors .github/workflows/ci-amd.yml and basic-tests.yml; "breeze" means the command needs
+# Docker and the CI image, "host" means only host tooling.
+FLAG_COMMANDS: dict[str, tuple[tuple[str, str, str], ...]] = {

Review Comment:
   Added a test that extracts every prek run --stage manual <hook> entry from the mapping and checks that the same stage and hook appear in ci-amd.yml. A renamed hook or changed stage will now fail the test.



##########
dev/breeze/doc/03_developer_tasks.rst:
##########
@@ -316,6 +316,49 @@ If the provider name is ``apache-airflow-providers-cncf-kubernetes``, it will be
 Note: For building docs for apache-airflow-providers index, use ``apache-airflow-providers``
 as the short hand operator.
 
+Finding out what CI will run for your change

Review Comment:
   Done!



##########
dev/breeze/tests/test_verify_commands.py:
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import json
+import re
+from subprocess import CompletedProcess
+from unittest.mock import patch
+
+import pytest
+from click.testing import CliRunner
+
+from airflow_breeze.commands.verify_commands import get_changed_files_against, verify
+
+ANSI = re.compile(r"\x1b\[[0-9;]*m")
+
+
+@patch(

Review Comment:
   Added. Thanks.



##########
dev/breeze/src/airflow_breeze/utils/verification_plan.py:
##########
@@ -0,0 +1,159 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import json
+import shlex
+from dataclasses import asdict, dataclass
+from typing import Any
+
+from airflow_breeze.utils.selective_checks import SelectiveChecks
+
+
+@dataclass(frozen=True)
+class VerificationItem:
+    kind: str
+    command: str
+    runs_in: str
+
+
+# SelectiveChecks flag -> (kind, command, runs_in) of the CI job(s) that flag gates.
+# Mirrors .github/workflows/ci-amd.yml and basic-tests.yml; "breeze" means the command needs
+# Docker and the CI image, "host" means only host tooling.
+FLAG_COMMANDS: dict[str, tuple[tuple[str, str, str], ...]] = {
+    "run_mypy_providers": (("mypy", "prek run --stage manual mypy-providers --all-files", "breeze"),),
+    "has_migrations": (("schema", "prek run --stage manual migration-round-trip --all-files", "breeze"),),
+    "run_task_sdk_tests": (("unit", "breeze testing task-sdk-tests", "breeze"),),
+    "run_airflow_ctl_tests": (("unit", "breeze testing airflow-ctl-tests", "breeze"),),
+    "run_scripts_tests": (("unit", "uv run --project scripts pytest scripts/tests/", "host"),),
+    "run_ui_tests": (
+        ("ui", "cd airflow-core/src/airflow/ui && pnpm install --frozen-lockfile && pnpm test", "host"),
+        (
+            "ui",
+            "cd airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui && pnpm install --frozen-lockfile && pnpm test",
+            "host",
+        ),
+    ),
+    "run_api_codegen": (("schema", "breeze testing python-api-client-tests", "breeze"),),
+    "run_go_sdk_tests": (("unit", "cd go-sdk && go test ./...", "host"),),
+    "run_java_sdk_tests": (
+        ("unit", "cd java-sdk && ./gradlew test", "host"),
+        ("docs", "breeze build-docs --sdk-docs-only --sdk=java", "breeze"),
+    ),
+    "run_ts_sdk_docs": (("docs", "breeze build-docs --sdk-docs-only --sdk=typescript", "breeze"),),
+    "run_breeze_integration_tests": (
+        ("unit", "cd dev/breeze && uv run --locked pytest", "host"),
+        ("unit", "cd dev/breeze && uv run --locked pytest -m integration_tests", "host"),
+    ),
+}
+
+# Gated CI jobs that need a cluster, a prod image or an e2e stack; classified only, never printed.
+NOT_RUNNABLE_LOCALLY: frozenset[str] = frozenset(
+    {
+        "run_kubernetes_tests",
+        "run_helm_tests",
+        "run_kustomize_overlays_tests",
+        "run_ui_e2e_tests",
+        "run_task_sdk_integration_tests",
+        "run_airflow_ctl_integration_tests",
+        "run_system_tests",
+        "run_remote_logging_s3_e2e_tests",
+        "run_remote_logging_elasticsearch_e2e_tests",
+        "run_remote_logging_opensearch_e2e_tests",
+        "run_event_driven_e2e_tests",
+        "run_java_sdk_e2e_tests",
+        "run_go_sdk_e2e_tests",
+        "run_openlineage_e2e_tests",
+        "run_openlineage_e2e_compat_tests",
+        "run_ts_sdk_e2e_tests",
+    }
+)
+
+
+def build_prek_item(sc: SelectiveChecks, base_ref: str) -> VerificationItem:
+    if sc.basic_checks_only:
+        command = f"SKIP_BREEZE_PREK_HOOKS=true SKIP={sc.skip_prek_hooks} prek run --from-ref {shlex.quote(base_ref)} --to-ref HEAD"
+        return VerificationItem("prek", command, "host")
+    return VerificationItem("prek", f"SKIP={sc.skip_prek_hooks} prek run --all-files", "breeze")

Review Comment:
   Went with the first option: the default row is now `prek run --from-ref <base> --to-ref HEAD`, the scope AGENTS.md recommends. `--full` keeps CI's `--all-files` form with a comment on why CI runs every file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "Andrushika (via GitHub)" <gi...@apache.org>.
Andrushika commented on code in PR #73241:
URL: https://github.com/apache/airflow/pull/73241#discussion_r4162545627


##########
dev/breeze/src/airflow_breeze/utils/verification_plan.py:
##########
@@ -0,0 +1,159 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import json
+import shlex
+from dataclasses import asdict, dataclass
+from typing import Any
+
+from airflow_breeze.utils.selective_checks import SelectiveChecks
+
+
+@dataclass(frozen=True)
+class VerificationItem:
+    kind: str
+    command: str
+    runs_in: str
+
+
+# SelectiveChecks flag -> (kind, command, runs_in) of the CI job(s) that flag gates.
+# Mirrors .github/workflows/ci-amd.yml and basic-tests.yml; "breeze" means the command needs
+# Docker and the CI image, "host" means only host tooling.
+FLAG_COMMANDS: dict[str, tuple[tuple[str, str, str], ...]] = {

Review Comment:
   Update: since prek is excluded, I also removed these tests in the latest commit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #73241:
URL: https://github.com/apache/airflow/pull/73241#issuecomment-5839387564

   Hello @Andrushika - thank you for your contributions to Apache Airflow!
   
   The Airflow community has introduced a limit of **5 open pull requests at a time** for contributors without write access to the repository. You currently have 7 open pull requests, so - as a one-time step of introducing the limit - we closed the ones where maintainers have not engaged yet:
   
   * #69713 - Preserve AirflowTaskTimeout when timeout logging fails
   * #70135 - Fix mapped tasks does not validate task_id
   * #70630 - Reject consecutive dots in Dag and task IDs in the Task SDK
   * #72493 - Enforce execution_timeout from the task supervisor
   * #73241 - Add breeze verify to list local checks for changed files
   * #73464 - Add task state store API to the Java SDK
   
   These pull requests stay open because maintainers are already engaged in them - they count towards your limit:
   
   * #69937 - Warn on suspicious Dag and task IDs at Java SDK build time
   
   This is **not** a judgement of you or of your changes. We never told contributors before that opening many pull requests at once was a problem, so there is nothing to feel bad about - and nothing is lost: your branches, commits and the review history stay where they are.
   
   What we ask you to do is to make your **first prioritization decision**: choose which of the pull requests above matter most to you, and reopen them (up to 5 open at a time, including the ones still open) with the "Reopen pull request" button or `gh pr reopen <PR_NUMBER> --repo apache/airflow`. Reopen the ones you are ready to follow through - keep them rebased, respond to review comments and fix failing checks.
   
   While your pull requests are waiting for review, the most valuable thing you can do is help in other ways - reviewing other contributors' pull requests, helping with issues, and taking part in the discussions on the devlist and Slack.
   
   Why we introduced the limit, what it means for you and how to reopen or restore a pull request is explained in https://github.com/apache/airflow/blob/main/contributing-docs/32_open_pull_request_limit.rst.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "Andrushika (via GitHub)" <gi...@apache.org>.
Andrushika commented on PR #73241:
URL: https://github.com/apache/airflow/pull/73241#issuecomment-5743740213

   Hi @potiuk when you have a chance, could you please take a look on this?
   I think many contributors can benefit from it and save a lot of tokens for their agents. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #73241: Add breeze verify to list local checks for changed files
URL: https://github.com/apache/airflow/pull/73241


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #73241:
URL: https://github.com/apache/airflow/pull/73241#issuecomment-5975780348

   ### Backport failed to create: v3-3-test. View the failure log <a href='https://github.com/apache/airflow/actions/runs/37171061019'> Run details </a>
   
   Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
   the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
   
   In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
   
   <table>
       <tr>
           <th>Status</th>
           <th>Branch</th>
           <th>Result</th>
       </tr>
       <tr>
           <td>❌</td>
           <td>v3-3-test</td>
           <td><a href="https://github.com/apache/airflow/commit/c688a6f0abc79d7a54bb5a2ef4276cd49ba27b42"><img src='https://img.shields.io/badge/Commit-c688a6f-red' alt='Commit Link'></a></td>
       </tr>
   </table>
   
   You can attempt to backport this manually by running:
   
   ```bash
   cherry_picker c688a6f v3-3-test
   ```
   
   This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
   the files that need manual conflict resolution.
   
   After you have resolved the conflicts, you can continue the backport process by running:
   
   ```bash
   cherry_picker --continue
   ```
   
   If you don't have cherry-picker installed, see the [installation guide](https://github.com/apache/airflow/blob/main/dev/README.md#how-to-backport-pr-with-cherry-picker-cli).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "Andrushika (via GitHub)" <gi...@apache.org>.
Andrushika commented on PR #73241:
URL: https://github.com/apache/airflow/pull/73241#issuecomment-5943941836

   Mostly agree. I was just thinking of creating a common command that lets contributors run all the local checks at once -- including all the commands our contribution docs ask them to run.
   Since `prek` is always enforced before commit, there is no point in leaving it here. I'll remove it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "Andrushika (via GitHub)" <gi...@apache.org>.
Andrushika commented on PR #73241:
URL: https://github.com/apache/airflow/pull/73241#issuecomment-5945014275

   I’ve also considered the manual stage prek hooks, because they won’t run locally unless developers explicitly call them. But I don’t think they need to run locally either. The downside is that a failure there only shows up in CI. 
   
   I’d still prefer to follow the usual practice for manual hooks, so I removed them too.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on PR #73241:
URL: https://github.com/apache/airflow/pull/73241#issuecomment-5934520134

   Exception: I don't think `prek` should/needs to be  be included in this, as the prek config file already says what checks should be run for changed files etc? (Point for discussion)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #73241:
URL: https://github.com/apache/airflow/pull/73241#discussion_r4077702007


##########
dev/breeze/src/airflow_breeze/utils/verification_plan.py:
##########
@@ -0,0 +1,159 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import json
+import shlex
+from dataclasses import asdict, dataclass
+from typing import Any
+
+from airflow_breeze.utils.selective_checks import SelectiveChecks
+
+
+@dataclass(frozen=True)
+class VerificationItem:
+    kind: str
+    command: str
+    runs_in: str
+
+
+# SelectiveChecks flag -> (kind, command, runs_in) of the CI job(s) that flag gates.
+# Mirrors .github/workflows/ci-amd.yml and basic-tests.yml; "breeze" means the command needs
+# Docker and the CI image, "host" means only host tooling.
+FLAG_COMMANDS: dict[str, tuple[tuple[str, str, str], ...]] = {

Review Comment:
   The `run_*` classification test catches a new flag, and `run_unit_tests.sh` pins the core/providers rows, but nothing checks the command text of the other entries — if `ci-amd.yml` renames a hook or changes a `--stage`, this table goes stale silently. A cheap guard: for each `prek … --stage manual <hook>` entry, assert `<hook>` appears in `.github/workflows/ci-amd.yml`.
   



##########
dev/breeze/src/airflow_breeze/utils/verification_plan.py:
##########
@@ -0,0 +1,159 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import json
+import shlex
+from dataclasses import asdict, dataclass
+from typing import Any
+
+from airflow_breeze.utils.selective_checks import SelectiveChecks
+
+
+@dataclass(frozen=True)
+class VerificationItem:
+    kind: str
+    command: str
+    runs_in: str
+
+
+# SelectiveChecks flag -> (kind, command, runs_in) of the CI job(s) that flag gates.
+# Mirrors .github/workflows/ci-amd.yml and basic-tests.yml; "breeze" means the command needs
+# Docker and the CI image, "host" means only host tooling.
+FLAG_COMMANDS: dict[str, tuple[tuple[str, str, str], ...]] = {
+    "run_mypy_providers": (("mypy", "prek run --stage manual mypy-providers --all-files", "breeze"),),
+    "has_migrations": (("schema", "prek run --stage manual migration-round-trip --all-files", "breeze"),),
+    "run_task_sdk_tests": (("unit", "breeze testing task-sdk-tests", "breeze"),),
+    "run_airflow_ctl_tests": (("unit", "breeze testing airflow-ctl-tests", "breeze"),),
+    "run_scripts_tests": (("unit", "uv run --project scripts pytest scripts/tests/", "host"),),
+    "run_ui_tests": (
+        ("ui", "cd airflow-core/src/airflow/ui && pnpm install --frozen-lockfile && pnpm test", "host"),
+        (
+            "ui",
+            "cd airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui && pnpm install --frozen-lockfile && pnpm test",
+            "host",
+        ),
+    ),
+    "run_api_codegen": (("schema", "breeze testing python-api-client-tests", "breeze"),),
+    "run_go_sdk_tests": (("unit", "cd go-sdk && go test ./...", "host"),),
+    "run_java_sdk_tests": (
+        ("unit", "cd java-sdk && ./gradlew test", "host"),
+        ("docs", "breeze build-docs --sdk-docs-only --sdk=java", "breeze"),
+    ),
+    "run_ts_sdk_docs": (("docs", "breeze build-docs --sdk-docs-only --sdk=typescript", "breeze"),),
+    "run_breeze_integration_tests": (
+        ("unit", "cd dev/breeze && uv run --locked pytest", "host"),
+        ("unit", "cd dev/breeze && uv run --locked pytest -m integration_tests", "host"),
+    ),
+}
+
+# Gated CI jobs that need a cluster, a prod image or an e2e stack; classified only, never printed.
+NOT_RUNNABLE_LOCALLY: frozenset[str] = frozenset(
+    {
+        "run_kubernetes_tests",
+        "run_helm_tests",
+        "run_kustomize_overlays_tests",
+        "run_ui_e2e_tests",
+        "run_task_sdk_integration_tests",
+        "run_airflow_ctl_integration_tests",
+        "run_system_tests",
+        "run_remote_logging_s3_e2e_tests",
+        "run_remote_logging_elasticsearch_e2e_tests",
+        "run_remote_logging_opensearch_e2e_tests",
+        "run_event_driven_e2e_tests",
+        "run_java_sdk_e2e_tests",
+        "run_go_sdk_e2e_tests",
+        "run_openlineage_e2e_tests",
+        "run_openlineage_e2e_compat_tests",
+        "run_ts_sdk_e2e_tests",
+    }
+)
+
+
+def build_prek_item(sc: SelectiveChecks, base_ref: str) -> VerificationItem:
+    if sc.basic_checks_only:
+        command = f"SKIP_BREEZE_PREK_HOOKS=true SKIP={sc.skip_prek_hooks} prek run --from-ref {shlex.quote(base_ref)} --to-ref HEAD"
+        return VerificationItem("prek", command, "host")
+    return VerificationItem("prek", f"SKIP={sc.skip_prek_hooks} prek run --all-files", "breeze")

Review Comment:
   This mirrors CI's static-checks job, but locally `--all-files` is the slowest row by far, and `AGENTS.md` recommends `prek run --from-ref <target> --stage pre-commit` for pre-push checks. Either use the `--from-ref` form here (you already build it for `basic_checks_only`), or add a short comment saying `--all-files` is deliberate because non-basic changes can affect hooks outside the diff.
   



##########
dev/breeze/tests/test_verify_commands.py:
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import json
+import re
+from subprocess import CompletedProcess
+from unittest.mock import patch
+
+import pytest
+from click.testing import CliRunner
+
+from airflow_breeze.commands.verify_commands import get_changed_files_against, verify
+
+ANSI = re.compile(r"\x1b\[[0-9;]*m")
+
+
+@patch(

Review Comment:
   `AGENTS.md` asks for `spec`/`autospec` when mocking — the `@patch` decorators here (and at lines 56, 69, 98 and 109) patch `get_changed_files_against` / `run_command` without `autospec=True`.
   



##########
dev/breeze/doc/03_developer_tasks.rst:
##########
@@ -316,6 +316,49 @@ If the provider name is ``apache-airflow-providers-cncf-kubernetes``, it will be
 Note: For building docs for apache-airflow-providers index, use ``apache-airflow-providers``
 as the short hand operator.
 
+Finding out what CI will run for your change

Review Comment:
   The motivation is `AGENTS.md` step 7, but nothing points agents at `breeze verify` yet. Could you update step 7 in `AGENTS.md` (and the matching checklist in `.agents/skills/airflow-publish-changes/SKILL.md`) to use it? And a line in `dev/breeze/doc/ci/04_selective_checks.md`: adding a `run_*` flag to `SelectiveChecks` now also means classifying it in `verification_plan.py`, and that doc is where people look when they change selective checks.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add breeze verify to list local checks for changed files [airflow]

Posted by "Andrushika (via GitHub)" <gi...@apache.org>.
Andrushika commented on PR #73241:
URL: https://github.com/apache/airflow/pull/73241#issuecomment-5792272137

   One limitation: the classification test guard treats `run_*` as the naming contract, with `docs_build` and `has_migrations` as explicit exceptions.
   
   The problem is that a new gate with another name would bypass our drift guard. I considered deriving this from the workflow YAML, but parsing yaml itself seems not a reliable way since there are too much edge cases.
   
   If we agree that a stronger naming contract is needed, I would prefer to discuss the design and handle it in a follow-up PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org