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 d04aed031bed6..5644f49e0cfa2 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 @@ -31,8 +31,6 @@ class ConfigResponse(BaseModel): enable_swagger_ui: bool require_confirmation_dag_change: bool default_wrap: bool - audit_view_excluded_events: str - audit_view_included_events: str test_connection: str dashboard_alert: list[UIAlert] show_external_log_redirect: 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 0e45ca8effb4b..85febe716f641 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 @@ -761,12 +761,6 @@ components: default_wrap: type: boolean title: Default Wrap - audit_view_excluded_events: - type: string - title: Audit View Excluded Events - audit_view_included_events: - type: string - title: Audit View Included Events test_connection: type: string title: Test Connection @@ -792,8 +786,6 @@ components: - enable_swagger_ui - require_confirmation_dag_change - default_wrap - - audit_view_excluded_events - - audit_view_included_events - test_connection - dashboard_alert - show_external_log_redirect 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 4abfe067cb043..f4fe5d5c6658c 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 @@ -52,9 +52,7 @@ def get_configs() -> ConfigResponse: task_log_reader = TaskLogReader() additional_config: dict[str, Any] = { - "instance_name": conf.get("webserver", "instance_name", fallback="Airflow"), - "audit_view_included_events": conf.get("webserver", "audit_view_included_events", fallback=""), - "audit_view_excluded_events": conf.get("webserver", "audit_view_excluded_events", fallback=""), + "instance_name": conf.get("api", "instance_name", fallback="Airflow"), "test_connection": conf.get("core", "test_connection", fallback="Disabled"), "dashboard_alert": DASHBOARD_UIALERTS, "show_external_log_redirect": task_log_reader.supports_external_link, diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index 41f1fe0a7c1de..ab620f3768780 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -346,6 +346,16 @@ def message(self) -> str | None: ConfigChange( config=ConfigParameter("webserver", "cookie_samesite"), ), + ConfigChange( + config=ConfigParameter("webserver", "audit_view_included_events"), + ), + ConfigChange( + config=ConfigParameter("webserver", "audit_view_excluded_events"), + ), + ConfigChange( + config=ConfigParameter("webserver", "instance_name"), + renamed_to=ConfigParameter("api", "instance_name"), + ), ConfigChange( config=ConfigParameter("webserver", "update_fab_perms"), renamed_to=ConfigParameter("fab", "update_fab_perms"), diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index 8adac57d17996..6894c418c9e6e 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -1284,6 +1284,13 @@ secrets: api: description: ~ options: + instance_name: + description: | + Sets a custom page title for the DAGs overview page and site title for all pages + version_added: 2.1.0 + type: string + example: ~ + default: enable_swagger_ui: description: | Boolean for running SwaggerUI in the webserver. @@ -1766,34 +1773,6 @@ operators: type: string example: ~ default: "default" -webserver: - description: ~ - options: - instance_name: - description: | - Sets a custom page title for the DAGs overview page and site title for all pages - version_added: 2.1.0 - type: string - example: ~ - default: - audit_view_excluded_events: - description: | - Comma separated string of view events to exclude from dag audit view. - All other events will be added minus the ones passed here. - The audit logs in the db will not be affected by this parameter. - version_added: 2.3.0 - type: string - example: "cli_task_run,running,success" - default: ~ - audit_view_included_events: - description: | - Comma separated string of view events to include in dag audit view. - If passed, only these events will populate the dag audit view. - The audit logs in the db will not be affected by this parameter. - version_added: 2.3.0 - type: string - example: "dagrun_cleared,failed" - default: ~ 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 bdf642338f57f..a32f119c744a6 100644 --- a/airflow-core/src/airflow/configuration.py +++ b/airflow-core/src/airflow/configuration.py @@ -371,6 +371,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]: ("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"), + ("api", "instance_name"): ("webserver", "instance_name", "3.1.0"), } # A mapping of new section -> (old section, since_version). 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 992b5c7744782..73437f8fc10eb 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 @@ -6030,14 +6030,6 @@ export const $ConfigResponse = { type: "boolean", title: "Default Wrap", }, - audit_view_excluded_events: { - type: "string", - title: "Audit View Excluded Events", - }, - audit_view_included_events: { - type: "string", - title: "Audit View Included Events", - }, test_connection: { type: "string", title: "Test Connection", @@ -6074,8 +6066,6 @@ export const $ConfigResponse = { "enable_swagger_ui", "require_confirmation_dag_change", "default_wrap", - "audit_view_excluded_events", - "audit_view_included_events", "test_connection", "dashboard_alert", "show_external_log_redirect", 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 f02264afe6200..2497c8372d699 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 @@ -1503,8 +1503,6 @@ export type ConfigResponse = { enable_swagger_ui: boolean; require_confirmation_dag_change: boolean; default_wrap: boolean; - audit_view_excluded_events: string; - audit_view_included_events: string; test_connection: string; dashboard_alert: Array; show_external_log_redirect: 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 86dc1c05b4b8b..3caa610c125b5 100644 --- a/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts +++ b/airflow-core/src/airflow/ui/src/mocks/handlers/config.ts @@ -21,8 +21,6 @@ import { http, HttpResponse, type HttpHandler } from "msw"; export const handlers: Array = [ http.get("/ui/config", () => HttpResponse.json({ - audit_view_excluded_events: "gantt,landing_times,tries,duration,calendar,graph,grid,tree,tree_data", - audit_view_included_events: "", auto_refresh_interval: 3, default_wrap: false, enable_swagger_ui: 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 c2f92e3ca443f..e98ad44bb72ad 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 @@ -30,8 +30,6 @@ "enable_swagger_ui": True, "require_confirmation_dag_change": False, "default_wrap": False, - "audit_view_excluded_events": "", - "audit_view_included_events": "", "test_connection": "Disabled", "dashboard_alert": [], "show_external_log_redirect": False, @@ -46,7 +44,7 @@ def mock_config_data(): """ with conf_vars( { - ("webserver", "instance_name"): "Airflow", + ("api", "instance_name"): "Airflow", ("api", "enable_swagger_ui"): "true", ("api", "hide_paused_dags_by_default"): "true", ("api", "page_size"): "100",