Skip to content

Commit 9fb7dda

Browse files
authored
Merge pull request #6405 from liggitt/wg-in-sig-readme
Cross-link SIG and WG readmes
2 parents ae6a672 + 099a722 commit 9fb7dda

File tree

35 files changed

+234
-37
lines changed

35 files changed

+234
-37
lines changed

generator/app.go

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,36 @@ type Group struct {
163163
Name string
164164
MissionStatement FoldedString `yaml:"mission_statement,omitempty"`
165165
CharterLink string `yaml:"charter_link,omitempty"`
166-
StakeholderSIGs []string `yaml:"stakeholder_sigs,omitempty"`
166+
ReportingWGs []WGName `yaml:"-"` // populated by Context#Complete()
167+
StakeholderSIGs []SIGName `yaml:"stakeholder_sigs,omitempty"`
167168
Label string
168169
Leadership LeadershipGroup `yaml:"leadership"`
169170
Meetings []Meeting
170171
Contact Contact
171172
Subprojects []Subproject `yaml:",omitempty"`
172173
}
173174

175+
type WGName string
176+
177+
func (n WGName) DirName() string {
178+
return DirName("wg", string(n))
179+
}
180+
181+
type SIGName string
182+
183+
func (n SIGName) DirName() string {
184+
return DirName("sig", string(n))
185+
}
186+
174187
// DirName returns the directory that a group's documentation will be
175188
// generated into. It is composed of a prefix (sig for SIGs and wg for WGs),
176189
// and a formatted version of the group's name (in kebab case).
177190
func (g *Group) DirName(prefix string) string {
178-
return fmt.Sprintf("%s-%s", prefix, strings.ToLower(strings.Replace(g.Name, " ", "-", -1)))
191+
return DirName(prefix, g.Name)
192+
}
193+
194+
func DirName(prefix, name string) string {
195+
return fmt.Sprintf("%s-%s", prefix, strings.ToLower(strings.Replace(name, " ", "-", -1)))
179196
}
180197

181198
// LabelName returns the expected label for a given group
@@ -210,14 +227,33 @@ func (c *Context) PrefixToGroupMap() map[string][]Group {
210227
}
211228
}
212229

