Skip to content

Commit a0aadbb

Browse files
dkoepclaude
andcommitted
car_diff: dedupe errors and render them in a collapsible dropdown
A single failing carcontroller raised the same traceback for every segment, printing dozens of identical tracebacks at the top of the report. Group errors by their text, print each unique one once with the affected segment count, and wrap the whole block in a details dropdown like the diff section so it does not spam the PR comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 10ce7cb commit a0aadbb

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

opendbc/car/tests/car_diff.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,16 @@ def main(platform: str | None = None, segments_per_platform: int = 10, update_re
293293
icon = "⚠️" if with_diffs else "✅"
294294
print(f"\n{icon} {len(with_diffs)} changed, {n_passed} passed, {len(errors)} errors")
295295

296-
for plat, seg, err in errors:
297-
print(f"\nERROR {plat} - {seg}: {err}")
296+
if errors:
297+
# Group identical errors so a single bug doesn't spam the report with one traceback per segment
298+
by_err: dict[str, list[str]] = defaultdict(list)
299+
for plat, seg, err in errors:
300+
by_err[err].append(f"{plat} - {seg}")
301+
print("<details><summary><b>Show errors</b></summary>\n\n```")
302+
for err, segs in sorted(by_err.items(), key=lambda kv: -len(kv[1])):
303+
affected = ", ".join(segs[:3]) + (f" (+{len(segs) - 3} more)" if len(segs) > 3 else "")
304+
print(f"\nERROR ({len(segs)}x) {affected}:\n{err.rstrip()}")
305+
print("```\n</details>")
298306

299307
if with_diffs:
300308
print("<details><summary><b>Show changes</b></summary>\n\n```")

0 commit comments

Comments
 (0)