From 253b67928d0790d1e3322f35fdc6cf2da9dd502a Mon Sep 17 00:00:00 2001 From: Tyler Gehrs Date: Fri, 19 Jul 2024 11:52:35 +0300 Subject: [PATCH 1/3] add summary comment --- coverage_comment/main.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/coverage_comment/main.py b/coverage_comment/main.py index 6b08dae5..f7855e63 100644 --- a/coverage_comment/main.py +++ b/coverage_comment/main.py @@ -182,6 +182,23 @@ def process_pr( marker=marker, subproject_id=config.SUBPROJECT_ID, ) + summary_comment = template.get_comment_markdown( + coverage=coverage, + diff_coverage=diff_coverage, + previous_coverage=previous_coverage, + previous_coverage_rate=previous_coverage_rate, + files=files_info, + count_files=count_files, + minimum_green=config.MINIMUM_GREEN, + minimum_orange=config.MINIMUM_ORANGE, + repo_name=config.GITHUB_REPOSITORY, + pr_number=config.GITHUB_PR_NUMBER, + base_template=template.read_template_file("comment.md.j2"), + custom_template=config.COMMENT_TEMPLATE, + pr_targets_default_branch=pr_targets_default_branch, + marker=marker, + subproject_id=config.SUBPROJECT_ID, + ) except template.MissingMarker: log.error( "Marker not found. This error can happen if you defined a custom comment " @@ -200,7 +217,7 @@ def process_pr( return 1 github.add_job_summary( - content=comment, github_step_summary=config.GITHUB_STEP_SUMMARY + content=summary_comment, github_step_summary=config.GITHUB_STEP_SUMMARY ) pr_number: int | None = config.GITHUB_PR_NUMBER if pr_number is None: From d8c8f17e7d2f7350fcf1178b1dfdb773226b0693 Mon Sep 17 00:00:00 2001 From: Tyler Gehrs Date: Fri, 19 Jul 2024 11:55:04 +0300 Subject: [PATCH 2/3] make max files none --- coverage_comment/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/coverage_comment/main.py b/coverage_comment/main.py index f7855e63..af94edf7 100644 --- a/coverage_comment/main.py +++ b/coverage_comment/main.py @@ -189,6 +189,7 @@ def process_pr( previous_coverage_rate=previous_coverage_rate, files=files_info, count_files=count_files, + max_files=None, minimum_green=config.MINIMUM_GREEN, minimum_orange=config.MINIMUM_ORANGE, repo_name=config.GITHUB_REPOSITORY, From 9dc27d83cdd799ee00c352253cc10d155951b395 Mon Sep 17 00:00:00 2001 From: Joachim Jablon Date: Sat, 20 Jul 2024 09:42:01 +0200 Subject: [PATCH 3/3] Update coverage_comment/main.py --- coverage_comment/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/coverage_comment/main.py b/coverage_comment/main.py index af94edf7..71c5bedc 100644 --- a/coverage_comment/main.py +++ b/coverage_comment/main.py @@ -182,6 +182,7 @@ def process_pr( marker=marker, subproject_id=config.SUBPROJECT_ID, ) + # Same as above except `max_files` is None summary_comment = template.get_comment_markdown( coverage=coverage, diff_coverage=diff_coverage,