Follow up the fix from #44311

This commit is contained in:
Mikhail f. Shiryaev 2023-11-20 11:57:46 +01:00
parent 0eaf83b02e
commit 6da51942eb
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -128,18 +128,16 @@ def check_for_success_run(
version: ClickHouseVersion,
) -> None:
# TODO: Remove after S3 artifacts
# the final empty argument is necessary for distinguish build and build_suffix
logged_prefix = "/".join((S3_BUILDS_BUCKET, s3_prefix, ""))
logging.info("Checking for artifacts in %s", logged_prefix)
logging.info("Checking for artifacts %s in bucket %s", s3_prefix, S3_BUILDS_BUCKET)
try:
# Performance artifacts are now part of regular build, so we're safe
build_results = s3_helper.list_prefix(s3_prefix)
except Exception as ex:
logging.info("Got exception while listing %s: %s\nRerun", logged_prefix, ex)
logging.info("Got exception while listing %s: %s\nRerun", s3_prefix, ex)
return
if build_results is None or len(build_results) == 0:
logging.info("Nothing found in %s, rerun", logged_prefix)
logging.info("Nothing found in %s, rerun", s3_prefix)
return
logging.info("Some build results found:\n%s", build_results)
@ -254,7 +252,9 @@ def main():
# If this is rerun, then we try to find already created artifacts and just
# put them as github actions artifact (result)
check_for_success_run(s3_helper, s3_path_prefix, build_name, version)
# The s3_path_prefix has additional "/" in the end to prevent finding
# e.g. `binary_darwin_aarch64/clickhouse` for `binary_darwin`
check_for_success_run(s3_helper, f"{s3_path_prefix}/", build_name, version)
docker_image = get_image_with_version(IMAGES_PATH, IMAGE_NAME)
image_version = docker_image.version