WIP: generate maintainers table for cncf

This commit is contained in:
Benjamin Elder 2025-04-10 17:00:25 -07:00
parent b51e2a3bce
commit c04d241bd0
2 changed files with 55 additions and 0 deletions

4
.gitignore vendored
View File

@ -1,3 +1,7 @@
# this file contains information that we don't want to further surface for
# scraping but do generate locally
maintainers.txt
# OSX leaves these everywhere on SMB shares
._*

View File

@ -1100,6 +1100,52 @@ func prepForAnnualReportGeneration() error {
return nil
}
func generateCNCFMaintainersList(ctx *Context) error {
maintainers := map[string]Person{}
serviceDesk := map[string]bool{}
for _, group := range ctx.Committees {
if group.Name == "Steering" {
for _, member := range group.Leadership.Chairs {
maintainers[member.GitHub] = member
serviceDesk[member.GitHub] = true
}
}
}
for _, sig := range ctx.Sigs {
// these groups retain service desk access in addition to steering
// as outlined in https://github.com/kubernetes/steering/issues/281
isServiceDesk := sig.Name == "Contributor Experience" || sig.Name == "K8s Infra" || sig.Name == "Release"
for _, chair := range sig.Leadership.Chairs {
maintainers[chair.GitHub] = chair
// only set service desk true as needed, do not override to false
// in case of maintainers spanning groups
if isServiceDesk {
serviceDesk[chair.Name] = true
}
}
for _, tl := range sig.Leadership.TechnicalLeads {
maintainers[tl.GitHub] = tl
// only set service desk true as needed, do not override to false
// in case of maintainers spanning groups
if isServiceDesk {
serviceDesk[tl.Name] = true
}
}
}
outputPath := filepath.Join(baseGeneratorDir, "maintainers.txt")
f, err := os.Create(outputPath)
if err != nil {
return err
}
defer f.Close()
fmt.Fprintln(f, "name | company | github | email | service-desk?")
fmt.Fprintln(f, "===============================================")
for _, m := range maintainers {
fmt.Fprintf(f, "%s | %s | %s | %s | %t\n", m.Name, m.Company, m.GitHub, m.Email, serviceDesk[m.GitHub])
}
return nil
}
func main() {
yamlPath := filepath.Join(baseGeneratorDir, sigsYamlFile)
var ctx Context
@ -1153,6 +1199,11 @@ func main() {
}
}
if envVal, ok := os.LookupEnv("MAINTAINERS_LIST"); ok && envVal == "true" {
fmt.Println("Generating CNCF maintainers list")
generateCNCFMaintainersList(&ctx)
}
fmt.Println("Generating sig-list.md")
outputPath := filepath.Join(baseGeneratorDir, sigListOutput)
err = writeTemplate(filepath.Join(baseGeneratorDir, templateDir, listTemplate), outputPath, "markdown", ctx)