Merge pull request 'mesh-issues: a verdict naming issue 0 is none, and the tracker's own module is a registered owner (issue 396)' (#186) from fix/triage-issue-zero-is-none into main
This commit was merged in pull request #186.
This commit is contained in:
@@ -407,6 +407,10 @@ func (t *Tracker) judge(is *Issue, candidates []*Issue) (*Verdict, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (v.Verdict == VerdictDuplicate || v.Verdict == VerdictRelated) && v.Issue == 0 {
|
||||
// "related to issue 0" names no issue: the model's way of saying none. Not a failure, and nothing is linked.
|
||||
v.Verdict = VerdictNone
|
||||
}
|
||||
switch v.Verdict {
|
||||
case VerdictNone:
|
||||
v.Issue, v.Certain = 0, false
|
||||
|
||||
@@ -808,3 +808,18 @@ func TestReadyIsSaidOnceFollowsDuplicatesAndAskingFailsLoudly(t *testing.T) {
|
||||
t.Fatalf("not let go through the duplicate: %+v", v)
|
||||
}
|
||||
}
|
||||
|
||||
// A verdict of related or duplicate naming issue 0 names none: read as none, not a failure.
|
||||
func TestAVerdictNamingIssueZeroIsNone(t *testing.T) {
|
||||
h := newHarness(t)
|
||||
h.open(t, "the counter skips a number")
|
||||
n := h.open(t, "the desk is slow")
|
||||
withJudge(h, &stubJudge{verdict: map[string]any{"verdict": "related", "issue": 0, "reason": "nothing close"}})
|
||||
if err := h.Check(n); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
is := get(t, h, n)
|
||||
if is.Triage == nil || is.Triage.Verdict != VerdictNone || len(is.Links) != 0 || is.Severity != "minor" {
|
||||
t.Fatalf("%+v", is)
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user