This is an automated email from the ASF dual-hosted git repository.

shahar1 pushed a commit to branch airflow-ctl/v0-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/airflow-ctl/v0-1-test by this 
push:
     new 33f7f3c5b1e [airflow-ctl/v0-1-test] Flag deprecated 
expose_config=non-sensitive-only in config lint (#72507) (#76049)
33f7f3c5b1e is described below

commit 33f7f3c5b1e16eacde311bb57a19023585fc221c
Author: Shahar Epstein <[email protected]>
AuthorDate: Fri Oct 30 18:00:03 2026 +0200

    [airflow-ctl/v0-1-test] Flag deprecated expose_config=non-sensitive-only in 
config lint (#72507) (#76049)
    
    Only the airflow-ctl/ part is backported; the airflow-core change does not 
ship from this branch.
    
    (cherry picked from commit 688dff54a085e2a5d22eb3c1d8460252a8a2c5d6)
    
    Co-authored-by: PoAn Yang <[email protected]>
---
 .../src/airflowctl/ctl/commands/config_command.py  |  7 ++++
 .../ctl/commands/test_config_command.py            | 37 ++++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/airflow-ctl/src/airflowctl/ctl/commands/config_command.py 
b/airflow-ctl/src/airflowctl/ctl/commands/config_command.py
index 8d93d0393de..30d77d1b298 100644
--- a/airflow-ctl/src/airflowctl/ctl/commands/config_command.py
+++ b/airflow-ctl/src/airflowctl/ctl/commands/config_command.py
@@ -259,6 +259,13 @@ CONFIGS_CHANGES = [
         config=ConfigParameter("api", "auth_backends"),
         renamed_to=ConfigParameter("fab", "auth_backends"),
     ),
+    ConfigChange(
+        config=ConfigParameter("api", "expose_config"),
+        was_removed=False,
+        is_invalid_if="non-sensitive-only",
+        suggestion="This value is deprecated and treated as `True`. Set 
`expose_config` to `True` instead; "
+        "sensitive configuration values are always masked.",
+    ),
     # logging
     ConfigChange(
         config=ConfigParameter("logging", "enable_task_context_logger"),
diff --git a/airflow-ctl/tests/airflow_ctl/ctl/commands/test_config_command.py 
b/airflow-ctl/tests/airflow_ctl/ctl/commands/test_config_command.py
index 42f8d073c5d..d7b7662e4ce 100644
--- a/airflow-ctl/tests/airflow_ctl/ctl/commands/test_config_command.py
+++ b/airflow-ctl/tests/airflow_ctl/ctl/commands/test_config_command.py
@@ -419,6 +419,43 @@ class TestCliConfigCommands:
             in calls[1]
         )
 
+    @pytest.mark.parametrize(
+        ("expose_config", "expect_issue"),
+        [
+            pytest.param("non-sensitive-only", True, id="deprecated-value"),
+            pytest.param("True", False, id="boolean-value"),
+        ],
+    )
+    @patch("rich.print")
+    def test_lint_detects_deprecated_expose_config_value(
+        self, mock_rich_print, expose_config, expect_issue, api_client_maker
+    ):
+        response_config = Config(
+            sections=[
+                ConfigSection(
+                    name="api",
+                    options=[ConfigOption(key="expose_config", 
value=expose_config)],
+                )
+            ]
+        )
+
+        api_client = api_client_maker(
+            path="/api/v2/config",
+            response_json=response_config.model_dump(),
+            expected_http_status_code=200,
+            kind=ClientKind.CLI,
+        )
+
+        config_command.lint(
+            self.parser.parse_args(["config", "lint"]),
+            api_client=api_client,
+        )
+
+        calls = [call[0][0] for call in mock_rich_print.call_args_list]
+        expected_message = "Invalid value `non-sensitive-only` set for 
`expose_config` configuration parameter in `api` section."
+
+        assert any(expected_message in call for call in calls) is expect_issue
+
     @patch("airflowctl.api.client.Credentials.load")
     @patch.dict(os.environ, {"AIRFLOW_CLI_TOKEN": "TEST_TOKEN"})
     @patch.dict(os.environ, {"AIRFLOW_CLI_ENVIRONMENT": "TEST_CONFIG"})

Reply via email to