From 1816b3e406e1ce77a347a46d77b28e5618164d25 Mon Sep 17 00:00:00 2001 From: Nikhita Raghunath Date: Mon, 25 Feb 2019 00:25:14 +0530 Subject: [PATCH] Add support for User Groups in sigs.yaml --- generator/README.md | 2 ++ generator/app.go | 10 +++++++ generator/list.tmpl | 10 +++++++ generator/ug_readme.tmpl | 49 +++++++++++++++++++++++++++++++++++ hack/verify-generated-docs.sh | 2 +- 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 generator/ug_readme.tmpl diff --git a/generator/README.md b/generator/README.md index 31742492ce2..2c5ef157c64 100644 --- a/generator/README.md +++ b/generator/README.md @@ -13,6 +13,7 @@ The documentation follows a template and uses the values from [`sigs.yaml`](/sig - List: [`list.tmpl`](list.tmpl) - SIG README: [`sig_readme.tmpl`](sig_readme.tmpl) - WG README: [`wg_readme.tmpl`](wg_readme.tmpl) +- UG README: [`ug_readme.tmpl`](ug_readme.tmpl) **Time Zone gotcha**: Time zones make everything complicated. @@ -28,6 +29,7 @@ accompanying documentation. This takes the format of three types of doc files: ``` sig-/README.md wg-/README.md +ug-/README.md sig-list.md ``` diff --git a/generator/app.go b/generator/app.go index da6b4a71e54..0b17b100a3c 100644 --- a/generator/app.go +++ b/generator/app.go @@ -124,6 +124,7 @@ func (e *Group) DirName(prefix string) string { type Context struct { Sigs []Group WorkingGroups []Group + UserGroups []Group } func pathExists(path string) bool { @@ -305,6 +306,10 @@ func main() { return strings.ToLower(ctx.WorkingGroups[i].Name) <= strings.ToLower(ctx.WorkingGroups[j].Name) }) + sort.Slice(ctx.UserGroups, func(i, j int) bool { + return strings.ToLower(ctx.UserGroups[i].Name) <= strings.ToLower(ctx.UserGroups[j].Name) + }) + err = createGroupReadme(ctx.Sigs, "sig") if err != nil { log.Fatal(err) @@ -315,6 +320,11 @@ func main() { log.Fatal(err) } + err = createGroupReadme(ctx.UserGroups, "ug") + if err != nil { + log.Fatal(err) + } + fmt.Println("Generating sig-list.md") outputPath := filepath.Join(baseGeneratorDir, sigListOutput) err = writeTemplate(filepath.Join(baseGeneratorDir, templateDir, listTemplate), outputPath, "markdown", ctx) diff --git a/generator/list.tmpl b/generator/list.tmpl index f316f75d9b4..1f7b294690b 100644 --- a/generator/list.tmpl +++ b/generator/list.tmpl @@ -34,3 +34,13 @@ When the need arises, a [new SIG can be created](sig-creation-procedure.md) {{- range .WorkingGroups}} |[{{.Name}}]({{.Dir}}/README.md)|{{range .StakeholderSIGs}}* {{.}}
{{end }}|{{range .Leadership.Chairs}}* [{{.Name}}](https://github.com/{{.GitHub}}){{if .Company}}, {{.Company}}{{end}}
{{end}}|* [Slack](https://kubernetes.slack.com/messages/{{.Contact.Slack}})
* [Mailing List]({{.Contact.MailingList}})|{{range .Meetings}}* {{.Description}}: [{{.Day}}s at {{.Time}} {{.TZ}} ({{.Frequency}})]({{.URL}})
{{end}} {{- end }} +{{- /* TODO: remove the below condition when at least one user group has been added */}} +{{ if .UserGroups }} +### Master User Group List + +| Name | Organizers | Contact | Meetings | +|------|------------|---------|----------| +{{- range .UserGroups}} +|[{{.Name}}]({{.Dir}}/README.md)|{{range .Leadership.Chairs}}* [{{.Name}}](https://github.com/{{.GitHub}}){{if .Company}}, {{.Company}}{{end}}
{{end}}|* [Slack](https://kubernetes.slack.com/messages/{{.Contact.Slack}})
* [Mailing List]({{.Contact.MailingList}})|{{range .Meetings}}* {{.Description}}: [{{.Day}}s at {{.Time}} {{.TZ}} ({{.Frequency}})]({{.URL}})
{{end}} +{{- end }} +{{ end }} \ No newline at end of file diff --git a/generator/ug_readme.tmpl b/generator/ug_readme.tmpl new file mode 100644 index 00000000000..e665f0e8248 --- /dev/null +++ b/generator/ug_readme.tmpl @@ -0,0 +1,49 @@ +{{- template "header" }} +# {{.Name}} User Group + +{{ .MissionStatement }} +{{- if .CharterLink }} +The [charter]({{.CharterLink}}) defines the scope and governance of the {{.Name}} User Group. +{{ end }} +{{ if .Meetings -}} +## Meetings +{{- range .Meetings }} +* {{.Description}}: [{{.Day}}s at {{.Time}} {{.TZ}}]({{.URL}}) ({{.Frequency}}). [Convert to your timezone](http://www.thetimezoneconverter.com/?t={{.Time}}&tz={{.TZ | tzUrlEncode}}). +{{- if .ArchiveURL }} + * [Meeting notes and Agenda]({{.ArchiveURL}}). +{{- end }} +{{- if .RecordingsURL }} + * [Meeting recordings]({{.RecordingsURL}}). +{{- end }} +{{- end }} + +{{- end }} +{{- if .Leadership }} +{{- if .Leadership.Chairs }} + +## Organizers +{{ range .Leadership.Chairs }} +* {{.Name}} (**[@{{.GitHub}}](https://github.com/{{.GitHub}})**){{if .Company}}, {{.Company}}{{end}} +{{- end }} +{{- end }} +{{- end }} + +## Contact +* [Slack](https://kubernetes.slack.com/messages/{{.Contact.Slack}}) +* [Mailing list]({{.Contact.MailingList}}) +{{- if .Label }} +* [Open Community Issues/PRs](https://github.com/kubernetes/community/labels/ug%2F{{.Label}}) +{{- end }} + +{{ if .Contact.GithubTeams }} +## GitHub Teams + +The below teams can be mentioned on issues and PRs in order to get attention from the right people. +Note that the links to display team membership will only work if you are a member of the org. + +| Team Name | Details | Description | +| --------- |:-------:| ----------- | +{{- range .Contact.GithubTeams }} +| @kubernetes/{{.Name}} | [link](https://github.com/orgs/kubernetes/teams/{{.Name}}) | {{.Description}} | +{{- end }} +{{ end }} diff --git a/hack/verify-generated-docs.sh b/hack/verify-generated-docs.sh index 843541ba17b..fab0cae72d6 100755 --- a/hack/verify-generated-docs.sh +++ b/hack/verify-generated-docs.sh @@ -37,7 +37,7 @@ make 1>/dev/null mismatches=0 break=$(printf "=%.0s" $(seq 1 68)) -for file in $(ls ${CRT_DIR}/sig-*/README.md ${CRT_DIR}/wg-*/README.md ${CRT_DIR}/sig-list.md ${CRT_DIR}/OWNERS_ALIASES); do +for file in $(ls ${CRT_DIR}/sig-*/README.md ${CRT_DIR}/wg-*/README.md ${CRT_DIR}/ug-*/README.md ${CRT_DIR}/sig-list.md ${CRT_DIR}/OWNERS_ALIASES); do real=${file#$CRT_DIR/} if ! diff -q ${file} ${WORKING_DIR}/${real} &>/dev/null; then echo "${file} does not match ${WORKING_DIR}/${real}";