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

TEAMS: ping kv-triage for unittest failures #136571

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions TEAMS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ cockroachdb/sql-queries:
cockroachdb/kv:
aliases:
cockroachdb/kv-triage: roachtest
# This is a hack - we can't have the same key twice,
# but it also doesn't seem worth rewriting the aliases
# into slice form for just this.
'cockroachdb/kv-triage ': unittest
cockroachdb/kv-prs: other
triage_column_id: 14242655
label: T-kv
Expand Down
19 changes: 14 additions & 5 deletions pkg/cmd/bazci/githubpost/githubpost.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,21 @@ func DefaultFormatter(ctx context.Context, f Failure) (issues.IssueFormatter, is
}
if len(teams) > 0 {
projColID = teams[0].TriageColumnID
for _, team := range teams {
if !team.SilenceMentions {
mentions = append(mentions, "@"+string(team.Name()))
for _, tm := range teams {
if !tm.SilenceMentions {
var hasAliases bool
for al, purp := range tm.Aliases {
if purp == team.PurposeUnittest {
hasAliases = true
mentions = append(mentions, "@"+strings.TrimSpace(string(al)))
}
}
if !hasAliases {
mentions = append(mentions, "@"+string(tm.Name()))
}
}
if team.Label != "" {
labels = append(labels, team.Label)
if tm.Label != "" {
labels = append(labels, tm.Label)
}
}
}
Expand Down
16 changes: 6 additions & 10 deletions pkg/cmd/bazci/githubpost/githubpost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestListFailuresFromJSON(t *testing.T) {
testName: "TestStopperWithCancelConcurrent",
title: "util/stop: TestStopperWithCancelConcurrent failed",
message: "this is just a testing issue",
mention: []string{"@cockroachdb/kv"},
mention: []string{"@cockroachdb/kv-triage"},
labels: []string{"C-test-failure", "release-blocker", "T-kv"},
hasProject: true,
}},
Expand All @@ -117,7 +117,7 @@ func TestListFailuresFromJSON(t *testing.T) {
testName: "TestStopperWithCancelConcurrent",
title: "util/stop: TestStopperWithCancelConcurrent failed",
message: "this is just a testing issue",
mention: []string{"@cockroachdb/kv"},
mention: []string{"@cockroachdb/kv-triage"},
labels: []string{"T-kv"},
hasProject: true,
}},
Expand All @@ -131,7 +131,7 @@ func TestListFailuresFromJSON(t *testing.T) {
testName: "TestReplicateQueueRebalance",
title: "kv/kvserver: TestReplicateQueueRebalance failed",
message: "replicate_queue_test.go:88: condition failed to evaluate within 45s: not balanced: [10 1 10 1 8]",
mention: []string{"@cockroachdb/kv"},
mention: []string{"@cockroachdb/kv-triage"},
labels: []string{"C-test-failure", "release-blocker", "T-kv"},
hasProject: true,
}},
Expand All @@ -145,7 +145,7 @@ func TestListFailuresFromJSON(t *testing.T) {
testName: "TestGossipHandlesReplacedNode",
title: "kv/kvserver: TestGossipHandlesReplacedNode failed",
message: "F180711 20:13:15.826193 83 storage/replica.go:1877 [n?,s1,r1/1:/M{in-ax}] on-disk and in-memory state diverged:",
mention: []string{"@cockroachdb/kv"},
mention: []string{"@cockroachdb/kv-triage"},
labels: []string{"C-test-failure", "release-blocker", "T-kv"},
hasProject: true,
}},
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestListFailuresFromJSON(t *testing.T) {
testName: "TestTxnCoordSenderPipelining",
title: "kv/kvclient/kvcoord: TestTxnCoordSenderPipelining failed",
message: `injected failure`,
mention: []string{"@cockroachdb/kv"},
mention: []string{"@cockroachdb/kv-triage"},
labels: []string{"C-test-failure", "release-blocker", "T-kv"},
hasProject: true,
},
Expand All @@ -206,7 +206,7 @@ TestTxnCoordSenderPipelining - 1.00s
Slow passing tests:
TestAnchorKey - 1.01s
`,
mention: []string{"@cockroachdb/kv"},
mention: []string{"@cockroachdb/kv-triage"},
labels: []string{"C-test-failure", "release-blocker", "T-kv"},
hasProject: true,
},
Expand Down Expand Up @@ -414,7 +414,6 @@ func TestListFailuresFromTestXML(t *testing.T) {
fileName string
expPkg string
expIssues []issue
formatter Formatter
}{
{
fileName: "basic.xml",
Expand All @@ -429,7 +428,6 @@ func TestListFailuresFromTestXML(t *testing.T) {
--- FAIL: TestJSONErrors/frues (0.00s)`,
mention: []string{"@cockroachdb/unowned"},
}},
formatter: DefaultFormatter,
},
}

Expand Down Expand Up @@ -481,7 +479,6 @@ func TestPostGeneralFailure(t *testing.T) {
testCases := []struct {
fileName string
expIssues []issue
formatter Formatter
}{
{
fileName: "failed-build-output.txt",
Expand All @@ -490,7 +487,6 @@ func TestPostGeneralFailure(t *testing.T) {
mention: []string{"@cockroachdb/unowned"},
labels: []string{"C-test-failure", "release-blocker", "T-testeng"},
}},
formatter: DefaultFormatter,
},
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/internal/team/TEAMS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ cockroachdb/sql-queries:
cockroachdb/kv:
aliases:
cockroachdb/kv-triage: roachtest
# This is a hack - we can't have the same key twice,
# but it also doesn't seem worth rewriting the aliases
# into slice form for just this.
'cockroachdb/kv-triage ': unittest
cockroachdb/kv-prs: other
triage_column_id: 14242655
label: T-kv
Expand Down
2 changes: 2 additions & 0 deletions pkg/internal/team/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ const (
// PurposeRoachtest indicates that the team handles that should be mentioned
// in roachtest issues should be returned.
PurposeRoachtest = Purpose("roachtest")
PurposeUnittest = Purpose("unittest")
)

var validPurposes = map[Purpose]struct{}{
PurposeOther: {},
PurposeRoachtest: {}, // mention in roachtest issues
PurposeUnittest: {}, // mention in unit test issues
}

// LoadTeams loads the teams from an io input.
Expand Down
Loading