Skip to content

Commit 19094aa

Browse files
authored
Merge pull request #8377 from BenTheElder/same-email
validate emails ....
2 parents c0bb189 + 83965ac commit 19094aa

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

generator/app.go

+23-2
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,11 @@ func (c *Context) Sort() {
438438
// Validate returns a list of errors encountered while validating a Context
439439
func (c *Context) Validate() []error {
440440
errors := []error{}
441+
// github to Person info
442+
// TODO: this would probably be a better config format? to avoid duplicating
443+
// people with potentially differing info, versus referring to leads by
444+
// github handle within each SIG and then keeping this map alongside the SIGs
445+
// This could break external tooling parsing the file though.
441446
people := make(map[string]Person)
442447
reRawGitHubURL := regexp.MustCompile(regexRawGitHubURL)
443448
reGitHubURL := regexp.MustCompile(regexGitHubURL)
@@ -454,8 +459,24 @@ func (c *Context) Validate() []error {
454459
for prefix, persons := range group.Leadership.PrefixToPersonMap() {
455460
for _, person := range persons {
456461
if val, ok := people[person.GitHub]; ok {
457-
if val.Name != person.Name || (prefix != "emeritus_lead" && val.Company != person.Company) {
458-
errors = append(errors, fmt.Errorf("%s: %ss: expected person: %v, got: %v", group.Dir, prefix, val, person))
462+
// non-emeritus must have email and company set
463+
if prefix != "emeritus_lead" {
464+
// email must be set and consistent
465+
if val.Email == "" {
466+
errors = append(errors, fmt.Errorf("%s: %s: email is empty but should be set", group.Dir, val.GitHub))
467+
} else if val.Email != person.Email {
468+
errors = append(errors, fmt.Errorf("%s: %s email: %q does not match other entries %q", group.Dir, val.GitHub, val.Email, person.Email))
469+
}
470+
// company must be set and consistent
471+
if val.Company == "" {
472+
errors = append(errors, fmt.Errorf("%s: %s: company is empty but should be set", group.Dir, val.Company))
473+
} else if val.Company != person.Company {
474+
errors = append(errors, fmt.Errorf("%s: %s company: %q does not match other entries %q", group.Dir, val.GitHub, val.Company, person.Company))
475+
}
476+
}
477+
// all entries should have github + name, emeritus or not
478+
if val.Name != person.Name {
479+
errors = append(errors, fmt.Errorf("%s: %s: expected person: %v, got: %v", group.Dir, prefix, val, person))
459480
}
460481
} else if prefix != "emeritus_lead" {
461482
people[person.GitHub] = person

sigs.yaml

+14-1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ sigs:
295295
- github: derekwaynecarr
296296
name: Derek Carr
297297
company: Red Hat
298+
298299
- github: dims
299300
name: Davanum Srinivas
300301
company: Amazon
@@ -438,19 +439,23 @@ sigs:
438439
- github: enj
439440
name: Mo Khan
440441
company: Microsoft
442+
441443
- github: mikedanese
442444
name: Mike Danese
443445
company: Google
444446
- github: ritazh
445447
name: Rita Zhang
446448
company: Microsoft
449+
447450
tech_leads:
448451
- github: deads2k
449452
name: David Eads
450453
company: Red Hat
454+
451455
- github: enj
452456
name: Mo Khan
453457
company: Microsoft
458+
454459
- github: liggitt
455460
name: Jordan Liggitt
456461
company: Google
@@ -3380,6 +3385,7 @@ sigs:
33803385
- github: marosset
33813386
name: Mark Rossetti
33823387
company: Microsoft
3388+
33833389
tech_leads:
33843390
- github: claudiubelu
33853391
name: Claudiu Belu
@@ -3393,6 +3399,7 @@ sigs:
33933399
- github: marosset
33943400
name: Mark Rossetti
33953401
company: Microsoft
3402+
33963403
emeritus_leads:
33973404
- github: PatrickLang
33983405
name: Patrick Lang
@@ -3548,6 +3555,7 @@ workinggroups:
35483555
- github: xing-yang
35493556
name: Xing Yang
35503557
company: VMware
3558+
35513559
- github: yuxiangqian
35523560
name: Xiangqian Yu
35533561
company: Google
@@ -3690,13 +3698,15 @@ workinggroups:
36903698
- github: jeremyrickard
36913699
name: Jeremy Rickard
36923700
company: Microsoft
3701+
36933702
- github: liggitt
36943703
name: Jordan Liggitt
36953704
company: Google
36963705
36973706
- github: micahhausler
36983707
name: Micah Hausler
36993708
company: Amazon
3709+
37003710
meetings:
37013711
- description: Regular WG Meeting
37023712
day: Tuesday
@@ -3835,6 +3845,7 @@ workinggroups:
38353845
- github: pohly
38363846
name: Patrick Ohly
38373847
company: Intel
3848+
38383849
meetings: []
38393850
contact:
38403851
slack: wg-structured-logging
@@ -3860,12 +3871,14 @@ committees:
38603871
- github: divya-mohan0209
38613872
name: Divya Mohan
38623873
company: SUSE
3874+
38633875
- github: endocrimes
38643876
name: Danielle Lancashire
38653877
company: Fermyon
38663878
- github: jeremyrickard
38673879
name: Jeremy Rickard
38683880
company: Microsoft
3881+
38693882
- github: stmcginnis
38703883
name: Sean McGinnis
38713884
company: Lambda, Inc
@@ -3993,7 +4006,7 @@ committees:
39934006
- github: aojea
39944007
name: Antonio Ojea
39954008
company: Google
3996-
email: antonio.ojea.garcia@gmail.com
4009+
email: aojea@google.com
39974010
- github: justaugustus
39984011
name: Stephen Augustus
39994012
company: Bloomberg

0 commit comments

Comments
 (0)