You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vandonr-amz (via GitHub)" <gi...@apache.org> on 2023/02/22 20:02:44 UTC

[GitHub] [airflow] vandonr-amz commented on a diff in pull request #29705: Propose to upgrade to newer dependencies in case build CI image fail

vandonr-amz commented on code in PR #29705:
URL: https://github.com/apache/airflow/pull/29705#discussion_r1114893673


##########
dev/breeze/src/airflow_breeze/commands/ci_image_commands.py:
##########
@@ -504,24 +504,29 @@ def run_build_ci_image(
                 check=False,
                 output=output,
             )
-            if (
-                build_command_result.returncode != 0
-                and ci_image_params.upgrade_on_failure
-                and not ci_image_params.upgrade_to_newer_dependencies
-            ):
-                ci_image_params.upgrade_to_newer_dependencies = True
-                get_console().print(
-                    "[warning]Attempting to build with upgrade_to_newer_dependencies on failure"
-                )
-                build_command_result = run_command(
-                    prepare_docker_build_command(
-                        image_params=ci_image_params,
-                    ),
-                    cwd=AIRFLOW_SOURCES_ROOT,
-                    text=True,
-                    check=False,
-                    output=output,
-                )
+            if build_command_result.returncode != 0 and not ci_image_params.upgrade_to_newer_dependencies:
+                if ci_image_params.upgrade_on_failure:
+                    ci_image_params.upgrade_to_newer_dependencies = True
+                    get_console().print(
+                        "[warning]Attempting to build with upgrade_to_newer_dependencies on failure"
+                    )
+                    build_command_result = run_command(
+                        prepare_docker_build_command(
+                            image_params=ci_image_params,
+                        ),
+                        cwd=AIRFLOW_SOURCES_ROOT,
+                        text=True,
+                        check=False,
+                        output=output,
+                    )
+                else:
+                    get_console().print(
+                        "[warning]Your image build failure. It could be caused by conflicting dependencies."

Review Comment:
   ```suggestion
                           "[warning]Your image build failed. It could be caused by conflicting dependencies."
   ```



##########
dev/breeze/src/airflow_breeze/commands/ci_image_commands.py:
##########
@@ -504,24 +504,29 @@ def run_build_ci_image(
                 check=False,
                 output=output,
             )
-            if (
-                build_command_result.returncode != 0
-                and ci_image_params.upgrade_on_failure
-                and not ci_image_params.upgrade_to_newer_dependencies
-            ):
-                ci_image_params.upgrade_to_newer_dependencies = True
-                get_console().print(
-                    "[warning]Attempting to build with upgrade_to_newer_dependencies on failure"
-                )
-                build_command_result = run_command(
-                    prepare_docker_build_command(
-                        image_params=ci_image_params,
-                    ),
-                    cwd=AIRFLOW_SOURCES_ROOT,
-                    text=True,
-                    check=False,
-                    output=output,
-                )
+            if build_command_result.returncode != 0 and not ci_image_params.upgrade_to_newer_dependencies:
+                if ci_image_params.upgrade_on_failure:
+                    ci_image_params.upgrade_to_newer_dependencies = True
+                    get_console().print(
+                        "[warning]Attempting to build with upgrade_to_newer_dependencies on failure"
+                    )
+                    build_command_result = run_command(
+                        prepare_docker_build_command(
+                            image_params=ci_image_params,
+                        ),
+                        cwd=AIRFLOW_SOURCES_ROOT,
+                        text=True,
+                        check=False,
+                        output=output,
+                    )
+                else:
+                    get_console().print(
+                        "[warning]Your image build failure. It could be caused by conflicting dependencies."
+                    )
+                    get_console().print(
+                        "[info]Run "
+                        "`breeze ci-image build --upgrade-to-newer-dependencies` to upgrade them.\n."

Review Comment:
   ```suggestion
                           "`breeze ci-image build --upgrade-to-newer-dependencies` to upgrade them.\n"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org