Skip to content

WIP: generate maintainers table for cncf #8417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
._*

Expand Down
57 changes: 57 additions & 0 deletions generator/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,58 @@ 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, "===============================================")
keys := []string{}
for gh := range maintainers {
keys = append(keys, gh)
}
sort.Strings(keys)
for _, gh := range keys {
m := maintainers[gh]
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
Expand Down Expand Up @@ -1148,6 +1200,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)
Expand Down