You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2023/10/15 17:25:07 UTC

[airflow] branch main updated: Clean local tags in tag_providers for network issues with Github (#34951)

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 1e9c807ed7 Clean local tags in tag_providers for network issues with Github (#34951)
1e9c807ed7 is described below

commit 1e9c807ed7752d2ec52b6dcd6451d1ff4e548021
Author: Amogh Desai <am...@gmail.com>
AuthorDate: Sun Oct 15 22:54:59 2023 +0530

    Clean local tags in tag_providers for network issues with Github (#34951)
---
 dev/README_RELEASE_PROVIDER_PACKAGES.md | 10 ++++++++++
 dev/provider_packages/tag_providers.sh  | 14 +++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/dev/README_RELEASE_PROVIDER_PACKAGES.md b/dev/README_RELEASE_PROVIDER_PACKAGES.md
index b0da6192f3..e7c10366bc 100644
--- a/dev/README_RELEASE_PROVIDER_PACKAGES.md
+++ b/dev/README_RELEASE_PROVIDER_PACKAGES.md
@@ -311,6 +311,11 @@ twine upload -r pypi ${AIRFLOW_REPO_ROOT}/dist/*
 Assume that your remote for apache repository is called `apache` you should now
 set tags for the providers in the repo.
 
+Sometimes in cases when there is a connectivity issue to Github, it might be possible that local tags get created
+and lead to annoying errors. The default behaviour would be to clean such local tags up.
+
+If you want to disable this behaviour, set the env **CLEAN_LOCAL_TAGS** to false.
+
 ```shell script
 ./dev/provider_packages/tag_providers.sh
 ```
@@ -953,6 +958,11 @@ If you decided to remove some packages from the release make sure to do amend th
 Assume that your remote for apache repository is called `apache` you should now
 set tags for the providers in the repo.
 
+Sometimes in cases when there is a connectivity issue to Github, it might be possible that local tags get created
+and lead to annoying errors. The default behaviour would be to clean such local tags up.
+
+If you want to disable this behaviour, set the env **CLEAN_LOCAL_TAGS** to false.
+
 ```shell script
 ./dev/provider_packages/tag_providers.sh
 ```
diff --git a/dev/provider_packages/tag_providers.sh b/dev/provider_packages/tag_providers.sh
index 9a115c3ea0..19a8d17f59 100755
--- a/dev/provider_packages/tag_providers.sh
+++ b/dev/provider_packages/tag_providers.sh
@@ -35,6 +35,18 @@ do
     { git tag "${tag}" -m "Release $(date '+%Y-%m-%d') of providers" && tags+=("$tag") ; } || true
    fi
 done
+
 if [[ -n "${tags:-}" && "${#tags}" -gt 0 ]]; then
-   git push $remote "${tags[@]}"
+   if git push $remote "${tags[@]}"; then
+       echo "Tags pushed successfully"
+   else
+       echo "Failed to push tags, probably a connectivity issue to Github"
+       CLEAN_LOCAL_TAGS="${CLEAN_LOCAL_TAGS:-true}"
+       if [[ "$CLEAN_LOCAL_TAGS" == "true" ]]; then
+           echo "Cleaning up local tags..."
+           git tag -d "${tags[@]}"
+       else
+           echo "Local tags are not cleaned up, unset CLEAN_LOCAL_TAGS or set to true"
+       fi
+   fi
 fi