@@ -21,12 +21,11 @@ type contributorProfileFrontmatter struct {
21
21
GithubUsername string `yaml:"github"`
22
22
// Script assumes that if value is nil, the Registry site build step will
23
23
// backfill the value with the user's GitHub avatar URL
24
- AvatarURL * string `yaml:"avatar"`
25
- LinkedinURL * string `yaml:"linkedin"`
26
- WebsiteURL * string `yaml:"website"`
27
- SupportEmail * string `yaml:"support_email"`
28
- EmployerGithubUsername * string `yaml:"employer_github"`
29
- ContributorStatus * string `yaml:"status"`
24
+ AvatarURL * string `yaml:"avatar"`
25
+ LinkedinURL * string `yaml:"linkedin"`
26
+ WebsiteURL * string `yaml:"website"`
27
+ SupportEmail * string `yaml:"support_email"`
28
+ ContributorStatus * string `yaml:"status"`
30
29
}
31
30
32
31
type contributorProfile struct {
@@ -47,29 +46,6 @@ func validateContributorGithubUsername(githubUsername string) error {
47
46
return nil
48
47
}
49
48
50
- func validateContributorEmployerGithubUsername (employerGithubUsername * string , githubUsername string ) []error {
51
- if employerGithubUsername == nil {
52
- return nil
53
- }
54
-
55
- errs := []error {}
56
- if * employerGithubUsername == "" {
57
- errs = append (errs , errors .New ("company_github field is defined but has empty value" ))
58
- return errs
59
- }
60
-
61
- lower := strings .ToLower (* employerGithubUsername )
62
- if uriSafe := url .PathEscape (lower ); uriSafe != lower {
63
- errs = append (errs , fmt .Errorf ("gitHub company username %q is not a valid URL path segment" , * employerGithubUsername ))
64
- }
65
-
66
- if * employerGithubUsername == githubUsername {
67
- errs = append (errs , fmt .Errorf ("cannot list own GitHub name (%q) as employer" , githubUsername ))
68
- }
69
-
70
- return errs
71
- }
72
-
73
49
func validateContributorDisplayName (displayName string ) error {
74
50
if displayName == "" {
75
51
return fmt .Errorf ("missing display_name" )
@@ -211,9 +187,6 @@ func validateContributorYaml(yml contributorProfile) []error {
211
187
allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
212
188
}
213
189
214
- for _ , err := range validateContributorEmployerGithubUsername (yml .frontmatter .EmployerGithubUsername , yml .frontmatter .GithubUsername ) {
215
- allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
216
- }
217
190
for _ , err := range validateContributorSupportEmail (yml .frontmatter .SupportEmail ) {
218
191
allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
219
192
}
@@ -264,27 +237,13 @@ func parseContributorFiles(readmeEntries []readme) (map[string]contributorProfil
264
237
}
265
238
}
266
239
267
- employeeGithubGroups := map [string ][]string {}
268
240
yamlValidationErrors := []error {}
269
241
for _ , p := range profilesByUsername {
270
242
errors := validateContributorYaml (p )
271
243
if len (errors ) > 0 {
272
244
yamlValidationErrors = append (yamlValidationErrors , errors ... )
273
245
continue
274
246
}
275
-
276
- if p .frontmatter .EmployerGithubUsername != nil {
277
- employeeGithubGroups [* p .frontmatter .EmployerGithubUsername ] = append (
278
- employeeGithubGroups [* p .frontmatter .EmployerGithubUsername ],
279
- p .frontmatter .GithubUsername ,
280
- )
281
- }
282
- }
283
- for companyName , group := range employeeGithubGroups {
284
- if _ , found := profilesByUsername [companyName ]; found {
285
- continue
286
- }
287
- yamlValidationErrors = append (yamlValidationErrors , fmt .Errorf ("%q: company %q does not exist but is referenced by these profiles: [%s]" , rootRegistryPath , companyName , strings .Join (group , ", " )))
288
247
}
289
248
if len (yamlValidationErrors ) != 0 {
290
249
return nil , validationPhaseError {
0 commit comments