Skip to content

Commit 5cb8612

Browse files
hjmjohnsonclaude
andcommitted
ENH: Add --new-warnings-only flag to list_nightly_warnings.py
Add a flag that filters builds to only those with more warnings than the minimum across recent builds. This identifies regressions from a clean baseline rather than showing all builds with any warnings, which is more useful for automated triage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2b64f7b commit 5cb8612

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/skills/fix-nightly-warnings/scripts/list_nightly_warnings.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ def main() -> None:
111111
action="store_true",
112112
help="Show all matching builds, not just those with warnings or errors",
113113
)
114+
parser.add_argument(
115+
"--new-warnings-only",
116+
action="store_true",
117+
help=(
118+
"Only show builds that have MORE warnings than the lowest warning "
119+
"count among recent builds (i.e., regressions from a clean baseline)"
120+
),
121+
)
114122
parser.add_argument(
115123
"--json",
116124
action="store_true",
@@ -167,6 +175,17 @@ def main() -> None:
167175
reverse=True,
168176
)
169177

178+
if args.new_warnings_only and nodes:
179+
# Find the minimum warning count as the "clean baseline" and keep
180+
# only builds that exceed it, indicating regressions.
181+
min_warnings = min(n.get("buildWarningsCount") or 0 for n in nodes)
182+
nodes = [
183+
n
184+
for n in nodes
185+
if (n.get("buildWarningsCount") or 0) > min_warnings
186+
or (n.get("buildErrorsCount") or 0) > 0
187+
]
188+
170189
# Apply the display limit after sorting
171190
nodes = nodes[: args.limit]
172191

0 commit comments

Comments
 (0)