From e2977cbdd59d11ca41d346f6f518c061a71bb654 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Fri, 22 Jul 2022 16:39:19 +0200 Subject: [PATCH] Make tag fetching when preparing providers optional. Tag fetching is only needed to make sure we do not generate packages that have already been generated. However this is just an optimisation for CI runs. There is no harm if the tags are not refreshed and we generate the package again locally. Tag fetching might faile in various cases - for example when you are in corporate environment and require specific certificates to be available or when you are working from a worktree. After this change fetching tag will produce warning when there is an error and instruction on how you can fetch tags manually. --- dev/provider_packages/prepare_provider_packages.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dev/provider_packages/prepare_provider_packages.py b/dev/provider_packages/prepare_provider_packages.py index 29d565e33c5af..289875b9a070c 100755 --- a/dev/provider_packages/prepare_provider_packages.py +++ b/dev/provider_packages/prepare_provider_packages.py @@ -710,10 +710,16 @@ def make_sure_remote_apache_exists_and_fetch(git_update: bool, verbose: bool): fetch_command.append("--unshallow") if verbose: console.print(f"Running command: '{' '.join(fetch_command)}'") - subprocess.check_call( - fetch_command, - stderr=subprocess.DEVNULL, - ) + try: + subprocess.check_call( + fetch_command, + ) + except subprocess.CalledProcessError as e: + console.print( + '[yellow]Error when fetching tags from remote. Your tags might not be refreshed. ' + f'please refresh the tags manually via {" ".join(fetch_command)}\n' + ) + console.print(f'[yellow]The error was: {e}') def get_git_log_command(