Skip to content

Commit ee7e8bc

Browse files
craig[bot]asg0451RaduBerinde
committed
148454: changefeedccl: fix alter changefeed test for webhook sinks r=aerfrei a=asg0451 Opt a changefeed test out of the metamorphic enriched envelope testing for webhook sinks. Fixes: #148254 Release note: None 148513: TEAMS: update admission control labels r=RaduBerinde a=RaduBerinde Add support for multiple github issue labels in teams and update admission-control team labels. Epic: none Release note: None Co-authored-by: Miles Frankel <[email protected]> Co-authored-by: Radu Berinde <[email protected]>
3 parents dfd17d1 + 12b41c2 + b98fd61 commit ee7e8bc

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
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/ccl/changefeedccl/alter_changefeed_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,17 @@ func TestAlterChangefeedAlterTableName(t *testing.T) {
12421242
sqlDB.Exec(t,
12431243
`INSERT INTO movr.users VALUES (1, 'Alice')`,
12441244
)
1245-
testFeed := feed(t, f, `CREATE CHANGEFEED FOR movr.users WITH diff, resolved = '100ms'`)
1245+
1246+
// TODO(#145927): currently the metamorphic enriched envelope system for
1247+
// webhook uses source.table_name as the topic. This test expects the
1248+
// topic name to be durable across table renames, which is not expected
1249+
// to be true for source.table_name.
1250+
var args []any
1251+
if _, ok := f.(*webhookFeedFactory); ok {
1252+
args = append(args, optOutOfMetamorphicEnrichedEnvelope{reason: "see comment"})
1253+
}
1254+
1255+
testFeed := feed(t, f, `CREATE CHANGEFEED FOR movr.users WITH diff, resolved = '100ms'`, args...)
12461256
defer closeFeed(t, testFeed)
12471257

12481258
assertPayloads(t, testFeed, []string{

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)