summaryrefslogtreecommitdiff
path: root/generator
diff options
context:
space:
mode:
authorKubernetes Prow Robot <k8s-ci-robot@users.noreply.github.com>2023-02-08 17:24:47 -0800
committerGitHub <noreply@github.com>2023-02-08 17:24:47 -0800
commit38cccebdcc4bdab5c30c881689bd43ab55a5194a (patch)
tree48bc39dda5b879ad64943269aecf9b25dc86cc69 /generator
parent84e98a77f3a82e0c16338838dece4fd20137817e (diff)
parent691e8ba4c058b10efe1bee1926389f6ae9127f22 (diff)
Merge pull request #7096 from cblecker/annual-report-2022
Add annual report templates for 2022
Diffstat (limited to 'generator')
-rw-r--r--generator/annual-report/github_issue.tmpl8
-rw-r--r--generator/annual-report/sig_report.tmpl4
-rw-r--r--generator/app.go27
3 files changed, 30 insertions, 9 deletions
diff --git a/generator/annual-report/github_issue.tmpl b/generator/annual-report/github_issue.tmpl
index b286e3df..b60870f1 100644
--- a/generator/annual-report/github_issue.tmpl
+++ b/generator/annual-report/github_issue.tmpl
@@ -1,7 +1,9 @@
{{lastYear}} Annual Report: {{.Prefix | toUpper}} {{.Name}}
Chairs: {{range .Leadership.Chairs}}@{{.GitHub}} {{end}}
+{{- if.Contact.Liaison.GitHub}}
Liaison: @{{.Contact.Liaison.GitHub}}
+{{- end}}
Actions for the chair/organizer of the community group:
- [ ] Consult your community group to complete draft of report
@@ -13,9 +15,11 @@ Actions for the chair/organizer of the community group:
Once all the above items are complete, this issue may be `/close`'d
+A template has already been generated for your group, and is available [here](https://git.k8s.io/community/{{.Dir}}/annual-report-{{lastYear}}.md).
+
Key dates:
-- Initial PR to communtiy repo should be opened by February 14, {{now.UTC.Year}}
-- PR should be reviewed and merged by March 1st, {{now.UTC.Year}}
+- Initial PR to communtiy repo should be opened by March 24th, {{now.UTC.Year}}
+- PR should be reviewed and merged by April 7th, {{now.UTC.Year}}
More detailed information on the annual reports process is available [here](https://git.k8s.io/community/committee-steering/governance/annual-reports.md).
diff --git a/generator/annual-report/sig_report.tmpl b/generator/annual-report/sig_report.tmpl
index 2b9206e9..830c119e 100644
--- a/generator/annual-report/sig_report.tmpl
+++ b/generator/annual-report/sig_report.tmpl
@@ -16,9 +16,9 @@
{{$releases := getReleases}}
{{$owingsig := .Dir}}
-3. KEP work in {{lastYear}} (v{{$releases.Latest}}, v{{$releases.LatestMinusOne}}, v{{$releases.LatestMinusTwo}}):
+3. KEP work in {{lastYear}} ({{$releases.LatestMinusTwo}}, {{$releases.LatestMinusOne}}, {{$releases.Latest}}):
{{- range $stage, $keps := filterKEPs $owingsig $releases}}
- {{ $stage }}:
+ - {{ $stage }}:
{{- range $keps}}
- [{{.Number}} - {{.Title}}](https://github.com/kubernetes/enhancements/tree/master/keps/{{.OwningSIG}}/{{.Name}}) - {{.LatestMilestone -}}
{{ end}}
diff --git a/generator/app.go b/generator/app.go
index 09986697..9ac82530 100644
--- a/generator/app.go
+++ b/generator/app.go
@@ -43,6 +43,8 @@ import (
"github.com/go-git/go-git/v5/storage/memory"
yaml "gopkg.in/yaml.v3"
+
+ "golang.org/x/mod/semver"
)
const (
@@ -104,9 +106,24 @@ func getLastThreeK8sReleases() (Releases, error) {
return Releases{}, err
}
var result Releases
- result.Latest = strings.Split(strings.TrimPrefix(*releases[0].TagName, "v"), ".")[0] + "." + strings.Split(strings.TrimPrefix(*releases[0].TagName, "v"), ".")[1]
- result.LatestMinusOne = strings.Split(strings.TrimPrefix(*releases[1].TagName, "v"), ".")[0] + "." + strings.Split(strings.TrimPrefix(*releases[1].TagName, "v"), ".")[1]
- result.LatestMinusTwo = strings.Split(strings.TrimPrefix(*releases[2].TagName, "v"), ".")[0] + "." + strings.Split(strings.TrimPrefix(*releases[2].TagName, "v"), ".")[1]
+ for _, release := range releases {
+ if release.GetPrerelease() || release.GetDraft() {
+ continue
+ }
+ if result.Latest == "" {
+ result.Latest = semver.MajorMinor(release.GetTagName())
+ continue
+ }
+ if result.LatestMinusOne == "" {
+ result.LatestMinusOne = semver.MajorMinor(release.GetTagName())
+ continue
+ }
+ if result.LatestMinusTwo == "" {
+ result.LatestMinusTwo = semver.MajorMinor(release.GetTagName())
+ break
+ }
+ }
+
return result, nil
}
@@ -712,7 +729,7 @@ func createAnnualReportIssue(groups []Group, prefix string) error {
outputPath := filepath.Join(outputDir, fmt.Sprintf("%s_%s.md", lastYear(), group.Dir))
templatePath := filepath.Join(baseGeneratorDir, templateDir, annualReportIssueTemplate)
- if err := writeTemplate(templatePath, outputPath, "markdown", group); err != nil {
+ if err := writeTemplate(templatePath, outputPath, "", group); err != nil {
return err
}
}
@@ -756,7 +773,7 @@ func createAnnualReport(groups []Group, prefix string) error {
outputPath := filepath.Join(outputDir, fmt.Sprintf("annual-report-%s.md", lastYear()))
templatePath := filepath.Join(baseGeneratorDir, templateDir, templateFile)
- if err := writeTemplate(templatePath, outputPath, "markdown", group); err != nil {
+ if err := writeTemplate(templatePath, outputPath, "", group); err != nil {
return err
}
}