Compare commits
2 commits
87f97eb4fa
...
517e9884cc
| Author | SHA1 | Date | |
|---|---|---|---|
| 517e9884cc | |||
| 3f8666ee0c |
1 changed files with 28 additions and 1 deletions
|
|
@ -539,15 +539,36 @@ async def substantive_fix_cycle(conn, max_workers=None) -> tuple[int, int]:
|
||||||
|
|
||||||
# Filter to only PRs with substantive issues (not just mechanical)
|
# Filter to only PRs with substantive issues (not just mechanical)
|
||||||
substantive_rows = []
|
substantive_rows = []
|
||||||
|
skipped_no_tags = []
|
||||||
for row in rows:
|
for row in rows:
|
||||||
try:
|
try:
|
||||||
issues = json.loads(row["eval_issues"] or "[]")
|
issues = json.loads(row["eval_issues"] or "[]")
|
||||||
except (json.JSONDecodeError, TypeError):
|
except (json.JSONDecodeError, TypeError):
|
||||||
|
# Corrupt JSON in eval_issues is abnormal (post-merge column drift,
|
||||||
|
# hand-edited row, partial write during crash). WARN so ops can chase
|
||||||
|
# the upstream column-write path. Without this, the row drops out of
|
||||||
|
# both substantive_rows and skipped_no_tags — the third silent path.
|
||||||
|
logger.warning(
|
||||||
|
"PR #%d: corrupt eval_issues JSON — skipping in substantive fix cycle",
|
||||||
|
row["number"],
|
||||||
|
)
|
||||||
continue
|
continue
|
||||||
if set(issues) & (FIXABLE_TAGS | CONVERTIBLE_TAGS | UNFIXABLE_TAGS):
|
if set(issues) & (FIXABLE_TAGS | CONVERTIBLE_TAGS | UNFIXABLE_TAGS):
|
||||||
substantive_rows.append(row)
|
substantive_rows.append(row)
|
||||||
|
else:
|
||||||
|
skipped_no_tags.append((row["number"], issues))
|
||||||
|
|
||||||
if not substantive_rows:
|
if not substantive_rows:
|
||||||
|
# Visibility for the LIMIT-3 head-of-line block: if the oldest
|
||||||
|
# candidates have no fixer-actionable tags (e.g. eval_issues=[],
|
||||||
|
# broken_wiki_links only), the cycle silently returns 0 — and the
|
||||||
|
# next cycle picks the same head-of-line, forever. Log the eval_issues
|
||||||
|
# of skipped candidates so the journal makes the block visible.
|
||||||
|
if skipped_no_tags:
|
||||||
|
logger.info(
|
||||||
|
"Substantive fix cycle: 0 actionable from %d candidate(s) — head-of-line: %s",
|
||||||
|
len(rows), skipped_no_tags,
|
||||||
|
)
|
||||||
return 0, 0
|
return 0, 0
|
||||||
|
|
||||||
fixed = 0
|
fixed = 0
|
||||||
|
|
@ -559,7 +580,13 @@ async def substantive_fix_cycle(conn, max_workers=None) -> tuple[int, int]:
|
||||||
if result.get("action"):
|
if result.get("action"):
|
||||||
fixed += 1
|
fixed += 1
|
||||||
elif result.get("skipped"):
|
elif result.get("skipped"):
|
||||||
logger.debug("PR #%d: substantive fix skipped: %s", row["number"], result.get("reason"))
|
# Was DEBUG — promoted to INFO to make stuck-PR root cause
|
||||||
|
# visible without enabling DEBUG fleet-wide. (Ship Apr 24+
|
||||||
|
# silent skip diagnosis.)
|
||||||
|
logger.info(
|
||||||
|
"PR #%d: substantive fix skipped: %s",
|
||||||
|
row["number"], result.get("reason"),
|
||||||
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception("PR #%d: substantive fix failed", row["number"])
|
logger.exception("PR #%d: substantive fix failed", row["number"])
|
||||||
errors += 1
|
errors += 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue