From 50dee7d190c55203031ad1f09969bb887711d194 Mon Sep 17 00:00:00 2001 From: Lohith M Date: Sat, 8 Nov 2025 18:42:43 +0000 Subject: [PATCH 1/4] Docs: Add note for WSL users about CHOKIDAR_USEPOLLING for UI hot reloading (#57846) --- contributing-docs/03_contributors_quick_start.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/contributing-docs/03_contributors_quick_start.rst b/contributing-docs/03_contributors_quick_start.rst index 3929a589b1728..2ee165b48f4f7 100644 --- a/contributing-docs/03_contributors_quick_start.rst +++ b/contributing-docs/03_contributors_quick_start.rst @@ -613,6 +613,20 @@ Using Breeze alt="Accessing local airflow"> + **For WSL users:** + + When running the React TypeScript UI with `breeze start-airflow --development`, you may need to enable polling for file change detection to make hot reloading work properly. + Set the following environment variable before starting the UI: + + .. code-block:: bash + export CHOKIDAR_USEPOLLING=true + + Alternatively, you can modify the `dev` script in `ui/package.json` to include it: + + .. code-block:: json + "dev": "CHOKIDAR_USEPOLLING=true vite --port 5173 --strictPort" + + 3. Setup a PostgreSQL database in your database management tool of choice (e.g. DBeaver, DataGrip) with host ``localhost``, port ``25433``, user ``postgres``, password ``airflow``, and default schema ``airflow`` From 1958f4e5dc6d319146fd590dcf9a807d137f6c6c Mon Sep 17 00:00:00 2001 From: Lohith M Date: Tue, 11 Nov 2025 13:23:59 +0000 Subject: [PATCH 2/4] Breeze: Automatically set CHOKIDAR_USEPOLLING for WSL users in --dev-mode (#57846) --- .../03_contributors_quick_start.rst | 14 ------------- .../commands/developer_commands.py | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/contributing-docs/03_contributors_quick_start.rst b/contributing-docs/03_contributors_quick_start.rst index 2ee165b48f4f7..3929a589b1728 100644 --- a/contributing-docs/03_contributors_quick_start.rst +++ b/contributing-docs/03_contributors_quick_start.rst @@ -613,20 +613,6 @@ Using Breeze alt="Accessing local airflow"> - **For WSL users:** - - When running the React TypeScript UI with `breeze start-airflow --development`, you may need to enable polling for file change detection to make hot reloading work properly. - Set the following environment variable before starting the UI: - - .. code-block:: bash - export CHOKIDAR_USEPOLLING=true - - Alternatively, you can modify the `dev` script in `ui/package.json` to include it: - - .. code-block:: json - "dev": "CHOKIDAR_USEPOLLING=true vite --port 5173 --strictPort" - - 3. Setup a PostgreSQL database in your database management tool of choice (e.g. DBeaver, DataGrip) with host ``localhost``, port ``25433``, user ``postgres``, password ``airflow``, and default schema ``airflow`` diff --git a/dev/breeze/src/airflow_breeze/commands/developer_commands.py b/dev/breeze/src/airflow_breeze/commands/developer_commands.py index 8028f07d8bcfd..8eb9d119c158b 100644 --- a/dev/breeze/src/airflow_breeze/commands/developer_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/developer_commands.py @@ -17,6 +17,7 @@ from __future__ import annotations import os +import platform import re import shlex import shutil @@ -129,6 +130,18 @@ CELERY_INTEGRATION = "celery" +def is_wsl() -> bool: + """Detect if we are running inside WSL.""" + if platform.system() != "Linux": + return False + try: + with open("/proc/version") as f: + version_info = f.read().lower() + return "microsoft" in version_info or "wsl" in version_info + except FileNotFoundError: + return False + + def _determine_constraint_branch_used(airflow_constraints_reference: str, use_airflow_version: str | None): """ Determine which constraints reference to use. @@ -611,6 +624,13 @@ def start_airflow( ) skip_assets_compilation = True + # Automatically enable file polling for hot reloading under WSL + if dev_mode and is_wsl(): + os.environ["CHOKIDAR_USEPOLLING"] = "true" + get_console().print( + "[info]Detected WSL environment. Automatically enabled CHOKIDAR_USEPOLLING for hot reloading." + ) + if use_airflow_version is None and not skip_assets_compilation: # Now with the /ui project, lets only do a static build of /www and focus on the /ui run_compile_ui_assets(dev=dev_mode, run_in_background=True, force_clean=False) From 1cc246b22cbfdc87ea311961e20d5f13c021f725 Mon Sep 17 00:00:00 2001 From: Lohith M Date: Tue, 11 Nov 2025 13:23:59 +0000 Subject: [PATCH 3/4] Breeze: Automatically set CHOKIDAR_USEPOLLING for WSL users in --dev-mode (#57846) --- dev/breeze/src/airflow_breeze/commands/developer_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/breeze/src/airflow_breeze/commands/developer_commands.py b/dev/breeze/src/airflow_breeze/commands/developer_commands.py index 8eb9d119c158b..684c771731a96 100644 --- a/dev/breeze/src/airflow_breeze/commands/developer_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/developer_commands.py @@ -132,7 +132,7 @@ def is_wsl() -> bool: """Detect if we are running inside WSL.""" - if platform.system() != "Linux": + if platform.system().lower() != "Linux": return False try: with open("/proc/version") as f: From c681cbfe8a2b1f9737e8ac0a40b0d69320d771ff Mon Sep 17 00:00:00 2001 From: Lohith M <152604836+Lohith625@users.noreply.github.com> Date: Sat, 15 Nov 2025 12:43:12 +0530 Subject: [PATCH 4/4] Update dev/breeze/src/airflow_breeze/commands/developer_commands.py Co-authored-by: LIU ZHE YOU <68415893+jason810496@users.noreply.github.com> --- dev/breeze/src/airflow_breeze/commands/developer_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/breeze/src/airflow_breeze/commands/developer_commands.py b/dev/breeze/src/airflow_breeze/commands/developer_commands.py index 684c771731a96..d248f95e6f2db 100644 --- a/dev/breeze/src/airflow_breeze/commands/developer_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/developer_commands.py @@ -132,7 +132,7 @@ def is_wsl() -> bool: """Detect if we are running inside WSL.""" - if platform.system().lower() != "Linux": + if platform.system().lower() != "linux": return False try: with open("/proc/version") as f: