Skip to content

Commit 2eb5436

Browse files
pierrejeambrundadonnelly316
authored andcommitted
Move webserver config to fab provider (apache#50774)
* Move webserver navbar config to fab provider * Remove x_frame_enabled config
1 parent 4696b91 commit 2eb5436

File tree

21 files changed

+93
-140
lines changed

21 files changed

+93
-140
lines changed

airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
class ConfigResponse(BaseModel):
2525
"""configuration serializer."""
2626

27-
navbar_color: str
28-
navbar_text_color: str
29-
navbar_hover_color: str
30-
navbar_text_hover_color: str
3127
page_size: int
3228
auto_refresh_interval: int
3329
hide_paused_dags_by_default: bool

airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -740,18 +740,6 @@ components:
740740
description: Base Node serializer for responses.
741741
ConfigResponse:
742742
properties:
743-
navbar_color:
744-
type: string
745-
title: Navbar Color
746-
navbar_text_color:
747-
type: string
748-
title: Navbar Text Color
749-
navbar_hover_color:
750-
type: string
751-
title: Navbar Hover Color
752-
navbar_text_hover_color:
753-
type: string
754-
title: Navbar Text Hover Color
755743
page_size:
756744
type: integer
757745
title: Page Size
@@ -797,10 +785,6 @@ components:
797785
title: External Log Name
798786
type: object
799787
required:
800-
- navbar_color
801-
- navbar_text_color
802-
- navbar_hover_color
803-
- navbar_text_hover_color
804788
- page_size
805789
- auto_refresh_interval
806790
- hide_paused_dags_by_default

airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
config_router = AirflowRouter(tags=["Config"])
3232

3333
WEBSERVER_CONFIG_KEYS = [
34-
"navbar_color",
35-
"navbar_text_color",
36-
"navbar_hover_color",
37-
"navbar_text_hover_color",
3834
"enable_swagger_ui",
3935
]
4036

airflow-core/src/airflow/cli/commands/config_command.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,26 @@ def message(self) -> str | None:
387387
config=ConfigParameter("webserver", "expose_hostname"),
388388
renamed_to=ConfigParameter("fab", "expose_hostname"),
389389
),
390+
ConfigChange(
391+
config=ConfigParameter("webserver", "navbar_color"),
392+
renamed_to=ConfigParameter("fab", "navbar_color"),
393+
),
394+
ConfigChange(
395+
config=ConfigParameter("webserver", "navbar_text_color"),
396+
renamed_to=ConfigParameter("fab", "navbar_text_color"),
397+
),
398+
ConfigChange(
399+
config=ConfigParameter("webserver", "navbar_hover_color"),
400+
renamed_to=ConfigParameter("fab", "navbar_hover_color"),
401+
),
402+
ConfigChange(
403+
config=ConfigParameter("webserver", "navbar_text_hover_color"),
404+
renamed_to=ConfigParameter("fab", "navbar_text_hover_color"),
405+
),
406+
ConfigChange(
407+
config=ConfigParameter("webserver", "x_frame_enabled"),
408+
was_deprecated=False,
409+
),
390410
ConfigChange(
391411
config=ConfigParameter("webserver", "base_url"),
392412
renamed_to=ConfigParameter("api", "base_url"),

airflow-core/src/airflow/config_templates/config.yml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,41 +1762,6 @@ webserver:
17621762
sensitive: true
17631763
example: ~
17641764
default: "{SECRET_KEY}"
1765-
navbar_color:
1766-
description: |
1767-
Define the color of navigation bar
1768-
version_added: ~
1769-
type: string
1770-
example: ~
1771-
default: "#fff"
1772-
navbar_text_color:
1773-
description: |
1774-
Define the color of text in the navigation bar
1775-
version_added: 2.8.0
1776-
type: string
1777-
example: ~
1778-
default: "#51504f"
1779-
navbar_hover_color:
1780-
description: |
1781-
Define the color of navigation bar links when hovered
1782-
version_added: 2.9.0
1783-
type: string
1784-
example: ~
1785-
default: "#eee"
1786-
navbar_text_hover_color:
1787-
description: |
1788-
Define the color of text in the navigation bar when hovered
1789-
version_added: 2.9.0
1790-
type: string
1791-
example: ~
1792-
default: "#51504f"
1793-
x_frame_enabled:
1794-
description: |
1795-
Allow the UI to be rendered in a frame
1796-
version_added: 1.10.8
1797-
type: boolean
1798-
example: ~
1799-
default: "True"
18001765
instance_name:
18011766
description: |
18021767
Sets a custom page title for the DAGs overview page and site title for all pages

airflow-core/src/airflow/configuration.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ def sensitive_config_values(self) -> set[tuple[str, str]]:
358358
("api", "expose_config"): ("webserver", "expose_config", "3.0.1"),
359359
("fab", "access_denied_message"): ("webserver", "access_denied_message", "3.0.2"),
360360
("fab", "expose_hostname"): ("webserver", "expose_hostname", "3.0.2"),
361+
("fab", "navbar_color"): ("webserver", "navbar_color", "3.0.2"),
362+
("fab", "navbar_text_color"): ("webserver", "navbar_text_color", "3.0.2"),
363+
("fab", "navbar_hover_color"): ("webserver", "navbar_hover_color", "3.0.2"),
364+
("fab", "navbar_text_hover_color"): ("webserver", "navbar_text_hover_color", "3.0.2"),
361365
("api", "grid_view_sorting_order"): ("webserver", "grid_view_sorting_order", "3.1.0"),
362366
("api", "log_fetch_timeout_sec"): ("webserver", "log_fetch_timeout_sec", "3.1.0"),
363367
("api", "hide_paused_dags_by_default"): ("webserver", "hide_paused_dags_by_default", "3.1.0"),

airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6002,22 +6002,6 @@ export const $BaseNodeResponse = {
60026002

60036003
export const $ConfigResponse = {
60046004
properties: {
6005-
navbar_color: {
6006-
type: "string",
6007-
title: "Navbar Color",
6008-
},
6009-
navbar_text_color: {
6010-
type: "string",
6011-
title: "Navbar Text Color",
6012-
},
6013-
navbar_hover_color: {
6014-
type: "string",
6015-
title: "Navbar Hover Color",
6016-
},
6017-
navbar_text_hover_color: {
6018-
type: "string",
6019-
title: "Navbar Text Hover Color",
6020-
},
60216005
page_size: {
60226006
type: "integer",
60236007
title: "Page Size",
@@ -6083,10 +6067,6 @@ export const $ConfigResponse = {
60836067
},
60846068
type: "object",
60856069
required: [
6086-
"navbar_color",
6087-
"navbar_text_color",
6088-
"navbar_hover_color",
6089-
"navbar_text_hover_color",
60906070
"page_size",
60916071
"auto_refresh_interval",
60926072
"hide_paused_dags_by_default",

airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,10 +1496,6 @@ export type type =
14961496
* configuration serializer.
14971497
*/
14981498
export type ConfigResponse = {
1499-
navbar_color: string;
1500-
navbar_text_color: string;
1501-
navbar_hover_color: string;
1502-
navbar_text_hover_color: string;
15031499
page_size: number;
15041500
auto_refresh_interval: number;
15051501
hide_paused_dags_by_default: boolean;

airflow-core/src/airflow/ui/src/mocks/handlers/config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ export const handlers: Array<HttpHandler> = [
2828
enable_swagger_ui: true,
2929
hide_paused_dags_by_default: false,
3030
instance_name: "Airflow",
31-
navbar_color: "#fff",
32-
navbar_hover_color: "#eee",
33-
navbar_text_color: "#51504f",
34-
navbar_text_hover_color: "#51504f",
3531
page_size: 15,
3632
require_confirmation_dag_change: false,
3733
test_connection: "Disabled",

airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_config.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
pytestmark = pytest.mark.db_test
2424

2525
mock_config_response = {
26-
"navbar_color": "#fff",
27-
"navbar_text_color": "#51504f",
28-
"navbar_hover_color": "#eee",
29-
"navbar_text_hover_color": "#51504f",
3026
"page_size": 100,
3127
"auto_refresh_interval": 3,
3228
"hide_paused_dags_by_default": True,
@@ -50,12 +46,7 @@ def mock_config_data():
5046
"""
5147
with conf_vars(
5248
{
53-
("webserver", "navbar_color"): "#fff",
54-
("webserver", "navbar_text_color"): "#51504f",
55-
("webserver", "navbar_hover_color"): "#eee",
56-
("webserver", "navbar_text_hover_color"): "#51504f",
5749
("webserver", "instance_name"): "Airflow",
58-
("webserver", "instance_name_has_markup"): "false",
5950
("webserver", "enable_swagger_ui"): "true",
6051
("api", "hide_paused_dags_by_default"): "true",
6152
("api", "page_size"): "100",

0 commit comments

Comments
 (0)