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

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 4db39e4d7ea Fix breeze ci_group crash when the title is skipped in 
GitHub Actions (#75401)
4db39e4d7ea is described below

commit 4db39e4d7ea453fe85c2df99bf5bf9cfa45fa216
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Oct 22 16:03:11 2026 +0200

    Fix breeze ci_group crash when the title is skipped in GitHub Actions 
(#75401)
    
    The provider requirement-table regeneration step of breeze ci upgrade runs 
prepare-provider-documentation with the title skipped. Under GitHub Actions the 
group never yielded, so the step died with 'generator didn't yield' and the 
upgrade PR shipped stale provider docs/index.rst files that failed static 
checks.
    
    Generated-by: Claude Opus 5
---
 dev/breeze/src/airflow_breeze/utils/ci_group.py | 22 +++++++-------
 dev/breeze/tests/test_ci_group.py               | 40 +++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 10 deletions(-)

diff --git a/dev/breeze/src/airflow_breeze/utils/ci_group.py 
b/dev/breeze/src/airflow_breeze/utils/ci_group.py
index b33758af6a2..6cdf1da4569 100644
--- a/dev/breeze/src/airflow_breeze/utils/ci_group.py
+++ b/dev/breeze/src/airflow_breeze/utils/ci_group.py
@@ -59,14 +59,16 @@ def ci_group(
                 get_console(output=output).print(f"\n{title}\n")
         yield
         return
+    if skip_printing_title:
+        yield
+        return
     setattr(ci_group, "__in_ci_group__", True)
-    if not skip_printing_title:
-        if message_type is not None:
-            console_print(f"::group::[{message_type.value}]{title}[/]")
-        else:
-            console_print(f"::group::{title}")
-        try:
-            yield
-        finally:
-            console_print("::endgroup::")
-            setattr(ci_group, "__in_ci_group__", False)
+    if message_type is not None:
+        console_print(f"::group::[{message_type.value}]{title}[/]")
+    else:
+        console_print(f"::group::{title}")
+    try:
+        yield
+    finally:
+        console_print("::endgroup::")
+        setattr(ci_group, "__in_ci_group__", False)
diff --git a/dev/breeze/tests/test_ci_group.py 
b/dev/breeze/tests/test_ci_group.py
new file mode 100644
index 00000000000..2c261a741a9
--- /dev/null
+++ b/dev/breeze/tests/test_ci_group.py
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from unittest import mock
+
+import pytest
+
+from airflow_breeze.utils.ci_group import ci_group
+
+
[email protected]
+def in_github_actions(monkeypatch):
+    monkeypatch.setenv("GITHUB_ACTIONS", "true")
+    monkeypatch.delenv("SKIP_GROUP_OUTPUT", raising=False)
+
+
[email protected]("in_github_actions")
[email protected]("airflow_breeze.utils.ci_group.console_print", autospec=True)
+def 
test_ci_group_without_title_runs_body_in_github_actions(mock_console_print):
+    body = mock.Mock()
+    with ci_group("title", skip_printing_title=True):
+        body()
+    body.assert_called_once()
+    mock_console_print.assert_not_called()
+    assert not getattr(ci_group, "__in_ci_group__", False)

Reply via email to