summaryrefslogtreecommitdiff
path: root/generator/app.go
diff options
context:
space:
mode:
authorChristoph Blecker <admin@toph.ca>2017-11-26 09:00:05 -0800
committerChristoph Blecker <admin@toph.ca>2017-11-26 09:06:48 -0800
commit7f9a5c5376abf368270ee413ce4810deedfb8424 (patch)
tree456465749a10d900b7214ff70fcb324be7037097 /generator/app.go
parentaaab6d7ff79a1e6f360da9df3f10ed5cfbc2b7fb (diff)
Use teams array to generate Github Team list
Diffstat (limited to 'generator/app.go')
-rw-r--r--generator/app.go32
1 files changed, 9 insertions, 23 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 {