Skip to content

Commit 1e9bb2a

Browse files
authored
Merge pull request #5514 from cblecker/ar-gen
Add generation function for annual report
2 parents 8582d9f + 97348cb commit 1e9bb2a

File tree

4 files changed

+349
-5
lines changed

4 files changed

+349
-5
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{lastYear}} Annual Report: {{.Prefix | toUpper}} {{.Name}}
2+
3+
Chairs: {{range .Leadership.Chairs}}@{{.GitHub}} {{end}}
4+
Liaison: @{{.Contact.Liaison.GitHub}}
5+
6+
Actions for the chair/organizer of the community group:
7+
- [ ] Consult your community group to complete draft of report
8+
- [ ] If needed, consult with Steering Committee liaison on any private issues or concerns that arrise while completing report
9+
- [ ] Submit PR to git.k8s.io/community repo with copy of report, assigning your Steering Committee liaison for review
10+
- [ ] Steering Committee reviews report, and may make comments/ask questions
11+
- [ ] Once all comments are addressed, Steering Committee will approve report to merge
12+
- [ ] If needed, any follow up items may be brought to the "Chairs, Tech Leads, and Organizers" meeting in April
13+
14+
Once all the above items are complete, this issue may be `/close`'d
15+
16+
Key dates:
17+
- Initial PR to communtiy repo should be opened by March 1st, {{now.UTC.Year}}
18+
- PR should be reviewed and merged by April 1st, {{now.UTC.Year}}
19+
20+
More detailed information on the annual reports process is available [here](https://git.k8s.io/community/committee-steering/governance/annual-reports.md).
21+
22+
If you have any questions or concerns about this process, you may reach the Steering Committee via the following methods:
23+
- Slack/E-mail your liaison directly
24+
- The public #steering-committee channel in Slack
25+
- The public mailing list [email protected]
26+
- The private mailing list [email protected] for any private or sensitive issues.
27+
28+
/{{.Prefix}} {{.Label}}
29+
/committee steering
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# {{lastYear}} Annual Report: {{.Prefix | toUpper}} {{.Name}}
2+
3+
## Current initiatives
4+
5+
1. What work did the SIG do this year that should be highlighted?
6+
7+
-
8+
-
9+
-
10+
11+
2. What initiatives are you working on that aren't being tracked in KEPs?
12+
13+
-
14+
-
15+
-
16+
17+
3. KEP work in {{lastYear}} (1.x, 1.y, 1.z):
18+
19+
<!--
20+
Generated from kubernetes/enhancements kep.yaml files
21+
1. with SIG as owning-sig or in participating-sigs
22+
2. listing 1.x, 1.y, or 1.z in milestones or in latest-milestone
23+
-->
24+
25+
- Stable
26+
- [$kep-number - $title](https://git.k8s.io/community/$link/README.md) - $milestone.stable
27+
- [$kep-number - $title](https://git.k8s.io/community/$link/README.md) - $milestone.stable
28+
- Beta
29+
- [$kep-number - $title](https://git.k8s.io/community/$link/README.md) - $milestone.beta
30+
- [$kep-number - $title](https://git.k8s.io/community/$link/README.md) - $milestone.beta
31+
- Alpha
32+
- [$kep-number - $title](https://git.k8s.io/community/$link/README.md) - $milestone.alpha
33+
- [$kep-number - $title](https://git.k8s.io/community/$link/README.md) - $milestone.alpha
34+
- Pre-alpha
35+
- [$kep-number - $title](https://git.k8s.io/community/$link/README.md)
36+
37+
## Project health
38+
39+
1. What areas and/or subprojects does your group need the most help with?
40+
Any areas with 2 or fewer OWNERs? (link to more details)
41+
42+
-
43+
-
44+
-
45+
46+
2. What metrics/community health stats does your group care about and/or measure?
47+
48+
-
49+
-
50+
-
51+
52+
3. Does your [CONTRIBUTING.md] help **new** contributors engage with your group specifically by pointing
53+
to activities or programs that provide useful context or allow easy participation?
54+
55+
-
56+
57+
4. If your group has special training, requirements for reviewers/approvers, or processes beyond the general [contributor guide],
58+
does your [CONTRIBUTING.md] document those to help **existing** contributors grow throughout the [contributor ladder]?
59+
60+
-
61+
62+
5. Does the group have contributors from multiple companies/affiliations?
63+
64+
-
65+
66+
6. Are there ways end users/companies can contribute that they currently are not?
67+
If one of those ways is more full time support, what would they work on and why?
68+
69+
-
70+
-
71+
72+
## Membership
73+
74+
- Primary slack channel member count:
75+
- Primary mailing list member count:
76+
- Primary meeting attendee count (estimated, if needed):
77+
- Primary meeting participant count (estimated, if needed):
78+
- Unique reviewers for SIG-owned packages: {generated from OWNERS files referenced from subprojects, expanded with OWNERS_ALIASES files}
79+
- Unique approvers for SIG-owned packages: {generated from OWNERS files referenced from subprojects, expanded with OWNERS_ALIASES files}
80+
81+
Include any other ways you measure group membership
82+
83+
## Subprojects
84+
85+
<!--
86+
Generated from delta of sigs.yaml from $YYYY-01-01 to $YYYY-12-31
87+
Manually visible via `git diff HEAD@{$YYYY-01-01} HEAD@{$YYYY-12-31} -- $sig-id/README.md`
88+
-->
89+
90+
New in $YYYY:
91+
- [$subproject-name](https://git.k8s.io/community/$sig-id#$subproject-name)
92+
-
93+
94+
Retired in $YYYY:
95+
- [$subproject-name](https://git.k8s.io/community/$sig-id#$subproject-name)
96+
-
97+
98+
Continuing:
99+
- [$subproject-name](https://git.k8s.io/community/$sig-id#$subproject-name)
100+
-
101+
102+
## Working groups
103+
104+
<!--
105+
Generated from delta of sigs.yaml from $YYYY-01-01 to $YYYY-12-31
106+
Manually visible via `git diff HEAD@{$YYYY-01-01} HEAD@{$YYYY-12-31} -- $sig-id/README.md`
107+
-->
108+
109+
New in $YYYY:
110+
- [$wg-name](https://git.k8s.io/community/$wg-id/) ([$YYYY report](https://git.k8s.io/community/$wg-id/annual-report-$YYYY.md))
111+
-
112+
113+
Retired in $YYYY:
114+
- [$wg-name](https://git.k8s.io/community/$wg-id/) ([$YYYY report](https://git.k8s.io/community/$wg-id/annual-report-$YYYY.md))
115+
-
116+
117+
Continuing:
118+
- [$wg-name](https://git.k8s.io/community/$wg-id/) ([$YYYY report](https://git.k8s.io/community/$wg-id/annual-report-$YYYY.md))
119+
-
120+
121+
## Operational
122+
123+
Operational tasks in [sig-governance.md]:
124+
125+
[ ] [README.md] reviewed for accuracy and updated if needed
126+
[ ] [CONTRIBUTING.md] reviewed for accuracy and updated if needed
127+
(or created if missing and your contributor steps and experience are different or more
128+
in-depth than the documentation listed in the general [contributor guide] and [devel] folder.)
129+
[ ] Subprojects list and linked OWNERS files in [sigs.yaml] reviewed for accuracy and updated if needed
130+
[ ] SIG leaders (chairs, tech leads, and subproject owners) in [sigs.yaml] are accurate and active, and updated if needed
131+
[ ] Meeting notes and recordings for {{lastYear}} are linked from [README.md] and updated/uploaded if needed
132+
[ ] Did you have community-wide updates in {{lastYear}} (e.g. community meetings, kubecon, or kubernetes-dev@ emails)? Links to email, slides, or recordings:
133+
-
134+
-
135+
136+
[CONTRIBUTING.md]: https://git.k8s.io/community/{{.Dir}}/CONTRIBUTING.md
137+
[contributor ladder]: https://git.k8s.io/community/community-membership.md
138+
[sig-governance.md]: https://git.k8s.io/community/committee-steering/governance/sig-governance.md
139+
[README.md]: https://git.k8s.io/community/{{.Dir}}/README.md
140+
[sigs.yaml]: https://git.k8s.io/community/sigs.yaml
141+
[contributor guide]: https://git.k8s.io/community/contributors/guide/README.md
142+
[devel]: https://git.k8s.io/community/contributors/devel/README.md
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# {{lastYear}} Annual Report: {{.Prefix | toUpper}} {{.Name}}
2+
3+
## Current initiatives
4+
5+
1. What work did the WG do this year that should be highlighted?
6+
For example, artifacts, reports, white papers produced this year.
7+
8+
-
9+
-
10+
-
11+
12+
2. What initiatives are you working on that aren't being tracked in KEPs?
13+
14+
-
15+
-
16+
-
17+
18+
## Project health
19+
20+
1. What's the current roadmap until completion of the working group?
21+
22+
-
23+
-
24+
-
25+
26+
2. Does the group have contributors from multiple companies/affiliations?
27+
28+
-
29+
30+
3. Are there ways end users/companies can contribute that they currently are not?
31+
If one of those ways is more full time support, what would they work on and why?
32+
33+
-
34+
-
35+
36+
## Membership
37+
38+
- Primary slack channel member count:
39+
- Primary mailing list member count:
40+
- Primary meeting attendee count (estimated, if needed):
41+
- Primary meeting participant count (estimated, if needed):
42+
43+
Include any other ways you measure group membership
44+
45+
## Operational
46+
47+
Operational tasks in [wg-governance.md]:
48+
49+
[ ] [README.md] reviewed for accuracy and updated if needed
50+
[ ] WG leaders in [sigs.yaml] are accurate and active, and updated if needed
51+
[ ] Meeting notes and recordings for {{lastYear}} are linked from [README.md] and updated/uploaded if needed
52+
[ ] Updates provided to sponsoring SIGs in {{lastYear}}
53+
- [$sig-name](https://git.k8s.io/community/$sig-id/)
54+
- links to email, meeting notes, slides, or recordings, etc
55+
- [$sig-name](https://git.k8s.io/community/$sig-id/)
56+
- links to email, meeting notes, slides, or recordings, etc
57+
-
58+
59+
[wg-governance.md]: https://git.k8s.io/community/committee-steering/governance/wg-governance.md
60+
[README.md]: https://git.k8s.io/community/{{.Dir}}/README.md
61+
[sigs.yaml]: https://git.k8s.io/community/sigs.yaml

generator/app.go

Lines changed: 117 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,20 @@ import (
2727
"sort"
2828
"strings"
2929
"text/template"
30+
"time"
3031

3132
yaml "gopkg.in/yaml.v3"
3233
)
3334

3435
const (
35-
readmeTemplate = "readme.tmpl"
36-
listTemplate = "list.tmpl"
37-
aliasesTemplate = "aliases.tmpl"
38-
liaisonsTemplate = "liaisons.tmpl"
39-
headerTemplate = "header.tmpl"
36+
readmeTemplate = "readme.tmpl"
37+
listTemplate = "list.tmpl"
38+
aliasesTemplate = "aliases.tmpl"
39+
liaisonsTemplate = "liaisons.tmpl"
40+
headerTemplate = "header.tmpl"
41+
annualReportIssueTemplate = "annual-report/github_issue.tmpl"
42+
annualReportSIGTemplate = "annual-report/sig_report.tmpl"
43+
annualReportWGTemplate = "annual-report/wg_report.tmpl"
4044

4145
sigsYamlFile = "sigs.yaml"
4246
sigListOutput = "sig-list.md"
@@ -155,6 +159,7 @@ func (g *LeadershipGroup) Owners() []Person {
155159
// Group represents either a Special Interest Group (SIG) or a Working Group (WG)
156160
type Group struct {
157161
Dir string
162+
Prefix string `yaml:",omitempty"`
158163
Name string
159164
MissionStatement FoldedString `yaml:"mission_statement,omitempty"`
160165
CharterLink string `yaml:"charter_link,omitempty"`
@@ -377,6 +382,14 @@ var funcMap = template.FuncMap{
377382
"trimSuffix": strings.TrimSuffix,
378383
"githubURL": githubURL,
379384
"orgRepoPath": orgRepoPath,
385+
"now": time.Now,
386+
"lastYear": lastYear,
387+
"toUpper": strings.ToUpper,
388+
}
389+
390+
// lastYear returns the last year as a string
391+
func lastYear() string {
392+
return time.Now().AddDate(-1, 0, 0).Format("2006")
380393
}
381394

382395
// githubURL converts a raw GitHub url (links directly to file contents) into a
@@ -510,6 +523,91 @@ func createGroupReadme(groups []Group, prefix string) error {
510523
return nil
511524
}
512525

526+
func createAnnualReportIssue(groups []Group, prefix string) error {
527+
// figure out if the user wants to generate one group
528+
var selectedGroupName *string
529+
if envVal, ok := os.LookupEnv("WHAT"); ok {
530+
selectedGroupName = &envVal
531+
}
532+
533+
for _, group := range groups {
534+
switch prefix {
535+
case "sig":
536+
group.Prefix = "sig"
537+
case "wg":
538+
group.Prefix = "wg"
539+
default:
540+
continue
541+
542+
}
543+
544+
outputDir := filepath.Join(baseGeneratorDir, "generator/generated")
545+
546+
// skip generation if the user specified only one group
547+
if selectedGroupName != nil && !strings.HasSuffix(group.Dir, *selectedGroupName) {
548+
fmt.Printf("Skipping %s/%s_%s.md\n", outputDir, lastYear(), group.Dir)
549+
continue
550+
}
551+
552+
fmt.Printf("Generating %s/%s_%s.md\n", outputDir, lastYear(), group.Dir)
553+
if err := createDirIfNotExists(outputDir); err != nil {
554+
return err
555+
}
556+
557+
outputPath := filepath.Join(outputDir, fmt.Sprintf("%s_%s.md", lastYear(), group.Dir))
558+
templatePath := filepath.Join(baseGeneratorDir, templateDir, annualReportIssueTemplate)
559+
if err := writeTemplate(templatePath, outputPath, "markdown", group); err != nil {
560+
return err
561+
}
562+
}
563+
564+
return nil
565+
}
566+
567+
func createAnnualReport(groups []Group, prefix string) error {
568+
// figure out if the user wants to generate one group
569+
var selectedGroupName *string
570+
var templateFile string
571+
if envVal, ok := os.LookupEnv("WHAT"); ok {
572+
selectedGroupName = &envVal
573+
}
574+
575+
for _, group := range groups {
576+
switch prefix {
577+
case "sig":
578+
group.Prefix = "sig"
579+
templateFile = annualReportSIGTemplate
580+
case "wg":
581+
group.Prefix = "wg"
582+
templateFile = annualReportWGTemplate
583+
default:
584+
continue
585+
586+
}
587+
588+
outputDir := filepath.Join(baseGeneratorDir, group.Dir)
589+
590+
// skip generation if the user specified only one group
591+
if selectedGroupName != nil && !strings.HasSuffix(group.Dir, *selectedGroupName) {
592+
fmt.Printf("Skipping %s/annual-report-%s.md\n", outputDir, lastYear())
593+
continue
594+
}
595+
596+
fmt.Printf("Generating %s/annual-report-%s.md\n", outputDir, lastYear())
597+
if err := createDirIfNotExists(outputDir); err != nil {
598+
return err
599+
}
600+
601+
outputPath := filepath.Join(outputDir, fmt.Sprintf("annual-report-%s.md", lastYear()))
602+
templatePath := filepath.Join(baseGeneratorDir, templateDir, templateFile)
603+
if err := writeTemplate(templatePath, outputPath, "markdown", group); err != nil {
604+
return err
605+
}
606+
}
607+
608+
return nil
609+
}
610+
513611
// readSigsYaml decodes yaml stored in a file at path into the
514612
// specified yaml.Node
515613
func readYaml(path string, data interface{}) error {
@@ -570,6 +668,20 @@ func main() {
570668
}
571669
}
572670

671+
if envVal, ok := os.LookupEnv("ANNUAL_REPORT"); ok && envVal == "true" {
672+
fmt.Println("Generating annual reports")
673+
for prefix, groups := range ctx.PrefixToGroupMap() {
674+
err = createAnnualReportIssue(groups, prefix)
675+
if err != nil {
676+
log.Fatal(err)
677+
}
678+
err = createAnnualReport(groups, prefix)
679+
if err != nil {
680+
log.Fatal(err)
681+
}
682+
}
683+
}
684+
573685
fmt.Println("Generating sig-list.md")
574686
outputPath := filepath.Join(baseGeneratorDir, sigListOutput)
575687
err = writeTemplate(filepath.Join(baseGeneratorDir, templateDir, listTemplate), outputPath, "markdown", ctx)

0 commit comments

Comments
 (0)