From 380f03aeda3f4157b6b2aeb3255d3be7a62ee700 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sun, 11 Feb 2024 10:49:39 +0100 Subject: [PATCH] Add better diagnostics when provider.yaml check fails (#37322) (cherry picked from commit 5ee75fb19c611531a8239c63f93edb6ce8311e21) --- .../ci/pre_commit/pre_commit_check_provider_yaml_files.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py b/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py index 7c934c60fb2d6..fcbe2512910a3 100755 --- a/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py +++ b/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py @@ -17,6 +17,7 @@ # under the License. from __future__ import annotations +import os import sys from pathlib import Path @@ -32,9 +33,10 @@ warn_image_upgrade_needed=True, extra_env={"PYTHONWARNINGS": "default"}, ) -if cmd_result.returncode != 0: +if cmd_result.returncode != 0 and os.environ.get("CI") != "true": console.print( - "[warning]\nIf you see strange stacktraces above, " - "run `breeze ci-image build --python 3.8` and try again." + "\n[yellow]If you see strange stacktraces above, especially about missing imports " + "run this command:[/]\n" ) + console.print("[magenta]breeze ci-image build --python 3.8 --upgrade-to-newer-dependencies[/]\n") sys.exit(cmd_result.returncode)