This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch v2-9-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit be98e4593cbb4dd01acf0b89320db168fddd5227 Author: Jarek Potiuk <ja...@potiuk.com> AuthorDate: Wed Apr 3 16:30:10 2024 +0200 Fix few nits in tag-providers command (#38705) Few small changes after checking the tag-providers command: * removed capturing output when pushing tags - this way we see what we pushed * removed command variables * better array concatenation with unpacking * removed shlex.quote (cherry picked from commit 0c07142eeff38f370032624fd887c135667cccd3) --- .../commands/release_management_commands.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py index b714c01103..1e0ce26daf 100644 --- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py @@ -21,7 +21,6 @@ import operator import os import random import re -import shlex import shutil import subprocess import sys @@ -972,8 +971,12 @@ def tag_providers( remotes = ["origin", "apache"] for remote in remotes: try: - command = ["git", "remote", "get-url", "--push", shlex.quote(remote)] - result = run_command(command, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True) + result = run_command( + ["git", "remote", "get-url", "--push", remote], + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL, + text=True, + ) if "apache/airflow.git" in result.stdout: found_remote = remote break @@ -992,7 +995,7 @@ def tag_providers( tag = f"{provider}/{match.group(2)}" try: run_command( - ["git", "tag", shlex.quote(tag), "-m", f"Release {date.today()} of providers"], + ["git", "tag", tag, "-m", f"Release {date.today()} of providers"], check=True, ) tags.append(tag) @@ -1001,11 +1004,8 @@ def tag_providers( if tags: try: - push_command = ["git", "push", remote] + [shlex.quote(tag) for tag in tags] push_result = run_command( - push_command, - text=True, - capture_output=True, + ["git", "push", found_remote, *tags], check=False, ) if push_result.returncode == 0: @@ -1015,7 +1015,7 @@ def tag_providers( if clean_local_tags: for tag in tags: try: - run_command(["git", "tag", "-d", shlex.quote(tag)], check=True) + run_command(["git", "tag", "-d", tag], check=True) except subprocess.CalledProcessError: pass get_console().print("\n[success]Cleaning up local tags...[/]")