diff --git a/app.py b/app.py index 7875716..ece3265 100644 --- a/app.py +++ b/app.py @@ -207,8 +207,20 @@ def format_name(key): ], key=lambda d: d["name"], ) + + platform_membership = {} + for slug, info in config.get("platforms", {}).items(): + team_name = slug.replace("-", " ").title() + lead = info.get("lead") + platform_membership.setdefault(lead, []).append(team_name) + for dev in info.get("developers", []): + platform_membership.setdefault(dev, []).append(team_name) + on_call_support = [ - format_name(name) + { + "name": format_name(name), + "platform_team": sorted(set(platform_membership.get(name, []))), + } for name, person in config.get("people", {}).items() if person.get("on_call_support") ] diff --git a/config.yml b/config.yml index 4f5e626..8ca7dd2 100644 --- a/config.yml +++ b/config.yml @@ -15,16 +15,19 @@ people: linear_username: sherange.fonseka github_username: sherange on_call_support: true + jimmy: slack_id: U019TA865C2 linear_username: jimmy github_username: jimmyhogoboom on_call_support: true + andy: slack_id: U080E70RQ4U linear_username: andy.smith github_username: on_call_support: true + nathan: slack_id: U022N4RTD40 linear_username: nathan diff --git a/templates/team.html b/templates/team.html index ba10c8c..c3e2f05 100644 --- a/templates/team.html +++ b/templates/team.html @@ -54,8 +54,8 @@
- {%- for name in on_call_support -%} - {{ name|first_name }}{% if not loop.last %}, {% endif %} + {%- for person in on_call_support -%} + {{ person.name|first_name }}{% if person.platform_team %} ({{ person.platform_team | join(', ') }}){% endif %}{% if not loop.last %}, {% endif %} {%- endfor -%}