Skip to content

Commit a13a379

Browse files
authored
Merge pull request #493 from booxter/dont-log-same-snippets
Don't log same snippets (per system) twice
2 parents 9bf58bf + a817593 commit a13a379

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nixpkgs_review/report.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def remove_ansi_escape_sequences(text: str) -> str:
8888

8989
def html_logs_section(logs_dir: Path, packages: list[Attr], system: str) -> str:
9090
res = ""
91+
seen_tails = set()
9192
for pkg in packages:
9293
tail = remove_ansi_escape_sequences(
9394
get_file_tail(logs_dir / get_log_filename(pkg, system))
@@ -96,7 +97,10 @@ def html_logs_section(logs_dir: Path, packages: list[Attr], system: str) -> str:
9697
if not res:
9798
res = "\n---\n"
9899
res += f"<details>\n<summary>Error logs: `{system}`</summary>\n"
100+
if tail in seen_tails:
101+
continue
99102
res += f"<details>\n<summary>{pkg.name}</summary>\n<pre>{tail}</pre>\n</details>\n"
103+
seen_tails.add(tail)
100104
res += "</details>\n"
101105
return res
102106

0 commit comments

Comments
 (0)