Skip to content

Commit

Permalink
Merge #136571
Browse files Browse the repository at this point in the history
136571: TEAMS: ping kv-triage for unittest failures r=tbg a=tbg

Currently unit test nightlies ping (at)cockroachdb/kv, our main handle.
This is not a team we'd like people to just leave to avoid notifications.
Github doesn't seem to offer a way to opt out of notifications for a team
one is on, besides, there are useful notifications going to that handle.

Our triage process is robust without these mentions. They can go to
(at)cockroachdb/kv-notifications for those inclined to consume a
firehose.

This change frees up our main alias (at)cockroachdb/kv for more
meaningful notifications.

Epic: none

Co-authored-by: Tobias Grieger <[email protected]>
  • Loading branch information
craig[bot] and tbg committed Dec 4, 2024
2 parents 44de2d3 + c775e5d commit d87d473
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
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

0 comments on commit d87d473

Please sign in to comment.