From 1cdac483c7ccb52135d9e6751bc91e2f5c00b178 Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Thu, 15 May 2025 17:24:21 +0200 Subject: [PATCH 01/11] Move log_fetch_timeout_sec config to api section --- .../src/airflow/cli/commands/config_command.py | 5 +++++ .../src/airflow/config_templates/config.yml | 15 +++++++++++++++ airflow-core/src/airflow/configuration.py | 1 + .../src/airflow/utils/log/file_task_handler.py | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index 130f829daa051..2d1af01a867ed 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -478,6 +478,11 @@ def message(self) -> str | None: config=ConfigParameter("webserver", "default_dag_run_display_number"), was_deprecated=False, ), + ConfigChange( + config=ConfigParameter("webserver", "log_fetch_timeout_sec"), + renamed_to=ConfigParameter("api", "log_fetch_timeout_sec"), + breaking=True, + ), ConfigChange( config=ConfigParameter("webserver", "enable_proxy_fix"), renamed_to=ConfigParameter("fab", "enable_proxy_fix"), diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index b98895d186be5..29ad7c65b7f1a 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1412,6 +1412,14 @@ api: type: string example: ~ default: "topological" + log_fetch_timeout_sec: + description: | + The amount of time (in secs) webserver will wait for initial handshake + while fetching logs from other worker machine + version_added: ~ + type: string + example: ~ + default: "5" workers: description: Configuration related to workers that run Airflow tasks. options: @@ -1722,6 +1730,13 @@ webserver: type: string example: ~ default: "5" + grid_view_sorting_order: + description: | + Sorting order in grid view. Valid values are: ``topological``, ``hierarchical_alphabetical`` + version_added: 2.7.0 + type: string + example: ~ + default: "topological" hide_paused_dags_by_default: description: | By default, the webserver shows paused DAGs. Flip this to hide paused diff --git a/airflow-core/src/airflow/configuration.py b/airflow-core/src/airflow/configuration.py index e60afbd3c954c..171d2571d8afd 100644 --- a/airflow-core/src/airflow/configuration.py +++ b/airflow-core/src/airflow/configuration.py @@ -359,6 +359,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]: ("fab", "access_denied_message"): ("webserver", "access_denied_message", "3.0.2"), ("fab", "expose_hostname"): ("webserver", "expose_hostname", "3.0.2"), ("api", "grid_view_sorting_order"): ("webserver", "grid_view_sorting_order", "3.1.0"), + ("api", "log_fetch_timeout_sec"): ("webserver", "log_fetch_timeout_sec", "3.1.0"), } # A mapping of new section -> (old section, since_version). diff --git a/airflow-core/src/airflow/utils/log/file_task_handler.py b/airflow-core/src/airflow/utils/log/file_task_handler.py index 5314aa859c13f..25ac26b630fdc 100644 --- a/airflow-core/src/airflow/utils/log/file_task_handler.py +++ b/airflow-core/src/airflow/utils/log/file_task_handler.py @@ -107,7 +107,7 @@ def _fetch_logs_from_service(url, log_relative_path): from airflow.api_fastapi.auth.tokens import JWTGenerator, get_signing_key - timeout = conf.getint("webserver", "log_fetch_timeout_sec", fallback=None) + timeout = conf.getint("api", "log_fetch_timeout_sec", fallback=None) generator = JWTGenerator( secret_key=get_signing_key("webserver", "secret_key"), # Since we are using a secret key, we need to be explicit about the algorithm here too From 31f91dc6fba4c95c3b31dc8235ef5461130197b1 Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Thu, 15 May 2025 18:08:50 +0200 Subject: [PATCH 02/11] Move hide_paused_dags_by_default config to api section --- .../api_fastapi/core_api/routes/ui/config.py | 2 +- .../airflow/cli/commands/config_command.py | 5 +++ .../src/airflow/config_templates/config.yml | 16 +++---- airflow-core/src/airflow/configuration.py | 1 + .../core_api/routes/ui/test_config.py | 43 +++++++++---------- 5 files changed, 35 insertions(+), 32 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py index 413a69c3ba0f4..70d40a6411969 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py @@ -34,7 +34,6 @@ "navbar_color", "page_size", "auto_refresh_interval", - "hide_paused_dags_by_default", "warn_deployment_exposure", "default_wrap", "require_confirmation_dag_change", @@ -66,6 +65,7 @@ def get_configs() -> ConfigResponse: "dashboard_alert": DASHBOARD_UIALERTS, "show_external_log_redirect": task_log_reader.supports_external_link, "external_log_name": getattr(task_log_reader.log_handler, "log_name", None), + "hide_paused_dags_by_default": conf.get("api", "hide_paused_dags_by_default"), } config.update({key: value for key, value in additional_config.items()}) diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index 2d1af01a867ed..8bdb0d8202407 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -483,6 +483,11 @@ def message(self) -> str | None: renamed_to=ConfigParameter("api", "log_fetch_timeout_sec"), breaking=True, ), + ConfigChange( + config=ConfigParameter("webserver", "hide_paused_dags_by_default"), + renamed_to=ConfigParameter("api", "hide_paused_dags_by_default"), + breaking=True, + ), ConfigChange( config=ConfigParameter("webserver", "enable_proxy_fix"), renamed_to=ConfigParameter("fab", "enable_proxy_fix"), diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index 29ad7c65b7f1a..1f03aa710bd44 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1420,6 +1420,14 @@ api: type: string example: ~ default: "5" + hide_paused_dags_by_default: + description: | + By default, the webserver shows paused DAGs. Flip this to hide paused + DAGs by default + version_added: ~ + type: string + example: ~ + default: "False" workers: description: Configuration related to workers that run Airflow tasks. options: @@ -1737,14 +1745,6 @@ webserver: type: string example: ~ default: "topological" - hide_paused_dags_by_default: - description: | - By default, the webserver shows paused DAGs. Flip this to hide paused - DAGs by default - version_added: ~ - type: string - example: ~ - default: "False" page_size: description: | Consistent page size across all listing views in the UI diff --git a/airflow-core/src/airflow/configuration.py b/airflow-core/src/airflow/configuration.py index 171d2571d8afd..cc34241c5369e 100644 --- a/airflow-core/src/airflow/configuration.py +++ b/airflow-core/src/airflow/configuration.py @@ -360,6 +360,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]: ("fab", "expose_hostname"): ("webserver", "expose_hostname", "3.0.2"), ("api", "grid_view_sorting_order"): ("webserver", "grid_view_sorting_order", "3.1.0"), ("api", "log_fetch_timeout_sec"): ("webserver", "log_fetch_timeout_sec", "3.1.0"), + ("api", "hide_paused_dags_by_default"): ("webserver", "hide_paused_dags_by_default", "3.1.0"), } # A mapping of new section -> (old section, since_version). diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py index 4235d3178a467..b56bedee1f372 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py @@ -16,10 +16,10 @@ # under the License. from __future__ import annotations -from unittest.mock import patch - import pytest +from tests_common.test_utils.config import conf_vars + pytestmark = pytest.mark.db_test mock_config_response = { @@ -29,7 +29,7 @@ "navbar_text_hover_color": "#51504f", "page_size": 100, "auto_refresh_interval": 3, - "hide_paused_dags_by_default": False, + "hide_paused_dags_by_default": True, "instance_name": "Airflow", "instance_name_has_markup": False, "enable_swagger_ui": True, @@ -50,27 +50,24 @@ def mock_config_data(): """ Mock configuration settings used in the endpoint. """ - with patch("airflow.configuration.conf.as_dict") as mock_conf: - mock_conf.return_value = { - "webserver": { - "navbar_color": "#fff", - "navbar_text_color": "#51504f", - "navbar_hover_color": "#eee", - "navbar_text_hover_color": "#51504f", - "page_size": "100", - "auto_refresh_interval": "3", - "hide_paused_dags_by_default": "false", - "instance_name": "Airflow", - "instance_name_has_markup": "false", - "enable_swagger_ui": "true", - "require_confirmation_dag_change": "false", - "default_wrap": "false", - "warn_deployment_exposure": "false", - "audit_view_excluded_events": "", - "audit_view_included_events": "", - } + with conf_vars( + { + ("webserver", "navbar_color"): "#fff", + ("webserver", "navbar_text_color"): "#51504f", + ("webserver", "navbar_hover_color"): "#eee", + ("webserver", "navbar_text_hover_color"): "#51504f", + ("webserver", "page_size"): "100", + ("webserver", "auto_refresh_interval"): "3", + ("webserver", "instance_name"): "Airflow", + ("webserver", "instance_name_has_markup"): "false", + ("webserver", "enable_swagger_ui"): "true", + ("webserver", "require_confirmation_dag_change"): "false", + ("webserver", "default_wrap"): "false", + ("webserver", "warn_deployment_exposure"): "false", + ("api", "hide_paused_dags_by_default"): "true", } - yield mock_conf + ): + yield class TestGetConfig: From 1e15644726e336f2b9f131baa76189fe3dfdb8c8 Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Thu, 15 May 2025 18:50:15 +0200 Subject: [PATCH 03/11] Refac config route --- .../src/airflow/api_fastapi/core_api/routes/ui/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py index 70d40a6411969..88da4319afc45 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py @@ -44,6 +44,10 @@ "navbar_text_hover_color", ] +API_CONFIG_KEYS = [ + "hide_paused_dags_by_default", +] + @config_router.get( "/config", @@ -56,6 +60,8 @@ def get_configs() -> ConfigResponse: config = {key: conf_dict["webserver"].get(key) for key in WEBSERVER_CONFIG_KEYS} + config.update({key: conf_dict["api"].get(key) for key in API_CONFIG_KEYS}) + task_log_reader = TaskLogReader() additional_config: dict[str, Any] = { "instance_name": conf.get("webserver", "instance_name", fallback="Airflow"), @@ -65,7 +71,6 @@ def get_configs() -> ConfigResponse: "dashboard_alert": DASHBOARD_UIALERTS, "show_external_log_redirect": task_log_reader.supports_external_link, "external_log_name": getattr(task_log_reader.log_handler, "log_name", None), - "hide_paused_dags_by_default": conf.get("api", "hide_paused_dags_by_default"), } config.update({key: value for key, value in additional_config.items()}) From 3f2a708737dde6f5daa95b6540148c4d0349f780 Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Thu, 15 May 2025 18:55:01 +0200 Subject: [PATCH 04/11] Move page_size config to api section --- .../api_fastapi/core_api/routes/ui/config.py | 8 ++++---- .../src/airflow/cli/commands/config_command.py | 5 +++++ .../src/airflow/config_templates/config.yml | 14 +++++++------- airflow-core/src/airflow/configuration.py | 1 + .../api_fastapi/core_api/routes/ui/test_config.py | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py index 88da4319afc45..272929ecf1b5f 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py @@ -32,20 +32,20 @@ WEBSERVER_CONFIG_KEYS = [ "navbar_color", - "page_size", + "navbar_text_color", + "navbar_hover_color", + "navbar_text_hover_color", "auto_refresh_interval", "warn_deployment_exposure", "default_wrap", "require_confirmation_dag_change", "enable_swagger_ui", "instance_name_has_markup", - "navbar_text_color", - "navbar_hover_color", - "navbar_text_hover_color", ] API_CONFIG_KEYS = [ "hide_paused_dags_by_default", + "page_size", ] diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index 8bdb0d8202407..f8e93623482cc 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -488,6 +488,11 @@ def message(self) -> str | None: renamed_to=ConfigParameter("api", "hide_paused_dags_by_default"), breaking=True, ), + ConfigChange( + config=ConfigParameter("webserver", "page_size"), + renamed_to=ConfigParameter("api", "page_size"), + breaking=True, + ), ConfigChange( config=ConfigParameter("webserver", "enable_proxy_fix"), renamed_to=ConfigParameter("fab", "enable_proxy_fix"), diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index 1f03aa710bd44..ab5affeac3531 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1428,6 +1428,13 @@ api: type: string example: ~ default: "False" + page_size: + description: | + Consistent page size across all listing views in the UI + version_added: ~ + type: string + example: ~ + default: "50" workers: description: Configuration related to workers that run Airflow tasks. options: @@ -1745,13 +1752,6 @@ webserver: type: string example: ~ default: "topological" - page_size: - description: | - Consistent page size across all listing views in the UI - version_added: ~ - type: string - example: ~ - default: "50" navbar_color: description: | Define the color of navigation bar diff --git a/airflow-core/src/airflow/configuration.py b/airflow-core/src/airflow/configuration.py index cc34241c5369e..3058f1c934ddd 100644 --- a/airflow-core/src/airflow/configuration.py +++ b/airflow-core/src/airflow/configuration.py @@ -361,6 +361,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]: ("api", "grid_view_sorting_order"): ("webserver", "grid_view_sorting_order", "3.1.0"), ("api", "log_fetch_timeout_sec"): ("webserver", "log_fetch_timeout_sec", "3.1.0"), ("api", "hide_paused_dags_by_default"): ("webserver", "hide_paused_dags_by_default", "3.1.0"), + ("api", "page_size"): ("webserver", "page_size", "3.1.0"), } # A mapping of new section -> (old section, since_version). diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py index b56bedee1f372..53ab94cb57144 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py @@ -56,7 +56,6 @@ def mock_config_data(): ("webserver", "navbar_text_color"): "#51504f", ("webserver", "navbar_hover_color"): "#eee", ("webserver", "navbar_text_hover_color"): "#51504f", - ("webserver", "page_size"): "100", ("webserver", "auto_refresh_interval"): "3", ("webserver", "instance_name"): "Airflow", ("webserver", "instance_name_has_markup"): "false", @@ -65,6 +64,7 @@ def mock_config_data(): ("webserver", "default_wrap"): "false", ("webserver", "warn_deployment_exposure"): "false", ("api", "hide_paused_dags_by_default"): "true", + ("api", "page_size"): "100", } ): yield From 69845d24dffc5d5fec9a0e0ce858f923dfe08d48 Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Fri, 16 May 2025 11:22:28 +0200 Subject: [PATCH 05/11] Move default_wrap config to api section --- .../api_fastapi/core_api/routes/ui/config.py | 2 +- .../src/airflow/cli/commands/config_command.py | 5 +++++ .../src/airflow/config_templates/config.yml | 14 +++++++------- airflow-core/src/airflow/configuration.py | 1 + .../api_fastapi/core_api/routes/ui/test_config.py | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py index 272929ecf1b5f..28e5cb9ce9ad7 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py @@ -37,7 +37,6 @@ "navbar_text_hover_color", "auto_refresh_interval", "warn_deployment_exposure", - "default_wrap", "require_confirmation_dag_change", "enable_swagger_ui", "instance_name_has_markup", @@ -46,6 +45,7 @@ API_CONFIG_KEYS = [ "hide_paused_dags_by_default", "page_size", + "default_wrap", ] diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index f8e93623482cc..62f883cbe0aaf 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -493,6 +493,11 @@ def message(self) -> str | None: renamed_to=ConfigParameter("api", "page_size"), breaking=True, ), + ConfigChange( + config=ConfigParameter("webserver", "default_wrap"), + renamed_to=ConfigParameter("api", "default_wrap"), + breaking=True, + ), ConfigChange( config=ConfigParameter("webserver", "enable_proxy_fix"), renamed_to=ConfigParameter("fab", "enable_proxy_fix"), diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index ab5affeac3531..5feda86b35b31 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1435,6 +1435,13 @@ api: type: string example: ~ default: "50" + default_wrap: + description: | + Default setting for wrap toggle on DAG code and TI log views. + version_added: 1.10.4 + type: boolean + example: ~ + default: "False" workers: description: Configuration related to workers that run Airflow tasks. options: @@ -1780,13 +1787,6 @@ webserver: type: string example: ~ default: "#51504f" - default_wrap: - description: | - Default setting for wrap toggle on DAG code and TI log views. - version_added: 1.10.4 - type: boolean - example: ~ - default: "False" x_frame_enabled: description: | Allow the UI to be rendered in a frame diff --git a/airflow-core/src/airflow/configuration.py b/airflow-core/src/airflow/configuration.py index 3058f1c934ddd..4e21f0d418c85 100644 --- a/airflow-core/src/airflow/configuration.py +++ b/airflow-core/src/airflow/configuration.py @@ -362,6 +362,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]: ("api", "log_fetch_timeout_sec"): ("webserver", "log_fetch_timeout_sec", "3.1.0"), ("api", "hide_paused_dags_by_default"): ("webserver", "hide_paused_dags_by_default", "3.1.0"), ("api", "page_size"): ("webserver", "page_size", "3.1.0"), + ("api", "default_wrap"): ("webserver", "default_wrap", "3.1.0"), } # A mapping of new section -> (old section, since_version). diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py index 53ab94cb57144..2e6d063639646 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py @@ -61,10 +61,10 @@ def mock_config_data(): ("webserver", "instance_name_has_markup"): "false", ("webserver", "enable_swagger_ui"): "true", ("webserver", "require_confirmation_dag_change"): "false", - ("webserver", "default_wrap"): "false", ("webserver", "warn_deployment_exposure"): "false", ("api", "hide_paused_dags_by_default"): "true", ("api", "page_size"): "100", + ("api", "default_wrap"): "false", } ): yield From d42daad21c4d5f9226a7d473478d6275c4bf066b Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Fri, 16 May 2025 11:38:31 +0200 Subject: [PATCH 06/11] Remove instance_name_has_markup config --- airflow-core/docs/howto/customize-ui.rst | 4 ---- .../airflow/api_fastapi/core_api/datamodels/ui/config.py | 1 - .../airflow/api_fastapi/core_api/openapi/_private_ui.yaml | 4 ---- .../src/airflow/api_fastapi/core_api/routes/ui/config.py | 1 - airflow-core/src/airflow/cli/commands/config_command.py | 4 ++++ airflow-core/src/airflow/config_templates/config.yml | 7 ------- .../src/airflow/ui/openapi-gen/requests/schemas.gen.ts | 5 ----- .../src/airflow/ui/openapi-gen/requests/types.gen.ts | 1 - airflow-core/src/airflow/ui/src/mocks/handlers/config.ts | 1 - .../unit/api_fastapi/core_api/routes/ui/test_config.py | 1 - 10 files changed, 4 insertions(+), 25 deletions(-) diff --git a/airflow-core/docs/howto/customize-ui.rst b/airflow-core/docs/howto/customize-ui.rst index 85947c87e0dc4..6d1c444f9a844 100644 --- a/airflow-core/docs/howto/customize-ui.rst +++ b/airflow-core/docs/howto/customize-ui.rst @@ -61,10 +61,6 @@ After .. image:: ../img/change-site-title/example_instance_name_configuration.png -.. note:: - - From version 2.3.0 you can include markup in ``instance_name`` variable for further customization. To enable, set ``instance_name_has_markup`` under the ``[webserver]`` section inside ``airflow.cfg`` to ``True``. - Add custom alert messages on the dashboard ------------------------------------------ diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py index cb52591849374..1b685553fe5b4 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py @@ -32,7 +32,6 @@ class ConfigResponse(BaseModel): auto_refresh_interval: int hide_paused_dags_by_default: bool instance_name: str - instance_name_has_markup: bool enable_swagger_ui: bool require_confirmation_dag_change: bool default_wrap: bool diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml index 7f34ed7b3cb9a..7eeb17a12faab 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml +++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml @@ -764,9 +764,6 @@ components: instance_name: type: string title: Instance Name - instance_name_has_markup: - type: boolean - title: Instance Name Has Markup enable_swagger_ui: type: boolean title: Enable Swagger Ui @@ -811,7 +808,6 @@ components: - auto_refresh_interval - hide_paused_dags_by_default - instance_name - - instance_name_has_markup - enable_swagger_ui - require_confirmation_dag_change - default_wrap diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py index 28e5cb9ce9ad7..4e164658cf8bb 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py @@ -39,7 +39,6 @@ "warn_deployment_exposure", "require_confirmation_dag_change", "enable_swagger_ui", - "instance_name_has_markup", ] API_CONFIG_KEYS = [ diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index 62f883cbe0aaf..b93b76c7f4562 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -498,6 +498,10 @@ def message(self) -> str | None: renamed_to=ConfigParameter("api", "default_wrap"), breaking=True, ), + ConfigChange( + config=ConfigParameter("webserver", "instance_name_has_markup"), + was_deprecated=False, + ), ConfigChange( config=ConfigParameter("webserver", "enable_proxy_fix"), renamed_to=ConfigParameter("fab", "enable_proxy_fix"), diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index 5feda86b35b31..d3196d270d7e1 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1801,13 +1801,6 @@ webserver: type: string example: ~ default: - instance_name_has_markup: - description: | - Whether the custom page title for the DAGs overview page contains any Markup language - version_added: 2.3.0 - type: boolean - example: ~ - default: "False" auto_refresh_interval: description: | How frequently, in seconds, the DAG data will auto-refresh in graph or grid view diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts index 8b3913a40844f..63680817eb888 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts @@ -6027,10 +6027,6 @@ export const $ConfigResponse = { type: "string", title: "Instance Name", }, - instance_name_has_markup: { - type: "boolean", - title: "Instance Name Has Markup", - }, enable_swagger_ui: { type: "boolean", title: "Enable Swagger Ui", @@ -6092,7 +6088,6 @@ export const $ConfigResponse = { "auto_refresh_interval", "hide_paused_dags_by_default", "instance_name", - "instance_name_has_markup", "enable_swagger_ui", "require_confirmation_dag_change", "default_wrap", diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts index 3e5232ef9cd2b..59b107fe24f92 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts @@ -1504,7 +1504,6 @@ export type ConfigResponse = { auto_refresh_interval: number; hide_paused_dags_by_default: boolean; instance_name: string; - instance_name_has_markup: boolean; enable_swagger_ui: boolean; require_confirmation_dag_change: boolean; default_wrap: boolean; diff --git a/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts b/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts index 79dfc7d634ab0..ccc60fc4ddb6a 100644 --- a/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts +++ b/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts @@ -28,7 +28,6 @@ export const handlers: Array = [ enable_swagger_ui: true, hide_paused_dags_by_default: false, instance_name: "Airflow", - instance_name_has_markup: false, navbar_color: "#fff", navbar_hover_color: "#eee", navbar_text_color: "#51504f", diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py index 2e6d063639646..3b8998e271953 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py @@ -31,7 +31,6 @@ "auto_refresh_interval": 3, "hide_paused_dags_by_default": True, "instance_name": "Airflow", - "instance_name_has_markup": False, "enable_swagger_ui": True, "require_confirmation_dag_change": False, "default_wrap": False, From 1f2f282ea7842158faf3a7d2f209b6a51b6245ea Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Fri, 16 May 2025 12:05:06 +0200 Subject: [PATCH 07/11] Move auto_refresh_interval config to api --- .../api_fastapi/core_api/routes/ui/config.py | 2 +- .../src/airflow/cli/commands/config_command.py | 5 +++++ .../src/airflow/config_templates/config.yml | 16 ++++++++-------- airflow-core/src/airflow/configuration.py | 1 + .../core_api/routes/ui/test_config.py | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py index 4e164658cf8bb..86b841153cb0f 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py @@ -35,7 +35,6 @@ "navbar_text_color", "navbar_hover_color", "navbar_text_hover_color", - "auto_refresh_interval", "warn_deployment_exposure", "require_confirmation_dag_change", "enable_swagger_ui", @@ -45,6 +44,7 @@ "hide_paused_dags_by_default", "page_size", "default_wrap", + "auto_refresh_interval", ] diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index b93b76c7f4562..cb12fb6a00c68 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -502,6 +502,11 @@ def message(self) -> str | None: config=ConfigParameter("webserver", "instance_name_has_markup"), was_deprecated=False, ), + ConfigChange( + config=ConfigParameter("webserver", "auto_refresh_interval"), + renamed_to=ConfigParameter("api", "auto_refresh_interval"), + breaking=True, + ), ConfigChange( config=ConfigParameter("webserver", "enable_proxy_fix"), renamed_to=ConfigParameter("fab", "enable_proxy_fix"), diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index d3196d270d7e1..3714a8adf828b 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1442,6 +1442,14 @@ api: type: boolean example: ~ default: "False" + auto_refresh_interval: + description: | + How frequently, in seconds, the DAG data will auto-refresh in graph or grid view + when auto-refresh is turned on + version_added: 2.2.0 + type: integer + example: ~ + default: "3" workers: description: Configuration related to workers that run Airflow tasks. options: @@ -1801,14 +1809,6 @@ webserver: type: string example: ~ default: - auto_refresh_interval: - description: | - How frequently, in seconds, the DAG data will auto-refresh in graph or grid view - when auto-refresh is turned on - version_added: 2.2.0 - type: integer - example: ~ - default: "3" warn_deployment_exposure: description: | Boolean for displaying warning for publicly viewable deployment diff --git a/airflow-core/src/airflow/configuration.py b/airflow-core/src/airflow/configuration.py index 4e21f0d418c85..245cc5682db0e 100644 --- a/airflow-core/src/airflow/configuration.py +++ b/airflow-core/src/airflow/configuration.py @@ -363,6 +363,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]: ("api", "hide_paused_dags_by_default"): ("webserver", "hide_paused_dags_by_default", "3.1.0"), ("api", "page_size"): ("webserver", "page_size", "3.1.0"), ("api", "default_wrap"): ("webserver", "default_wrap", "3.1.0"), + ("api", "auto_refresh_interval"): ("webserver", "auto_refresh_interval", "3.1.0"), } # A mapping of new section -> (old section, since_version). diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py index 3b8998e271953..a8915274d03aa 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py @@ -55,7 +55,6 @@ def mock_config_data(): ("webserver", "navbar_text_color"): "#51504f", ("webserver", "navbar_hover_color"): "#eee", ("webserver", "navbar_text_hover_color"): "#51504f", - ("webserver", "auto_refresh_interval"): "3", ("webserver", "instance_name"): "Airflow", ("webserver", "instance_name_has_markup"): "false", ("webserver", "enable_swagger_ui"): "true", @@ -64,6 +63,7 @@ def mock_config_data(): ("api", "hide_paused_dags_by_default"): "true", ("api", "page_size"): "100", ("api", "default_wrap"): "false", + ("api", "auto_refresh_interval"): "3", } ): yield From 4136d370dba578312943a6075333591002122fd6 Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Fri, 16 May 2025 12:33:21 +0200 Subject: [PATCH 08/11] Remove warn_deployment_exposure config --- .../api_fastapi/core_api/datamodels/ui/config.py | 1 - .../api_fastapi/core_api/openapi/_private_ui.yaml | 4 ---- .../airflow/api_fastapi/core_api/routes/ui/config.py | 1 - .../src/airflow/cli/commands/config_command.py | 4 ++++ airflow-core/src/airflow/config_templates/config.yml | 7 ------- .../airflow/ui/openapi-gen/requests/schemas.gen.ts | 5 ----- .../src/airflow/ui/openapi-gen/requests/types.gen.ts | 1 - .../src/airflow/ui/src/mocks/handlers/config.ts | 1 - .../api_fastapi/core_api/routes/ui/test_config.py | 2 -- providers/fab/docs/auth-manager/security.rst | 11 ----------- 10 files changed, 4 insertions(+), 33 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py index 1b685553fe5b4..691636418b7ec 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py @@ -35,7 +35,6 @@ class ConfigResponse(BaseModel): enable_swagger_ui: bool require_confirmation_dag_change: bool default_wrap: bool - warn_deployment_exposure: bool audit_view_excluded_events: str audit_view_included_events: str test_connection: str diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml index 7eeb17a12faab..c53a149e3a4a7 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml +++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml @@ -773,9 +773,6 @@ components: default_wrap: type: boolean title: Default Wrap - warn_deployment_exposure: - type: boolean - title: Warn Deployment Exposure audit_view_excluded_events: type: string title: Audit View Excluded Events @@ -811,7 +808,6 @@ components: - enable_swagger_ui - require_confirmation_dag_change - default_wrap - - warn_deployment_exposure - audit_view_excluded_events - audit_view_included_events - test_connection diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py index 86b841153cb0f..9f649defcbd4b 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py @@ -35,7 +35,6 @@ "navbar_text_color", "navbar_hover_color", "navbar_text_hover_color", - "warn_deployment_exposure", "require_confirmation_dag_change", "enable_swagger_ui", ] diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index cb12fb6a00c68..1207e41aeca79 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -502,6 +502,10 @@ def message(self) -> str | None: config=ConfigParameter("webserver", "instance_name_has_markup"), was_deprecated=False, ), + ConfigChange( + config=ConfigParameter("webserver", "warn_deployment_exposure"), + was_deprecated=False, + ), ConfigChange( config=ConfigParameter("webserver", "auto_refresh_interval"), renamed_to=ConfigParameter("api", "auto_refresh_interval"), diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index 3714a8adf828b..d7d0ef4c4ceea 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1809,13 +1809,6 @@ webserver: type: string example: ~ default: - warn_deployment_exposure: - description: | - Boolean for displaying warning for publicly viewable deployment - version_added: 2.3.0 - type: boolean - example: ~ - default: "True" audit_view_excluded_events: description: | Comma separated string of view events to exclude from dag audit view. diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts index 63680817eb888..8eb2b01827013 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts @@ -6039,10 +6039,6 @@ export const $ConfigResponse = { type: "boolean", title: "Default Wrap", }, - warn_deployment_exposure: { - type: "boolean", - title: "Warn Deployment Exposure", - }, audit_view_excluded_events: { type: "string", title: "Audit View Excluded Events", @@ -6091,7 +6087,6 @@ export const $ConfigResponse = { "enable_swagger_ui", "require_confirmation_dag_change", "default_wrap", - "warn_deployment_exposure", "audit_view_excluded_events", "audit_view_included_events", "test_connection", diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts index 59b107fe24f92..f00a56b44546d 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts @@ -1507,7 +1507,6 @@ export type ConfigResponse = { enable_swagger_ui: boolean; require_confirmation_dag_change: boolean; default_wrap: boolean; - warn_deployment_exposure: boolean; audit_view_excluded_events: string; audit_view_included_events: string; test_connection: string; diff --git a/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts b/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts index ccc60fc4ddb6a..ac15e99d76f26 100644 --- a/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts +++ b/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts @@ -35,7 +35,6 @@ export const handlers: Array = [ page_size: 15, require_confirmation_dag_change: false, test_connection: "Disabled", - warn_deployment_exposure: true, }), ), ]; diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py index a8915274d03aa..a3616cfcf94e7 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py @@ -34,7 +34,6 @@ "enable_swagger_ui": True, "require_confirmation_dag_change": False, "default_wrap": False, - "warn_deployment_exposure": False, "audit_view_excluded_events": "", "audit_view_included_events": "", "test_connection": "Disabled", @@ -59,7 +58,6 @@ def mock_config_data(): ("webserver", "instance_name_has_markup"): "false", ("webserver", "enable_swagger_ui"): "true", ("webserver", "require_confirmation_dag_change"): "false", - ("webserver", "warn_deployment_exposure"): "false", ("api", "hide_paused_dags_by_default"): "true", ("api", "page_size"): "100", ("api", "default_wrap"): "false", diff --git a/providers/fab/docs/auth-manager/security.rst b/providers/fab/docs/auth-manager/security.rst index cd07d24c556ee..d31f51cebd69c 100644 --- a/providers/fab/docs/auth-manager/security.rst +++ b/providers/fab/docs/auth-manager/security.rst @@ -33,17 +33,6 @@ set the below: [webserver] x_frame_enabled = False -Disable Deployment Exposure Warning ---------------------------------------- - -Airflow warns when recent requests are made to ``/robots.txt``. To disable this warning set ``warn_deployment_exposure`` to -``False`` as below: - -.. code-block:: ini - - [webserver] - warn_deployment_exposure = False - Sensitive Variable fields ------------------------- From a85366152fcb58c777c172380945099879c66f0e Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Fri, 16 May 2025 12:39:51 +0200 Subject: [PATCH 09/11] Move require_confirmation_dag_change config to api --- .../api_fastapi/core_api/routes/ui/config.py | 2 +- .../airflow/cli/commands/config_command.py | 5 +++++ .../src/airflow/config_templates/config.yml | 20 +++++++++---------- airflow-core/src/airflow/configuration.py | 1 + .../core_api/routes/ui/test_config.py | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py index 9f649defcbd4b..6e3a7efd84d00 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py @@ -35,7 +35,6 @@ "navbar_text_color", "navbar_hover_color", "navbar_text_hover_color", - "require_confirmation_dag_change", "enable_swagger_ui", ] @@ -44,6 +43,7 @@ "page_size", "default_wrap", "auto_refresh_interval", + "require_confirmation_dag_change", ] diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index 1207e41aeca79..0e8cf10e854f5 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -498,6 +498,11 @@ def message(self) -> str | None: renamed_to=ConfigParameter("api", "default_wrap"), breaking=True, ), + ConfigChange( + config=ConfigParameter("webserver", "require_confirmation_dag_change"), + renamed_to=ConfigParameter("api", "require_confirmation_dag_change"), + breaking=True, + ), ConfigChange( config=ConfigParameter("webserver", "instance_name_has_markup"), was_deprecated=False, diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index d7d0ef4c4ceea..45726c498f921 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1450,6 +1450,16 @@ api: type: integer example: ~ default: "3" + require_confirmation_dag_change: + description: | + Require confirmation when changing a DAG in the web UI. This is to prevent accidental changes + to a DAG that may be running on sensitive environments like production. + When set to ``True``, confirmation dialog will be shown when a user tries to Pause/Unpause, + Trigger a DAG + version_added: 2.9.0 + type: boolean + example: ~ + default: "False" workers: description: Configuration related to workers that run Airflow tasks. options: @@ -1834,16 +1844,6 @@ webserver: type: boolean example: ~ default: "True" - require_confirmation_dag_change: - description: | - Require confirmation when changing a DAG in the web UI. This is to prevent accidental changes - to a DAG that may be running on sensitive environments like production. - When set to ``True``, confirmation dialog will be shown when a user tries to Pause/Unpause, - Trigger a DAG - version_added: 2.9.0 - type: boolean - example: ~ - default: "False" email: description: | Configuration email backend and whether to diff --git a/airflow-core/src/airflow/configuration.py b/airflow-core/src/airflow/configuration.py index 245cc5682db0e..becad87004284 100644 --- a/airflow-core/src/airflow/configuration.py +++ b/airflow-core/src/airflow/configuration.py @@ -364,6 +364,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]: ("api", "page_size"): ("webserver", "page_size", "3.1.0"), ("api", "default_wrap"): ("webserver", "default_wrap", "3.1.0"), ("api", "auto_refresh_interval"): ("webserver", "auto_refresh_interval", "3.1.0"), + ("api", "require_confirmation_dag_change"): ("webserver", "require_confirmation_dag_change", "3.1.0"), } # A mapping of new section -> (old section, since_version). diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py index a3616cfcf94e7..16d1f1014530f 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py @@ -57,11 +57,11 @@ def mock_config_data(): ("webserver", "instance_name"): "Airflow", ("webserver", "instance_name_has_markup"): "false", ("webserver", "enable_swagger_ui"): "true", - ("webserver", "require_confirmation_dag_change"): "false", ("api", "hide_paused_dags_by_default"): "true", ("api", "page_size"): "100", ("api", "default_wrap"): "false", ("api", "auto_refresh_interval"): "3", + ("api", "require_confirmation_dag_change"): "false", } ): yield From f95b8ddaa136c1f14261ea25c8f1247044f0335c Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Fri, 16 May 2025 16:09:39 +0200 Subject: [PATCH 10/11] Add newsfragment --- .../newsfragments/50693.significant.rst | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 airflow-core/newsfragments/50693.significant.rst diff --git a/airflow-core/newsfragments/50693.significant.rst b/airflow-core/newsfragments/50693.significant.rst new file mode 100644 index 0000000000000..6368ddf0ee56c --- /dev/null +++ b/airflow-core/newsfragments/50693.significant.rst @@ -0,0 +1,41 @@ +Unused webserver configuration options have been removed + +The following webserver options were moved into the ``api`` section: + +* ``[webserver] log_fetch_timeout_sec`` → ``[api] log_fetch_timeout_sec`` +* ``[webserver] hide_paused_dags_by_default`` → ``[api] hide_paused_dags_by_default`` +* ``[webserver] page_size`` → ``[api] page_size`` +* ``[webserver] default_wrap`` → ``[api] default_wrap`` +* ``[webserver] require_confirmation_dag_change`` → ``[api] require_confirmation_dag_change`` +* ``[webserver] auto_refresh_interval`` → ``[api] auto_refresh_interval`` + +The following configuration options are now unused and have been removed: + +- ``[webserver] instance_name_has_markup`` +- ``[webserver] warn_deployment_exposure`` + +* Types of change + + * [ ] Dag changes + * [x] Config changes + * [ ] API changes + * [ ] CLI changes + * [ ] Behaviour changes + * [ ] Plugin changes + * [ ] Dependency changes + * [ ] Code interface changes + +.. List the migration rules needed for this change (see https://github.com/apache/airflow/issues/41641) + +* Migration rules needed + + * ``airflow config lint`` + + * [ ] Remove configuration option ``[webserver] instance_name_has_markup`` + * [ ] Remove configuration option ``[webserver] warn_deployment_exposure`` + * [ ] [webserver] log_fetch_timeout_sec`` → ``[api] log_fetch_timeout_sec`` + * [ ] [webserver] hide_paused_dags_by_default`` → ``[api] hide_paused_dags_by_default`` + * [ ] [webserver] page_size`` → ``[api] page_size`` + * [ ] [webserver] default_wrap`` → ``[api] default_wrap`` + * [ ] [webserver] require_confirmation_dag_change`` → ``[api] require_confirmation_dag_change`` + * [ ] [webserver] auto_refresh_interval`` → ``[api] auto_refresh_interval`` From 69b4542b1d9dfe346625484b11a262bc6def01ce Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Mon, 19 May 2025 12:32:50 +0200 Subject: [PATCH 11/11] Fix CI --- .../src/airflow/config_templates/config.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index 45726c498f921..534f0475d779e 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1762,21 +1762,6 @@ webserver: sensitive: true example: ~ default: "{SECRET_KEY}" - log_fetch_timeout_sec: - description: | - The amount of time (in secs) webserver will wait for initial handshake - while fetching logs from other worker machine - version_added: ~ - type: string - example: ~ - default: "5" - grid_view_sorting_order: - description: | - Sorting order in grid view. Valid values are: ``topological``, ``hierarchical_alphabetical`` - version_added: 2.7.0 - type: string - example: ~ - default: "topological" navbar_color: description: | Define the color of navigation bar