Skip to content

Commit 3f95300

Browse files
pierrejeambrunsanederchik
authored andcommitted
Move or delete remaining webserver config options (apache#50899)
1 parent a2e0e20 commit 3f95300

File tree

10 files changed

+20
-58
lines changed

10 files changed

+20
-58
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class ConfigResponse(BaseModel):
3131
enable_swagger_ui: bool
3232
require_confirmation_dag_change: bool
3333
default_wrap: bool
34-
audit_view_excluded_events: str
35-
audit_view_included_events: str
3634
test_connection: str
3735
dashboard_alert: list[UIAlert]
3836
show_external_log_redirect: bool

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -761,12 +761,6 @@ components:
761761
default_wrap:
762762
type: boolean
763763
title: Default Wrap
764-
audit_view_excluded_events:
765-
type: string
766-
title: Audit View Excluded Events
767-
audit_view_included_events:
768-
type: string
769-
title: Audit View Included Events
770764
test_connection:
771765
type: string
772766
title: Test Connection
@@ -792,8 +786,6 @@ components:
792786
- enable_swagger_ui
793787
- require_confirmation_dag_change
794788
- default_wrap
795-
- audit_view_excluded_events
796-
- audit_view_included_events
797789
- test_connection
798790
- dashboard_alert
799791
- show_external_log_redirect

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ def get_configs() -> ConfigResponse:
5252

5353
task_log_reader = TaskLogReader()
5454
additional_config: dict[str, Any] = {
55-
"instance_name": conf.get("webserver", "instance_name", fallback="Airflow"),
56-
"audit_view_included_events": conf.get("webserver", "audit_view_included_events", fallback=""),
57-
"audit_view_excluded_events": conf.get("webserver", "audit_view_excluded_events", fallback=""),
55+
"instance_name": conf.get("api", "instance_name", fallback="Airflow"),
5856
"test_connection": conf.get("core", "test_connection", fallback="Disabled"),
5957
"dashboard_alert": DASHBOARD_UIALERTS,
6058
"show_external_log_redirect": task_log_reader.supports_external_link,

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,16 @@ def message(self) -> str | None:
346346
ConfigChange(
347347
config=ConfigParameter("webserver", "cookie_samesite"),
348348
),
349+
ConfigChange(
350+
config=ConfigParameter("webserver", "audit_view_included_events"),
351+
),
352+
ConfigChange(
353+
config=ConfigParameter("webserver", "audit_view_excluded_events"),
354+
),
355+
ConfigChange(
356+
config=ConfigParameter("webserver", "instance_name"),
357+
renamed_to=ConfigParameter("api", "instance_name"),
358+
),
349359
ConfigChange(
350360
config=ConfigParameter("webserver", "update_fab_perms"),
351361
renamed_to=ConfigParameter("fab", "update_fab_perms"),

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

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,13 @@ secrets:
12841284
api:
12851285
description: ~
12861286
options:
1287+
instance_name:
1288+
description: |
1289+
Sets a custom page title for the DAGs overview page and site title for all pages
1290+
version_added: 2.1.0
1291+
type: string
1292+
example: ~
1293+
default:
12871294
enable_swagger_ui:
12881295
description: |
12891296
Boolean for running SwaggerUI in the webserver.
@@ -1766,34 +1773,6 @@ operators:
17661773
type: string
17671774
example: ~
17681775
default: "default"
1769-
webserver:
1770-
description: ~
1771-
options:
1772-
instance_name:
1773-
description: |
1774-
Sets a custom page title for the DAGs overview page and site title for all pages
1775-
version_added: 2.1.0
1776-
type: string
1777-
example: ~
1778-
default:
1779-
audit_view_excluded_events:
1780-
description: |
1781-
Comma separated string of view events to exclude from dag audit view.
1782-
All other events will be added minus the ones passed here.
1783-
The audit logs in the db will not be affected by this parameter.
1784-
version_added: 2.3.0
1785-
type: string
1786-
example: "cli_task_run,running,success"
1787-
default: ~
1788-
audit_view_included_events:
1789-
description: |
1790-
Comma separated string of view events to include in dag audit view.
1791-
If passed, only these events will populate the dag audit view.
1792-
The audit logs in the db will not be affected by this parameter.
1793-
version_added: 2.3.0
1794-
type: string
1795-
example: "dagrun_cleared,failed"
1796-
default: ~
17971776
email:
17981777
description: |
17991778
Configuration email backend and whether to

airflow-core/src/airflow/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]:
371371
("api", "default_wrap"): ("webserver", "default_wrap", "3.1.0"),
372372
("api", "auto_refresh_interval"): ("webserver", "auto_refresh_interval", "3.1.0"),
373373
("api", "require_confirmation_dag_change"): ("webserver", "require_confirmation_dag_change", "3.1.0"),
374+
("api", "instance_name"): ("webserver", "instance_name", "3.1.0"),
374375
}
375376

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

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6030,14 +6030,6 @@ export const $ConfigResponse = {
60306030
type: "boolean",
60316031
title: "Default Wrap",
60326032
},
6033-
audit_view_excluded_events: {
6034-
type: "string",
6035-
title: "Audit View Excluded Events",
6036-
},
6037-
audit_view_included_events: {
6038-
type: "string",
6039-
title: "Audit View Included Events",
6040-
},
60416033
test_connection: {
60426034
type: "string",
60436035
title: "Test Connection",
@@ -6074,8 +6066,6 @@ export const $ConfigResponse = {
60746066
"enable_swagger_ui",
60756067
"require_confirmation_dag_change",
60766068
"default_wrap",
6077-
"audit_view_excluded_events",
6078-
"audit_view_included_events",
60796069
"test_connection",
60806070
"dashboard_alert",
60816071
"show_external_log_redirect",

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,8 +1503,6 @@ export type ConfigResponse = {
15031503
enable_swagger_ui: boolean;
15041504
require_confirmation_dag_change: boolean;
15051505
default_wrap: boolean;
1506-
audit_view_excluded_events: string;
1507-
audit_view_included_events: string;
15081506
test_connection: string;
15091507
dashboard_alert: Array<UIAlert>;
15101508
show_external_log_redirect: boolean;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import { http, HttpResponse, type HttpHandler } from "msw";
2121
export const handlers: Array<HttpHandler> = [
2222
http.get("/ui/config", () =>
2323
HttpResponse.json({
24-
audit_view_excluded_events: "gantt,landing_times,tries,duration,calendar,graph,grid,tree,tree_data",
25-
audit_view_included_events: "",
2624
auto_refresh_interval: 3,
2725
default_wrap: false,
2826
enable_swagger_ui: true,

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
"enable_swagger_ui": True,
3131
"require_confirmation_dag_change": False,
3232
"default_wrap": False,
33-
"audit_view_excluded_events": "",
34-
"audit_view_included_events": "",
3533
"test_connection": "Disabled",
3634
"dashboard_alert": [],
3735
"show_external_log_redirect": False,
@@ -46,7 +44,7 @@ def mock_config_data():
4644
"""
4745
with conf_vars(
4846
{
49-
("webserver", "instance_name"): "Airflow",
47+
("api", "instance_name"): "Airflow",
5048
("api", "enable_swagger_ui"): "true",
5149
("api", "hide_paused_dags_by_default"): "true",
5250
("api", "page_size"): "100",

0 commit comments

Comments
 (0)