This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new ad04d2af9e Skip port forwarding also for base ports when running 
pre-commits (#35922)
ad04d2af9e is described below

commit ad04d2af9e5c645a50242fd9bf43b9468bbb1d4e
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Nov 28 14:02:38 2023 +0100

    Skip port forwarding also for base ports when running pre-commits (#35922)
    
    When pre-commits are run and breeze shell is opened they were
    both attempting to use the same port forwarding. However pre-commits
    do not ever need port forwarding because the forwarded ports are
    only needed when you run breeze shell interactively.
    
    This is a follow-up afte #35862.
    
    This PR removes port forwarding when "pre-commit" project name is
    used to run breeze shell command.
---
 dev/breeze/src/airflow_breeze/params/shell_params.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev/breeze/src/airflow_breeze/params/shell_params.py 
b/dev/breeze/src/airflow_breeze/params/shell_params.py
index a314075d29..32f6a111ce 100644
--- a/dev/breeze/src/airflow_breeze/params/shell_params.py
+++ b/dev/breeze/src/airflow_breeze/params/shell_params.py
@@ -314,7 +314,7 @@ class ShellParams:
                 f"from sources but from {self.use_airflow_version}[/]"
             )
             self.mount_sources = MOUNT_REMOVE
-        if self.forward_ports:
+        if self.forward_ports and not self.project_name == "pre-commit":
             compose_file_list.append(DOCKER_COMPOSE_DIR / "base-ports.yml")
         if self.mount_sources == MOUNT_SELECTED:
             compose_file_list.append(DOCKER_COMPOSE_DIR / "local.yml")

Reply via email to