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 1aaf206c64 Make tag fetching when preparing providers optional.
(#25236)
1aaf206c64 is described below
commit 1aaf206c6429d8b39cbfd381f6258e41a31767c4
Author: Jarek Potiuk <[email protected]>
AuthorDate: Fri Jul 22 21:02:56 2022 +0200
Make tag fetching when preparing providers optional. (#25236)
* 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.
* Update dev/provider_packages/prepare_provider_packages.py
Co-authored-by: Josh Fell <[email protected]>
Co-authored-by: Josh Fell <[email protected]>
---
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 29d565e33c..e87a117350 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(