Skip to content

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

Merged
merged 3 commits into from
Apr 25, 2025
Merged
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
13 changes: 13 additions & 0 deletions generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ for i in $(ls -1 generator/generated/*.md); do gh issue create --repo kubernetes
You may run into rate limiting issues, which is why this command removes the
files after an issue has been successfully created.

<!--TODO: we probably won't need maintainers.txt longterm-->
To generate the maintainers.txt file for updating with the CNCF re:
https://github.com/kubernetes/steering/issues/281

```bash
make MAINTAINERS_LIST=true
```

This will generate an untracked (not saved in git) maintainers.txt file with a
table in the format requested by the CNCF.
Most contributors will never need to do this.
For more details see the linked steering issue.
<!--END-TODO: we probably won't need maintainers.txt longterm-->

## Adding custom content

Expand Down
57 changes: 57 additions & 0 deletions generator/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,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, "===============================================")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Fprintln(f, "===============================================")
fmt.Fprintln(f, "--|--|--|--|--")

for markdown, is this better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're only generating it to email it to the required maintainers update requests alias, not to create a file here. (It is git ignored), the format isn't going to be rendered and just matches what was requested as closely as possible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense.
/lgtm
/unhold

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 @@ -1153,6 +1205,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