Skip to content

Commit c8325f6

Browse files
Move webserver config to fab provider (apache#50774)
* Move webserver navbar config to fab provider * Remove x_frame_enabled config (cherry picked from commit 649309e)
1 parent cc80c66 commit c8325f6

File tree

21 files changed

+94
-140
lines changed

21 files changed

+94
-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
@@ -728,18 +728,6 @@ components:
728728
description: Base Node serializer for responses.
729729
ConfigResponse:
730730
properties:
731-
navbar_color:
732-
type: string
733-
title: Navbar Color
734-
navbar_text_color:
735-
type: string
736-
title: Navbar Text Color
737-
navbar_hover_color:
738-
type: string
739-
title: Navbar Hover Color
740-
navbar_text_hover_color:
741-
type: string
742-
title: Navbar Text Hover Color
743731
page_size:
744732
type: integer
745733
title: Page Size
@@ -783,10 +771,6 @@ components:
783771
title: Dashboard Alert
784772
type: object
785773
required:
786-
- navbar_color
787-
- navbar_text_color
788-
- navbar_hover_color
789-
- navbar_text_hover_color
790774
- page_size
791775
- auto_refresh_interval
792776
- 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
@@ -30,7 +30,6 @@
3030
config_router = AirflowRouter(tags=["Config"])
3131

3232
WEBSERVER_CONFIG_KEYS = [
33-
"navbar_color",
3433
"page_size",
3534
"auto_refresh_interval",
3635
"hide_paused_dags_by_default",
@@ -39,9 +38,6 @@
3938
"require_confirmation_dag_change",
4039
"enable_swagger_ui",
4140
"instance_name_has_markup",
42-
"navbar_text_color",
43-
"navbar_hover_color",
44-
"navbar_text_hover_color",
4541
]
4642

4743

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
@@ -1771,48 +1771,13 @@ webserver:
17711771
type: string
17721772
example: ~
17731773
default: "50"
1774-
navbar_color:
1775-
description: |
1776-
Define the color of navigation bar
1777-
version_added: ~
1778-
type: string
1779-
example: ~
1780-
default: "#fff"
1781-
navbar_text_color:
1782-
description: |
1783-
Define the color of text in the navigation bar
1784-
version_added: 2.8.0
1785-
type: string
1786-
example: ~
1787-
default: "#51504f"
1788-
navbar_hover_color:
1789-
description: |
1790-
Define the color of navigation bar links when hovered
1791-
version_added: 2.9.0
1792-
type: string
1793-
example: ~
1794-
default: "#eee"
1795-
navbar_text_hover_color:
1796-
description: |
1797-
Define the color of text in the navigation bar when hovered
1798-
version_added: 2.9.0
1799-
type: string
1800-
example: ~
1801-
default: "#51504f"
18021774
default_wrap:
18031775
description: |
18041776
Default setting for wrap toggle on DAG code and TI log views.
18051777
version_added: 1.10.4
18061778
type: boolean
18071779
example: ~
18081780
default: "False"
1809-
x_frame_enabled:
1810-
description: |
1811-
Allow the UI to be rendered in a frame
1812-
version_added: 1.10.8
1813-
type: boolean
1814-
example: ~
1815-
default: "True"
18161781
instance_name:
18171782
description: |
18181783
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
}
362366

363367
# A mapping of new section -> (old section, since_version).

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
@@ -5786,22 +5786,6 @@ export const $BaseNodeResponse = {
57865786

57875787
export const $ConfigResponse = {
57885788
properties: {
5789-
navbar_color: {
5790-
type: "string",
5791-
title: "Navbar Color",
5792-
},
5793-
navbar_text_color: {
5794-
type: "string",
5795-
title: "Navbar Text Color",
5796-
},
5797-
navbar_hover_color: {
5798-
type: "string",
5799-
title: "Navbar Hover Color",
5800-
},
5801-
navbar_text_hover_color: {
5802-
type: "string",
5803-
title: "Navbar Text Hover Color",
5804-
},
58055789
page_size: {
58065790
type: "integer",
58075791
title: "Page Size",
@@ -5860,10 +5844,6 @@ export const $ConfigResponse = {
58605844
},
58615845
type: "object",
58625846
required: [
5863-
"navbar_color",
5864-
"navbar_text_color",
5865-
"navbar_hover_color",
5866-
"navbar_text_hover_color",
58675847
"page_size",
58685848
"auto_refresh_interval",
58695849
"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
@@ -1449,10 +1449,6 @@ export type type =
14491449
* configuration serializer.
14501450
*/
14511451
export type ConfigResponse = {
1452-
navbar_color: string;
1453-
navbar_text_color: string;
1454-
navbar_hover_color: string;
1455-
navbar_text_hover_color: string;
14561452
page_size: number;
14571453
auto_refresh_interval: number;
14581454
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
@@ -29,10 +29,6 @@ export const handlers: Array<HttpHandler> = [
2929
hide_paused_dags_by_default: false,
3030
instance_name: "Airflow",
3131
instance_name_has_markup: false,
32-
navbar_color: "#fff",
33-
navbar_hover_color: "#eee",
34-
navbar_text_color: "#51504f",
35-
navbar_text_hover_color: "#51504f",
3632
page_size: 15,
3733
require_confirmation_dag_change: false,
3834
test_connection: "Disabled",

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

Lines changed: 0 additions & 8 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": False,
@@ -51,10 +47,6 @@ def mock_config_data():
5147
with patch("airflow.configuration.conf.as_dict") as mock_conf:
5248
mock_conf.return_value = {
5349
"webserver": {
54-
"navbar_color": "#fff",
55-
"navbar_text_color": "#51504f",
56-
"navbar_hover_color": "#eee",
57-
"navbar_text_hover_color": "#51504f",
5850
"page_size": "100",
5951
"auto_refresh_interval": "3",
6052
"hide_paused_dags_by_default": "false",

0 commit comments

Comments
 (0)