230+
// Complete populates derived portions of the Context struct
231+
func (c *Context) Complete() {
232+
// Copy working group names into ReportingWGs list of their stakeholder sigs
233+
for _, wg := range c.WorkingGroups {
234+
for _, stakeholderSIG := range wg.StakeholderSIGs {
235+
for i, sig := range c.Sigs {
236+
if sig.Name == string(stakeholderSIG) {
237+
c.Sigs[i].ReportingWGs = append(c.Sigs[i].ReportingWGs, WGName(wg.Name))
238+
}
239+
}
240+
}
241+
}
242+
}
243+
213244
// Sort sorts all lists within the Context struct
214245
func (c *Context) Sort() {
215246
for _, groups := range c.PrefixToGroupMap() {
216247
sort.Slice(groups, func(i, j int) bool {
217248
return groups[i].Dir < groups[j].Dir
218249
})
219250
for _, group := range groups {
220-
sort.Strings(group.StakeholderSIGs)
251+
sort.Slice(group.ReportingWGs, func(i, j int) bool {
252+
return group.ReportingWGs[i] < group.ReportingWGs[j]
253+
})
254+
sort.Slice(group.StakeholderSIGs, func(i, j int) bool {
255+
return group.StakeholderSIGs[i] < group.StakeholderSIGs[j]
256+
})
221257
for _, people := range [][]Person{
222258
group.Leadership.Chairs,
223259
group.Leadership.TechnicalLeads,
@@ -282,16 +318,31 @@ func (c *Context) Validate() []error {
282318
}
283319
}
284320
}
321+
if len(group.ReportingWGs) != 0 {
322+
if prefix == "sig" {
323+
for _, name := range group.ReportingWGs {
324+
if index(c.WorkingGroups, func(g Group) bool { return g.Name == string(name) }) == -1 {
325+
errors = append(errors, fmt.Errorf("%s: invalid reporting working group name %s", group.Dir, name))
326+
}
327+
}
328+
} else {
329+
errors = append(errors, fmt.Errorf("%s: only SIGs may have reporting WGs", group.Dir))
330+
}
331+
}
285332
if len(group.StakeholderSIGs) != 0 {
286333
if prefix == "wg" {
287334
for _, name := range group.StakeholderSIGs {
288-
if index(c.Sigs, func(g Group) bool { return g.Name == name }) == -1 {
335+
if index(c.Sigs, func(g Group) bool { return g.Name == string(name) }) == -1 {
289336
errors = append(errors, fmt.Errorf("%s: invalid stakeholder sig name %s", group.Dir, name))
290337
}
291338
}
292339
} else {
293340
errors = append(errors, fmt.Errorf("%s: only WGs may have stakeholder_sigs", group.Dir))
294341
}
342+
} else {
343+
if prefix == "wg" {
344+
errors = append(errors, fmt.Errorf("%s: WGs must have stakeholder_sigs", group.Dir))
345+
}
295346
}
296347
if prefix == "sig" {
297348
if group.CharterLink == "" {
@@ -643,6 +694,8 @@ func main() {
643694
log.Fatal(err)
644695
}
645696

697+
ctx.Complete()
698+
646699
ctx.Sort()
647700

648701
fmt.Printf("Validating %s\n", yamlPath)

generator/sig_readme.tmpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ subprojects, and resolve cross-subproject technical issues and decisions.
6868
- Steering Committee Liaison: {{.Contact.Liaison.Name}} (**[@{{.Contact.Liaison.GitHub}}](https://github.com/{{.Contact.Liaison.GitHub}})**)
6969
{{- end }}
7070

71+
{{- if .ReportingWGs }}
72+
73+
## Working Groups
74+
75+
The following [working groups][working-group-definition] are sponsored by sig-{{.Label}}:
76+
77+
{{- range .ReportingWGs }}
78+
* [WG {{.}}](/{{.DirName}})
79+
{{- end }}
80+
{{ end }}
81+
7182
{{- if .Subprojects }}
7283

7384
## Subprojects
@@ -114,3 +125,4 @@ The following [subprojects][subproject-definition] are owned by sig-{{.Label}}:
114125
{{- end }}
115126

116127
[subproject-definition]: https://github.com/kubernetes/community/blob/master/governance.md#subprojects
128+
[working-group-definition]: https://github.com/kubernetes/community/blob/master/governance.md#working-groups

generator/wg_readme.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The [charter]({{.CharterLink}}) defines the scope and governance of the {{.Name}
88
{{- if .StakeholderSIGs }}
99
## Stakeholder SIGs
1010
{{- range .StakeholderSIGs }}
11-
* SIG {{.}}
11+
* [SIG {{.}}](/{{.DirName}})
1212
{{- end }}
1313
{{ end }}
1414
{{ if .Meetings -}}

sig-api-machinery/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ subprojects, and resolve cross-subproject technical issues and decisions.
4949
- [@kubernetes/sig-api-machinery-test-failures](https://github.com/orgs/kubernetes/teams/sig-api-machinery-test-failures) - Test Failures and Triage
5050
- Steering Committee Liaison: Davanum Srinivas (**[@dims](https://github.com/dims)**)
5151

52+
## Working Groups
53+
54+
The following [working groups][working-group-definition] are sponsored by sig-api-machinery:
55+
* [WG API Expression](/wg-api-expression)
56+
* [WG Multitenancy](/wg-multitenancy)
57+
* [WG Structured Logging](/wg-structured-logging)
58+
59+
5260
## Subprojects
5361

5462
The following [subprojects][subproject-definition] are owned by sig-api-machinery:
@@ -139,6 +147,7 @@ The following [subprojects][subproject-definition] are owned by sig-api-machiner
139147
- [kubernetes-sigs/yaml](https://github.com/kubernetes-sigs/yaml/blob/master/OWNERS)
140148

141149
[subproject-definition]: https://github.com/kubernetes/community/blob/master/governance.md#subprojects
150+
[working-group-definition]: https://github.com/kubernetes/community/blob/master/governance.md#working-groups
142151
<!-- BEGIN CUSTOM CONTENT -->
143152
## Additional links
144153

sig-apps/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ The Chairs of the SIG run operations and processes governing the SIG.
4646
- [@kubernetes/sig-apps-test-failures](https://github.com/orgs/kubernetes/teams/sig-apps-test-failures) - Test Failures and Triage
4747
- Steering Committee Liaison: Bob Killen (**[@mrbobbytables](https://github.com/mrbobbytables)**)
4848

49+
## Working Groups
50+
51+
The following [working groups][working-group-definition] are sponsored by sig-apps:
52+
* [WG Data Protection](/wg-data-protection)
53+
54+
4955
## Subprojects
5056

5157
The following [subprojects][subproject-definition] are owned by sig-apps:
@@ -94,6 +100,7 @@ The core workloads API, which is composed of the CronJob, DaemonSet, Deployment,
94100
- [kubernetes/kubernetes/test/integration/deployment](https://github.com/kubernetes/kubernetes/blob/master/test/integration/deployment/OWNERS)
95101

96102
[subproject-definition]: https://github.com/kubernetes/community/blob/master/governance.md#subprojects
103+
[working-group-definition]: https://github.com/kubernetes/community/blob/master/governance.md#working-groups
97104
<!-- BEGIN CUSTOM CONTENT -->
98105

99106
## Goals

sig-architecture/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ The Chairs of the SIG run operations and processes governing the SIG.
5353
- [@kubernetes/sig-architecture-test-failures](https://github.com/orgs/kubernetes/teams/sig-architecture-test-failures) - Test Failures and Triage
5454
- Steering Committee Liaison: Jordan Liggitt (**[@liggitt](https://github.com/liggitt)**)
5555

56+
## Working Groups
57+
58+
The following [working groups][working-group-definition] are sponsored by sig-architecture:
59+
* [WG API Expression](/wg-api-expression)
60+
* [WG Policy](/wg-policy)
61+
* [WG Reliability](/wg-reliability)
62+
* [WG Structured Logging](/wg-structured-logging)
63+
64+
5665
## Subprojects
5766

5867
The following [subprojects][subproject-definition] are owned by sig-architecture:
@@ -99,6 +108,7 @@ The following [subprojects][subproject-definition] are owned by sig-architecture
99108
- Slack: [#prod-readiness](https://kubernetes.slack.com/messages/prod-readiness)
100109

101110
[subproject-definition]: https://github.com/kubernetes/community/blob/master/governance.md#subprojects
111+
[working-group-definition]: https://github.com/kubernetes/community/blob/master/governance.md#working-groups
102112
<!-- BEGIN CUSTOM CONTENT -->
103113

104114
# Details about SIG-Architecture sub-projects

sig-auth/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ subprojects, and resolve cross-subproject technical issues and decisions.
6060
- [@kubernetes/sig-auth-test-failures](https://github.com/orgs/kubernetes/teams/sig-auth-test-failures) - Test Failures and Triage
6161
- Steering Committee Liaison: Christoph Blecker (**[@cblecker](https://github.com/cblecker)**)
6262

63+
## Working Groups
64+
65+
The following [working groups][working-group-definition] are sponsored by sig-auth:
66+
* [WG Multitenancy](/wg-multitenancy)
67+
* [WG Policy](/wg-policy)
68+
69+
6370
## Subprojects
6471

6572
The following [subprojects][subproject-definition] are owned by sig-auth:
@@ -160,6 +167,7 @@ Infrastructure implementing Kubernetes service account based workload identity.
160167
- [kubernetes/kubernetes/plugin/pkg/admission/serviceaccount](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/admission/serviceaccount/OWNERS)
161168

162169
[subproject-definition]: https://github.com/kubernetes/community/blob/master/governance.md#subprojects
170+
[working-group-definition]: https://github.com/kubernetes/community/blob/master/governance.md#working-groups
163171
<!-- BEGIN CUSTOM CONTENT -->
164172

165173
<!-- END CUSTOM CONTENT -->

sig-autoscaling/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ The following [subprojects][subproject-definition] are owned by sig-autoscaling:
6060
- [kubernetes/autoscaler](https://github.com/kubernetes/autoscaler/blob/master/OWNERS)
6161

6262
[subproject-definition]: https://github.com/kubernetes/community/blob/master/governance.md#subprojects
63+
[working-group-definition]: https://github.com/kubernetes/community/blob/master/governance.md#working-groups
6364
<!-- BEGIN CUSTOM CONTENT -->
6465
## Concerns
6566
* autoscaling of clusters,

sig-cli/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ Hybrid command-line/UI development experience for cloud-native development
108108
- Slack: [#kustomize](https://kubernetes.slack.com/messages/kustomize)
109109

110110
[subproject-definition]: https://github.com/kubernetes/community/blob/master/governance.md#subprojects
111+
[working-group-definition]: https://github.com/kubernetes/community/blob/master/governance.md#working-groups
111112
<!-- BEGIN CUSTOM CONTENT -->
112113

113114
<!-- END CUSTOM CONTENT -->

sig-cloud-provider/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ The Chairs of the SIG run operations and processes governing the SIG.
4747
- [@kubernetes/sig-cloud-providers-misc](https://github.com/orgs/kubernetes/teams/sig-cloud-providers-misc) - General Discussion
4848
- Steering Committee Liaison: Stephen Augustus (**[@justaugustus](https://github.com/justaugustus)**)
4949

50+
## Working Groups
51+
52+
The following [working groups][working-group-definition] are sponsored by sig-cloud-provider:
53+
* [WG Structured Logging](/wg-structured-logging)
54+
55+
5056
## Subprojects
5157

5258
The following [subprojects][subproject-definition] are owned by sig-cloud-provider:
@@ -135,6 +141,7 @@ The following [subprojects][subproject-definition] are owned by sig-cloud-provid
135141
- [Meeting recordings](https://www.youtube.com/playlist?list=PLutJyDdkKQIpOT4bOfuO3MEMHvU1tRqyR).
136142

137143
[subproject-definition]: https://github.com/kubernetes/community/blob/master/governance.md#subprojects
144+
[working-group-definition]: https://github.com/kubernetes/community/blob/master/governance.md#working-groups
138145
<!-- BEGIN CUSTOM CONTENT -->
139146

140147
<!-- END CUSTOM CONTENT -->

0 commit comments

Comments
 (0)