Issue Triage
18 min
Triaging a large issue backlog needs some way to rank what to look at
first. A simple, effective approach: weight by label severity
(critical matters more than enhancement), plus a modest bonus for
how long an issue has sat open — but capped, so age alone can never
let a low-priority issue outrank a newly-filed critical bug just by
being old.
def priority_score(labels, days_open, label_weights):
label_score = sum(label_weights.get(label, 0) for label in labels)
age_score = min(days_open // 7, 10)
return label_score + age_score
An enhancement open for 100 days (score 12) still ranks below a fresh critical bug (score 20+) -- exactly the intended behavior. Without the min() cap, a sufficiently old enhancement request would eventually outscore urgent new bugs purely by sitting in the backlog, which is precisely the wrong triage signal.
Write `priority_score(labels, days_open, label_weights)`: sum each label's weight (via `label_weights`, defaulting to `0` for an unrecognized label), then add an age bonus of `min(days_open // 7, 10)` (capped at 10). Return the total.
Why cap the age bonus at 10, instead of letting an issue's priority score grow without bound the longer it stays open?
You can compute a bounded, label-dominant priority score for issue triage, and understand why capping age's contribution keeps severity as the primary signal.