Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert dupe rule panic to error message #224

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkg/triage/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ package triage

import (
"fmt"
"github.com/google/triage-party/pkg/provider"
"net/url"
"strings"
"time"

"github.com/google/triage-party/pkg/provider"

"context"

"github.com/google/triage-party/pkg/hubbub"
"github.com/google/triage-party/pkg/logu"
"k8s.io/klog/v2"
Expand Down Expand Up @@ -75,7 +77,8 @@ func SummarizeRuleResult(t Rule, cs []*hubbub.Conversation, seen map[string]*Rul
if dupeRule != nil {
// Find a nefarious bug
if t.ID == dupeRule.ID {
panic(fmt.Sprintf("this can't happen: %s is a double-dupe of %s", c.URL, dupeRule.ID))
klog.Errorf("LOGIC FAILURE: %s was previously seen by rule %q, which is the same as the current rule: %q", c.URL, dupeRule.ID, t.ID)
continue
}

klog.V(2).Infof("dupe: %s (now: %q, previous: %q)", c.URL, t.ID, dupeRule.ID)
Expand Down