diff options
| author | Kubernetes Submit Queue <k8s-merge-robot@users.noreply.github.com> | 2017-11-26 12:05:14 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-26 12:05:14 -0800 |
| commit | 0976be875c69215129b684e96684ca9b8a316911 (patch) | |
| tree | 3425dd2b63c4741a3b410b9482639ea92833d9e5 /generator | |
| parent | 22d4ad7e3dd58270ad741ad7d9e18c159ce5632f (diff) | |
| parent | 5baa99dbf65146bacb67267e2030fa2334146fc1 (diff) | |
Merge pull request #1433 from cblecker/github-teams
Automatic merge from submit-queue.
List teams for each sig in sig docs
fixes #702, fixes #677
This adds a listing of all the teams for each sig to the sig docs. This helps for things like mentioning them in issues, as they're only visible to org members.
Note that this is manually generated. I know this isn't optimal, but I don't want to restrict docs generation to only those in the org.
Diffstat (limited to 'generator')
| -rw-r--r-- | generator/app.go | 32 | ||||
| -rw-r--r-- | generator/app_test.go | 30 | ||||
| -rw-r--r-- | generator/sig_readme.tmpl | 16 | ||||
| -rw-r--r-- | generator/wg_readme.tmpl | 16 |
4 files changed, 31 insertions, 63 deletions
diff --git a/generator/app.go b/generator/app.go index 3c6c144d..da75b16c 100644 --- a/generator/app.go +++ b/generator/app.go @@ -46,8 +46,6 @@ const ( var ( baseGeneratorDir = "" templateDir = "generator" - - githubTeamNames = []string{"misc", "test-failures", "bugs", "feature-requests", "proposals", "pr-reviews", "api-reviews"} ) // Lead represents a lead engineer for a particular group. There are usually @@ -68,11 +66,15 @@ type Meeting struct { // Contact represents the various contact points for a group. type Contact struct { - Slack string - MailingList string `yaml:"mailing_list"` - FullGitHubTeams bool `yaml:"full_github_teams"` - GithubTeamPrefix string `yaml:"github_team_prefix"` - GithubTeamNames []string + Slack string + MailingList string `yaml:"mailing_list"` + GithubTeams []GithubTeams `yaml:"teams"` +} + +// GithubTeams represents a specific Github Team. +type GithubTeams struct { + Name string + Description string } // Group represents either a Special Interest Group (SIG) or a Working Group (WG) @@ -96,20 +98,6 @@ func (e *Group) DirName(prefix string) string { return fmt.Sprintf("%s-%s", prefix, strings.ToLower(strings.Replace(e.Name, " ", "-", -1))) } -// SetupGitHubTeams will iterate over all the possible teams available to a -// group (these are defined by the Kubernetes organization) and populate a -// list using the group's prefix. -func (e *Group) SetupGitHubTeams(prefix string) { - ghPrefix := e.Contact.GithubTeamPrefix - if ghPrefix == "" { - ghPrefix = e.DirName(prefix) - } - - for _, gtn := range githubTeamNames { - e.Contact.GithubTeamNames = append(e.Contact.GithubTeamNames, fmt.Sprintf("%s-%s", ghPrefix, gtn)) - } -} - // Context is the context for the sigs.yaml file. type Context struct { Sigs []Group @@ -239,8 +227,6 @@ func createGroupReadme(groups []Group, prefix string) error { return err } - group.SetupGitHubTeams(prefix) - outputPath := filepath.Join(outputDir, indexFilename) readmePath := filepath.Join(baseGeneratorDir, templateDir, fmt.Sprintf("%s_%s", prefix, readmeTemplate)) if err := writeTemplate(readmePath, outputPath, group); err != nil { diff --git a/generator/app_test.go b/generator/app_test.go index b282a3f2..965e0d47 100644 --- a/generator/app_test.go +++ b/generator/app_test.go @@ -17,11 +17,9 @@ limitations under the License. package main import ( - "fmt" "io/ioutil" "os" "path/filepath" - "reflect" "strings" "testing" ) @@ -150,34 +148,6 @@ func TestGroupDirName(t *testing.T) { } } -func TestSetupGithubTeams(t *testing.T) { - group := Group{Name: "Foo Bar"} - group.SetupGitHubTeams("sig") - - var expected []string - for _, ght := range githubTeamNames { - expected = append(expected, fmt.Sprintf("sig-foo-bar-%s", ght)) - } - - if !reflect.DeepEqual(group.Contact.GithubTeamNames, expected) { - t.Fatalf("%v does not match %v", group.Contact.GithubTeamNames, expected) - } -} - -func TestCustomPrefixSetupGithubTeams(t *testing.T) { - group := Group{Contact: Contact{GithubTeamPrefix: "foo"}} - group.SetupGitHubTeams("") - - var expected []string - for _, ght := range githubTeamNames { - expected = append(expected, fmt.Sprintf("foo-%s", ght)) - } - - if !reflect.DeepEqual(group.Contact.GithubTeamNames, expected) { - t.Fatalf("%v does not match %v", group.Contact.GithubTeamNames, expected) - } -} - func TestCreateGroupReadmes(t *testing.T) { baseGeneratorDir = "generated" templateDir = "../../generator" diff --git a/generator/sig_readme.tmpl b/generator/sig_readme.tmpl index 755b6938..2af46a52 100644 --- a/generator/sig_readme.tmpl +++ b/generator/sig_readme.tmpl @@ -25,9 +25,15 @@ Meeting recordings can be found [here]({{.MeetingRecordingsURL}}). {{- if .Label }} * [Open Community Issues/PRs](https://github.com/kubernetes/community/labels/sig%2F{{.Label}}) {{- end }} -{{if .Contact.FullGitHubTeams}} +{{ if .Contact.GithubTeams }} ## GitHub Teams -{{range .Contact.GithubTeamNames -}} -* [@{{.}}](https://github.com/kubernetes/teams/{{.}}) -{{end}} -{{end}} + +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/generator/wg_readme.tmpl b/generator/wg_readme.tmpl index 40ec00a1..cd9cc2fd 100644 --- a/generator/wg_readme.tmpl +++ b/generator/wg_readme.tmpl @@ -25,9 +25,15 @@ Meeting recordings can be found [here]({{.MeetingRecordingsURL}}). {{- if .Label }} * [Open Community Issues/PRs](https://github.com/kubernetes/community/labels/wg%2F{{.Label}}) {{- end }} -{{if .Contact.FullGitHubTeams}} +{{ if .Contact.GithubTeams }} ## GitHub Teams -{{range .Contact.GithubTeamNames -}} -* [@{{.}}](https://github.com/kubernetes/teams/{{.}}) -{{end}} -{{end}} + +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 }} |
