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

potiuk pushed a commit to branch v2-9-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 4f0c15ca3296bc376bfb526a3e2da5d36d2e427a
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Thu Apr 4 15:14:46 2024 +0200

    Unhide CI instructions when dependencies need regeneration (#38748)
    
    The instructions on what to do was hidden in a folded group and we
    need to make sure it is printed straight in the output.
    
    Also we should not print the nasty traceback, as it is not very
    useul, the failing python command already prints appropriate
    error/informational messages and there is no need to clutter the
    output with the traceback when the command fails.
    
    (cherry picked from commit 6172b44218f168f3dca8e65207a2e25202aa9eee)
---
 dev/breeze/src/airflow_breeze/utils/md5_build_check.py            | 5 ++++-
 scripts/ci/pre_commit/pre_commit_update_providers_dependencies.py | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/dev/breeze/src/airflow_breeze/utils/md5_build_check.py 
b/dev/breeze/src/airflow_breeze/utils/md5_build_check.py
index 9475461812..7f2758b15b 100644
--- a/dev/breeze/src/airflow_breeze/utils/md5_build_check.py
+++ b/dev/breeze/src/airflow_breeze/utils/md5_build_check.py
@@ -114,7 +114,7 @@ def calculate_md5_checksum_for_files(
                     ]
                 )
             # Regenerate provider_dependencies.json
-            run_command(
+            result = run_command(
                 [
                     sys.executable,
                     os.fspath(
@@ -126,7 +126,10 @@ def calculate_md5_checksum_for_files(
                     ),
                 ],
                 cwd=AIRFLOW_SOURCES_ROOT,
+                check=False,
             )
+            if result.returncode != 0:
+                sys.exit(result.returncode)
     for file in FILES_FOR_REBUILD_CHECK:
         is_modified = check_md5_sum_for_file(file, md5sum_cache_dir, update)
         if is_modified:
diff --git a/scripts/ci/pre_commit/pre_commit_update_providers_dependencies.py 
b/scripts/ci/pre_commit/pre_commit_update_providers_dependencies.py
index ca1d36aed2..c65aac81b1 100755
--- a/scripts/ci/pre_commit/pre_commit_update_providers_dependencies.py
+++ b/scripts/ci/pre_commit/pre_commit_update_providers_dependencies.py
@@ -227,6 +227,8 @@ if __name__ == "__main__":
     DEPENDENCIES_JSON_FILE_PATH.write_text(new_content)
     if new_content != old_content:
         if os.environ.get("CI"):
+            # make sure the message is printed outside the folded section
+            console.print("::endgroup::")
             console.print()
             console.print(f"There is a need to regenerate 
{DEPENDENCIES_JSON_FILE_PATH}")
             console.print(

Reply via email to