From ad2263f464c592c617abc61f5f903fed5f9310a1 Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Fri, 6 Mar 2026 14:45:47 +0100 Subject: [PATCH] Add use existing branch confirmation and progress for file download (#6294) * Add `use existing branch for release` confirmation. Otherwise, this message might go unnoticed and we might build the wrong binaries * Display the progress of downloaded artifacts so we can be sure the process is working --- tools/github/download_github_artifacts.py | 11 ++++++++--- tools/release/release.sh | 10 +++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/github/download_github_artifacts.py b/tools/github/download_github_artifacts.py index 9a8f07bccc..1570216284 100755 --- a/tools/github/download_github_artifacts.py +++ b/tools/github/download_github_artifacts.py @@ -142,9 +142,14 @@ if not args.simulate: # open file to write in binary mode with open(target, "wb") as file: # get request - response = requests.get(url, headers=headers) - # write to file - file.write(response.content) + with requests.get(url, headers=headers, stream=True) as response: + total = int(response.headers.get('Content-Length', 0)) + totalStr = "{0:.2f}".format(total / 1024 / 1024) + for chunk in response.iter_content(chunk_size=65536): + if chunk: # filter out keep-alive new chunks + file.write(chunk) + current = "{0:.2f}".format(file.tell() / 1024 / 1024) + print(f"Downloaded {current}/{totalStr} MB", end="\r") print("Verifying file size...") # get the file size size = os.path.getsize(target) diff --git a/tools/release/release.sh b/tools/release/release.sh index 72829dd8cc..0934e6c714 100755 --- a/tools/release/release.sh +++ b/tools/release/release.sh @@ -131,7 +131,15 @@ git flow release start "${version}" # Note: in case the release is already started and the script is started again, checkout the release branch again. ret=$? if [[ $ret -ne 0 ]]; then - printf "Mmh, it seems that the release is already started. Checking out the release branch...\n" + printf "Mmh, it seems that the release is already started. I'm displaying the changes now:\n" + git diff --stat "release/${version}" origin/main + printf "Do you want to continue the release using its contents?\n\n" + read -r -p "Continue (yes/no) default to yes? " doContinue + doContinue=${doContinue:-yes} + if [ "${doContinue}" == "no" ]; then + printf "OK, exiting, you can start the release again with the command 'git flow release start %s'\n" "${version}" + exit 1 + fi git checkout "release/${version}" fi