From b8f6d5714d3b258cb6f65ec1091b5c8e6baf37f5 Mon Sep 17 00:00:00 2001 From: Neves-P Date: Tue, 2 Jul 2024 10:13:19 +0200 Subject: [PATCH 1/2] Better formatting error messages --- tasks/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/build.py b/tasks/build.py index 527758d..35b2149 100644 --- a/tasks/build.py +++ b/tasks/build.py @@ -381,19 +381,19 @@ def comment_download_pr(base_repo_name, pr, download_pr_exit_code, download_pr_e download_pr_comments_cfg = config.read_config()[config.SECTION_DOWNLOAD_PR_COMMENTS] if error_stage == _ERROR_GIT_CLONE: - download_comment = (f"`{download_pr_error}`\n" + download_comment = (f"```{download_pr_error}```\n" f"{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_CLONE_FAILURE]}" f"\n{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_CLONE_TIP]}") elif error_stage == _ERROR_GIT_CHECKOUT: - download_comment = (f"`{download_pr_error}`\n" + download_comment = (f"```{download_pr_error}```\n" f"{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_CHECKOUT_FAILURE]}" f"\n{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_CHECKOUT_TIP]}") elif error_stage == _ERROR_CURL: - download_comment = (f"`{download_pr_error}`\n" + download_comment = (f"```{download_pr_error}```\n" f"{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_CURL_FAILURE]}" f"\n{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_CURL_TIP]}") elif error_stage == _ERROR_GIT_APPLY: - download_comment = (f"`{download_pr_error}`\n" + download_comment = (f"```{download_pr_error}```\n" f"{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_APPLY_FAILURE]}" f"\n{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_APPLY_TIP]}") From 59a337cf1ce2bcbf86adbfabc981434a02404c6e Mon Sep 17 00:00:00 2001 From: Neves-P Date: Tue, 2 Jul 2024 10:45:16 +0200 Subject: [PATCH 2/2] Need copytree instead --- tasks/clean_up.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/clean_up.py b/tasks/clean_up.py index 5853d00..8e2e509 100644 --- a/tasks/clean_up.py +++ b/tasks/clean_up.py @@ -43,7 +43,7 @@ def move_to_trash_bin(trash_bin_dir, job_dirs): # Remove event_xxx-yyy/run_nnn/ directories pr_dirs = list(set(pr_dirs)) # get only unique dirs for pr_dir in pr_dirs: - destination_dir = shutil.copy2(pr_dir, trash_bin_dir, follow_symlinks=True) + destination_dir = shutil.copytree(pr_dir, trash_bin_dir) log(f"{funcname}(): copied {pr_dir} to {destination_dir}") os.remove(pr_dir) log(f"{funcname}(): removed {pr_dir}")