Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions ci/utils/pr_test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,19 @@ def _add(test_id):
return failed[:_MAX_TESTS]


def _build_body(failed, passed, skipped, job_analysis):
def _build_body(failed, passed, skipped, cancelled, job_analysis):
lines = [_MARKER, "## CI Test Summary", ""]
if not failed:
lines.append(f"✅ All {len(passed)} test job(s) passed.")
if cancelled:
lines.append(
f"✅ {len(passed)} passed · {len(cancelled)} cancelled / not completed"
)
Comment on lines 136 to +140

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve skipped jobs in the cancelled summary.

When a run has both skipped and cancelled jobs but no failures, this branch omits the skipped count even though those jobs are classified separately. The sticky comment should report all non-passed categories.

Proposed fix
         if cancelled:
-            lines.append(
-                f"✅ {len(passed)} passed · {len(cancelled)} cancelled / not completed"
-            )
+            summary = f"✅ {len(passed)} passed"
+            if skipped:
+                summary += f" · {len(skipped)} skipped"
+            summary += f" · {len(cancelled)} cancelled / not completed"
+            lines.append(summary)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if not failed:
lines.append(f"✅ All {len(passed)} test job(s) passed.")
if cancelled:
lines.append(
f"✅ {len(passed)} passed · {len(cancelled)} cancelled / not completed"
)
if not failed:
if cancelled:
summary = f"✅ {len(passed)} passed"
if skipped:
summary += f" · {len(skipped)} skipped"
summary += f" · {len(cancelled)} cancelled / not completed"
lines.append(summary)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/utils/pr_test_summary.py` around lines 136 - 140, Update the no-failure
cancelled summary in the summary-generation function to include the skipped-job
count alongside passed and cancelled counts, preserving the existing separate
classification and formatting for all non-passed categories.

else:
lines.append(f"✅ All {len(passed)} test job(s) passed.")
else:
lines.append(
f"**{len(failed)} failed** · {len(passed)} passed · {len(skipped)} skipped"
+ (f" · {len(cancelled)} cancelled" if cancelled else "")
)
for job in failed:
tests = job_analysis[job["id"]]
Expand Down Expand Up @@ -177,13 +183,16 @@ def main():

passed = [j for j in test_jobs if j["conclusion"] == "success"]
skipped = [j for j in test_jobs if j["conclusion"] == "skipped"]
failed = [j for j in test_jobs if j not in passed and j not in skipped]
failed = [j for j in test_jobs if j["conclusion"] in ("failure", "timed_out")]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
cancelled = [
j for j in test_jobs if j not in passed and j not in skipped and j not in failed
]

job_analysis = {
job["id"]: _analyze_job_log(job["id"], repo, token) for job in failed
}

body = _build_body(failed, passed, skipped, job_analysis)
body = _build_body(failed, passed, skipped, cancelled, job_analysis)

comments = list(
_paginate(f"/repos/{repo}/issues/{pr_number}/comments", token)
Expand Down
Loading