Skip to content

Commit

Permalink
Make time zone explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeda committed Nov 6, 2017
1 parent 56ddf9c commit 1cc0e97
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 43 deletions.
10 changes: 10 additions & 0 deletions generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ different Special Interest Groups (SIGs) of Kubernetes. The authoritative
source for SIG information is the `sigs.yaml` file in the project root. All
updates must be done there.

The schema for this file should be self explanatory. However, if you need to see all the options check out the generator code in `app.go`.

**Time Zone gotcha**:
Time zones make everything complicated.
And Daylight Savings time makes it even more complicated.
Meetings are specified with a time zone and we generate a link to http://www.thetimezoneconverter.com/ so that people can easily convert it to their local time zone.
To make this work you need to specify the time zone in a way that that web site recognizes.
Practically, that means US pacific time must be `PT (Pacific Time)`.
`PT` isn't good enough, unfortunately.

When an update happens to the this file, the next step is generate the
accompanying documentation. This takes the format of two types of doc file:

Expand Down
20 changes: 17 additions & 3 deletions generator/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"io/ioutil"
"log"
"net/url"
"os"
"path/filepath"
"sort"
Expand Down Expand Up @@ -60,8 +61,8 @@ type Lead struct {
// Meeting represents a regular meeting for a group.
type Meeting struct {
Day string
UTC string
PST string
Time string
TZ string `yaml:"tz"`
Frequency string
}

Expand Down Expand Up @@ -153,9 +154,22 @@ func getExistingContent(path string) (string, error) {
return strings.Join(captured, "\n"), nil
}

var funcMap template.FuncMap = template.FuncMap{
"tzUrlEncode": tzUrlEncode,
}

// tzUrlEncode returns an url encoded string without the + shortcut. This is
// required as the timezone conversion site we are using doesn't recognize + as
// a valid url escape character.
func tzUrlEncode(tz string) string {
return strings.Replace(url.QueryEscape(tz), "+", "%20", -1)
}

func writeTemplate(templatePath, outputPath string, data interface{}) error {
// set up template
t, err := template.ParseFiles(templatePath, filepath.Join(baseGeneratorDir, templateDir, headerTemplate))
t, err := template.New(filepath.Base(templatePath)).
Funcs(funcMap).
ParseFiles(templatePath, filepath.Join(baseGeneratorDir, templateDir, headerTemplate))
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions generator/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ When the need arises, a [new SIG can be created](sig-creation-procedure.md)
| Name | Label | Leads | Contact | Meetings |
|------|--------|-------|---------|----------|
{{- range .Sigs}}
|[{{.Name}}]({{.Dir}}/README.md)|{{.Label}}|{{range .Leads}}* [{{.Name}}](https://github.com/{{.GitHub}}){{if .Company}}, {{.Company}}{{end}}<br>{{end}}|* [Slack](https://kubernetes.slack.com/messages/{{.Contact.Slack}})<br>* [Mailing List]({{.Contact.MailingList}})|{{ $save := . }}{{range .Meetings}}* [{{.Day}}s at {{.UTC}} UTC ({{.Frequency}})]({{$save.MeetingURL}})<br>{{end}}
|[{{.Name}}]({{.Dir}}/README.md)|{{.Label}}|{{range .Leads}}* [{{.Name}}](https://github.com/{{.GitHub}}){{if .Company}}, {{.Company}}{{end}}<br>{{end}}|* [Slack](https://kubernetes.slack.com/messages/{{.Contact.Slack}})<br>* [Mailing List]({{.Contact.MailingList}})|{{ $save := . }}{{range .Meetings}}* [{{.Day}}s at {{.Time}} {{.TZ}} ({{.Frequency}})]({{$save.MeetingURL}})<br>{{end}}
{{- end }}

### Master Working Group List

| Name | Organizers | Contact | Meetings |
|------|------------|---------|----------|
{{- range .WorkingGroups}}
|[{{.Name}}]({{.Dir}}/README.md)|{{range .Leads}}* [{{.Name}}](https://github.com/{{.GitHub}}){{if .Company}}, {{.Company}}{{end}}<br>{{end}}|* [Slack](https://kubernetes.slack.com/messages/{{.Contact.Slack}})<br>* [Mailing List]({{.Contact.MailingList}})|{{ $save := . }}{{range .Meetings}}* [{{.Day}}s at {{.UTC}} UTC ({{.Frequency}})]({{$save.MeetingURL}})<br>{{end}}
|[{{.Name}}]({{.Dir}}/README.md)|{{range .Leads}}* [{{.Name}}](https://github.com/{{.GitHub}}){{if .Company}}, {{.Company}}{{end}}<br>{{end}}|* [Slack](https://kubernetes.slack.com/messages/{{.Contact.Slack}})<br>* [Mailing List]({{.Contact.MailingList}})|{{ $save := . }}{{range .Meetings}}* [{{.Day}}s at {{.Time}} {{.TZ}} ({{.Frequency}})]({{$save.MeetingURL}})<br>{{end}}
{{- end }}
2 changes: 1 addition & 1 deletion generator/sig_readme.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ .MissionStatement }}
## Meetings
{{- range .Meetings }}
* [{{.Day}}s at {{.UTC}} UTC]({{$.MeetingURL}}) ({{.Frequency}}). [Convert to your timezone](http://www.thetimezoneconverter.com/?t={{.UTC}}&tz=UTC).
* [{{.Day}}s at {{.Time}} {{.TZ}}]({{$.MeetingURL}}) ({{.Frequency}}). [Convert to your timezone](http://www.thetimezoneconverter.com/?t={{.Time}}&tz={{.TZ | tzUrlEncode}}).
{{- end }}

{{ if .MeetingArchiveURL -}}
Expand Down
2 changes: 1 addition & 1 deletion generator/wg_readme.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ .MissionStatement }}
## Meetings
{{- range .Meetings }}
* [{{.Day}}s at {{.UTC}} UTC]({{$.MeetingURL}}) ({{.Frequency}}). [Convert to your timezone](http://www.thetimezoneconverter.com/?t={{.UTC}}&tz=UTC).
* [{{.Day}}s at {{.Time}} {{.TZ}}]({{$.MeetingURL}}) ({{.Frequency}}). [Convert to your timezone](http://www.thetimezoneconverter.com/?t={{.Time}}&tz={{.TZ | tzUrlEncode}}).
{{- end }}

{{ if .MeetingArchiveURL -}}
Expand Down
2 changes: 1 addition & 1 deletion sig-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ When the need arises, a [new SIG can be created](sig-creation-procedure.md)
|[Scheduling](sig-scheduling/README.md)|scheduling|* [David Oppenheimer](https://github.com/davidopp), Google<br>* [Timothy St. Clair](https://github.com/timothysc), Red Hat<br>|* [Slack](https://kubernetes.slack.com/messages/sig-scheduling)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-scheduling)|* [Mondays at 20:00 UTC (biweekly)](https://zoom.us/zoomconference?m=rN2RrBUYxXgXY4EMiWWgQP6Vslgcsn86)<br>* [Wednesdays at 07:30 UTC (biweekly)](https://zoom.us/zoomconference?m=rN2RrBUYxXgXY4EMiWWgQP6Vslgcsn86)<br>
|[Service Catalog](sig-service-catalog/README.md)|service-catalog|* [Paul Morie](https://github.com/pmorie), Red Hat<br>* [Aaron Schlesinger](https://github.com/arschles), Microsoft<br>* [Ville Aikas](https://github.com/vaikas-google), Google<br>* [Doug Davis](https://github.com/duglin), IBM<br>|* [Slack](https://kubernetes.slack.com/messages/sig-service-catalog)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-service-catalog)|* [Mondays at 20:00 UTC (weekly)](https://zoom.us/j/7201225346)<br>
|[Storage](sig-storage/README.md)|storage|* [Saad Ali](https://github.com/saad-ali), Google<br>* [Bradley Childs](https://github.com/childsb), Red Hat<br>|* [Slack](https://kubernetes.slack.com/messages/sig-storage)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-storage)|* [Thursdays at 16:00 UTC (biweekly)](https://zoom.us/j/614261834)<br>
|[Testing](sig-testing/README.md)|testing|* [Aaron Crickenberger](https://github.com/spiffxp), Samsung SDS<br>* [Erick Feja](https://github.com/fejta), Google<br>* [Timothy St. Clair](https://github.com/timothysc), Heptio<br>|* [Slack](https://kubernetes.slack.com/messages/sig-testing)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-testing)|* [Tuesdays at 21:00 UTC (weekly)](https://zoom.us/j/2419653117)<br>
|[Testing](sig-testing/README.md)|testing|* [Aaron Crickenberger](https://github.com/spiffxp), Samsung SDS<br>* [Erick Feja](https://github.com/fejta), Google<br>* [Timothy St. Clair](https://github.com/timothysc), Heptio<br>|* [Slack](https://kubernetes.slack.com/messages/sig-testing)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-testing)|* [Tuesdays at 13:00 PT (Pacific Time) (weekly)](https://zoom.us/j/2419653117)<br>
|[UI](sig-ui/README.md)|ui|* [Dan Romlein](https://github.com/danielromlein), Google<br>* [Sebastian Florek](https://github.com/floreks), Fujitsu<br>|* [Slack](https://kubernetes.slack.com/messages/sig-ui)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-ui)|* [Thursdays at 16:00 UTC (weekly)](https://groups.google.com/forum/#!forum/kubernetes-sig-ui)<br>
|[Windows](sig-windows/README.md)|windows|* [Michael Michael](https://github.com/michmike), Apprenda<br>|* [Slack](https://kubernetes.slack.com/messages/sig-windows)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-windows)|* [Tuesdays at 16:30 UTC (weekly)](https://zoom.us/my/sigwindows)<br>

Expand Down
2 changes: 1 addition & 1 deletion sig-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To understand how this file is generated, see https://git.k8s.io/community/gener
Interested in how we can most effectively test Kubernetes. We're interested specifically in making it easier for the community to run tests and contribute test results, to ensure Kubernetes is stable across a variety of cluster configurations and cloud providers.

## Meetings
* [Tuesdays at 21:00 UTC](https://zoom.us/j/2419653117) (weekly). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=21:00&tz=UTC).
* [Tuesdays at 13:00 PT (Pacific Time)](https://zoom.us/j/2419653117) (weekly). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=13:00&tz=PT%20%28Pacific%20Time%29).

Meeting notes and Agenda can be found [here](https://docs.google.com/document/d/1z8MQpr_jTwhmjLMUaqQyBk1EYG_Y_3D4y4YdMJ7V1Kk).
Meeting recordings can be found [here](https://www.youtube.com/watch?v=BbFjuxe3N4w&list=PL69nYSiGNLP0ofY51bEooJ4TKuQtUSizR).
Expand Down
Loading

0 comments on commit 1cc0e97

Please sign in to comment.