Skip to content

Commit b98fd61

Browse files
committed
TEAMS: update admission control labels
Add support for multiple github issue labels in teams and update admission-control team labels. Epic: none Release note: None
1 parent 24d55be commit b98fd61

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

TEAMS.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ cockroachdb/kv:
2929
'cockroachdb/kv-triage ': unittest
3030
cockroachdb/kv-prs: other
3131
label: T-kv
32+
cockroachdb/admission-control:
33+
label: T-kv,A-admission-control
3234
cockroachdb/spatial:
3335
label: T-spatial
3436
cockroachdb/dev-inf:
@@ -38,8 +40,6 @@ cockroachdb/drp-eng:
3840
cockroachdb/multiregion:
3941
label: T-multiregion
4042
cockroachdb/storage:
41-
aliases:
42-
cockroachdb/admission-control: other
4343
label: T-storage
4444
cockroachdb/test-eng:
4545
label: T-testeng

pkg/cmd/bazci/githubpost/githubpost.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ func DefaultFormatter(ctx context.Context, f Failure) (issues.IssueFormatter, is
7979
mentions = append(mentions, "@"+string(tm.Name()))
8080
}
8181
}
82-
if tm.Label != "" {
83-
labels = append(labels, tm.Label)
84-
}
82+
labels = append(labels, tm.Labels()...)
8583
}
8684
}
8785
return issues.UnitTestFormatter, issues.PostRequest{

pkg/cmd/roachtest/github.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,7 @@ func (g *githubIssues) createPostRequest(
248248
if mentionTeam {
249249
mention = append(mention, "@"+string(alias))
250250
}
251-
if label := teams[alias].Label; label != "" {
252-
labels = append(labels, label)
253-
}
251+
labels = append(labels, teams[alias].Labels()...)
254252
}
255253
}
256254

pkg/internal/team/TEAMS.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ cockroachdb/kv:
2929
'cockroachdb/kv-triage ': unittest
3030
cockroachdb/kv-prs: other
3131
label: T-kv
32+
cockroachdb/admission-control:
33+
label: T-kv,A-admission-control
3234
cockroachdb/spatial:
3335
label: T-spatial
3436
cockroachdb/dev-inf:
@@ -38,8 +40,6 @@ cockroachdb/drp-eng:
3840
cockroachdb/multiregion:
3941
label: T-multiregion
4042
cockroachdb/storage:
41-
aliases:
42-
cockroachdb/admission-control: other
4343
label: T-storage
4444
cockroachdb/test-eng:
4545
label: T-testeng

pkg/internal/team/team.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ type Team struct {
3131
// does not contain TeamName.
3232
Aliases map[Alias]Purpose `yaml:"aliases"`
3333
// GitHub label will be added to issues posted for this team.
34+
// Multiple labels can be specified, separated by commas.
3435
Label string `yaml:"label"`
35-
// SilenceMentions is true if @-mentions should be supressed for this team.
36+
// SilenceMentions is true if @-mentions should be suppressed for this team.
3637
SilenceMentions bool `yaml:"silence_mentions"`
3738
}
3839

@@ -41,6 +42,14 @@ func (t Team) Name() Alias {
4142
return t.TeamName
4243
}
4344

45+
// Labels returns the list of labels (possibly empty).
46+
func (t Team) Labels() []string {
47+
if t.Label == "" {
48+
return nil
49+
}
50+
return strings.Split(t.Label, ",")
51+
}
52+
4453
// Map contains the in-memory representation of TEAMS.yaml.
4554
type Map map[Alias]Team
4655

0 commit comments

Comments
 (0)