Skip to content
Merged
4 changes: 0 additions & 4 deletions airflow-core/docs/howto/customize-ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------------------------------
Expand Down
41 changes: 41 additions & 0 deletions airflow-core/newsfragments/50693.significant.rst
Original file line number Diff line number Diff line change
@@ -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``
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ 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
warn_deployment_exposure: bool
audit_view_excluded_events: str
audit_view_included_events: str
test_connection: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -776,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
Expand Down Expand Up @@ -811,11 +805,9 @@ components:
- auto_refresh_interval
- hide_paused_dags_by_default
- instance_name
- instance_name_has_markup
- enable_swagger_ui
- require_confirmation_dag_change
- default_wrap
- warn_deployment_exposure
- audit_view_excluded_events
- audit_view_included_events
- test_connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@

WEBSERVER_CONFIG_KEYS = [
"navbar_color",
"page_size",
"auto_refresh_interval",
"hide_paused_dags_by_default",
"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",
"enable_swagger_ui",
]

API_CONFIG_KEYS = [
"hide_paused_dags_by_default",
"page_size",
"default_wrap",
"auto_refresh_interval",
"require_confirmation_dag_change",
]


Expand All @@ -57,6 +58,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"),
Expand Down
38 changes: 38 additions & 0 deletions airflow-core/src/airflow/cli/commands/config_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,44 @@ 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", "hide_paused_dags_by_default"),
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", "default_wrap"),
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,
),
ConfigChange(
config=ConfigParameter("webserver", "warn_deployment_exposure"),
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"),
Expand Down
110 changes: 48 additions & 62 deletions airflow-core/src/airflow/config_templates/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,54 @@ 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"
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
version_added: ~
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"
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"
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:
Expand Down Expand Up @@ -1714,29 +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"
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
version_added: ~
type: string
example: ~
default: "50"
navbar_color:
description: |
Define the color of navigation bar
Expand Down Expand Up @@ -1765,13 +1790,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
Expand All @@ -1786,28 +1804,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
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
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.
Expand All @@ -1833,16 +1829,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
Expand Down
6 changes: 6 additions & 0 deletions airflow-core/src/airflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,12 @@ 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"),
("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"),
("api", "require_confirmation_dag_change"): ("webserver", "require_confirmation_dag_change", "3.1.0"),
}

# A mapping of new section -> (old section, since_version).
Expand Down
10 changes: 0 additions & 10 deletions airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -6043,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",
Expand Down Expand Up @@ -6092,11 +6084,9 @@ 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",
"warn_deployment_exposure",
"audit_view_excluded_events",
"audit_view_included_events",
"test_connection",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1504,11 +1504,9 @@ 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;
warn_deployment_exposure: boolean;
audit_view_excluded_events: string;
audit_view_included_events: string;
test_connection: string;
Expand Down
2 changes: 0 additions & 2 deletions airflow-core/src/airflow/ui/src/mocks/handlers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ export const handlers: Array<HttpHandler> = [
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",
navbar_text_hover_color: "#51504f",
page_size: 15,
require_confirmation_dag_change: false,
test_connection: "Disabled",
warn_deployment_exposure: true,
}),
),
];
Loading
Loading