Skip to content

Commit

Permalink
Flag when a group has too many issues on their agenda.
Browse files Browse the repository at this point in the history
  • Loading branch information
jyasskin committed Mar 6, 2024
1 parent f63821f commit 462222c
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 26 deletions.
12 changes: 11 additions & 1 deletion frontend/src/layouts/Layout.astro
Expand Up @@ -14,7 +14,17 @@ const { title } = Astro.props;
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
<style is:global>
body {max-width: 50em;}
body {
max-width: 50em;
}
:is(li, dd) {
& > p:first-child {
margin-top: 0;
}
& > p:last-child {
margin-bottom: 0;
}
}
</style>
</head>
<body>
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lib/slo.ts
Expand Up @@ -10,6 +10,9 @@ export const soonSLO = Temporal.Duration.from({ days: 91 });
// once.
export const agendaSLO = Temporal.Duration.from({ days: 35 });

// Keep to at most 25 agenda items.
export const agendaLengthSLO = 25;

export const sloMap = {
"urgent": urgentSLO,
"soon": soonSLO,
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/pages/[org]/[repo].astro
Expand Up @@ -5,6 +5,7 @@ import Issue from "@components/Issue.astro";
import Layout from "@layouts/Layout.astro";
import { IssueSummary } from "@lib/repo-summaries";
import {
agendaLengthSLO,
agendaSLO,
cmpByAgendaUsed,
cmpByTimeUsed,
Expand Down Expand Up @@ -101,9 +102,12 @@ untriaged.sort(cmpByTimeUsed);
agenda.length > 0 ? (
<li>
<a href="#agenda">
{agendaViolations.length
? `${agendaViolations.length} issues on the agenda that have been waiting too long`
: `${agenda.length} issues on the agenda`}
{agenda.length > agendaLengthSLO &&
agendaViolations.length
? `${agenda.length} issues on the agenda, ${agendaViolations.length} of which have been waiting too long; consider scheduling more meetings`
: agendaViolations.length
? `${agendaViolations.length} issues on the agenda that have been waiting too long`
: `${agenda.length} issues on the agenda${agenda.length > agendaLengthSLO ? "; consider scheduling more meetings" : ""}`}
</a>
</li>
) : null
Expand Down Expand Up @@ -169,7 +173,8 @@ untriaged.sort(cmpByTimeUsed);
<>
<h2 id="agenda">Agenda</h2>
<p>
Try to discuss
Try to maintain fewer than {agendaLengthSLO} agenda items
and discuss
{/* prettier-ignore */}
<a href={`${import.meta.env.BASE_URL}about#agenda`}>issues
on the agenda</a>
Expand Down
32 changes: 22 additions & 10 deletions frontend/src/pages/about.astro
@@ -1,7 +1,13 @@
---
import Duration from "@components/Duration.astro";
import GhLabel from "@components/GhLabel.astro";
import { agendaSLO, soonSLO, triageSLO, urgentSLO } from "@lib/slo";
import {
agendaLengthSLO,
agendaSLO,
soonSLO,
triageSLO,
urgentSLO,
} from "@lib/slo";
import * as ghLabels from "@lib/triage-labels";
import Layout from "../layouts/Layout.astro";
---
Expand Down Expand Up @@ -101,15 +107,21 @@ import Layout from "../layouts/Layout.astro";
<dl>
<dt id="agenda">On the agenda</dt>
<dd>
An issue labeled <GhLabel {...ghLabels.agenda} /> should be discussed
and have the label removed within <b
><Duration d={agendaSLO} /></b
>. The <a
href="https://en.wikipedia.org/wiki/Service_level_indicator"
><abbr title="Service Level Indicator">SLI</abbr></a
> for handling agenda items only counts the current application of
this label, unlike priorities which include previous times their
label was added and then removed.
<p>
An issue labeled <GhLabel {...ghLabels.agenda} /> should be discussed
and have the label removed within <b
><Duration d={agendaSLO} /></b
>. The <a
href="https://en.wikipedia.org/wiki/Service_level_indicator"
><abbr title="Service Level Indicator">SLI</abbr></a
> for handling agenda items only counts the current application
of this label, unlike priorities which include previous times
their label was added and then removed.
</p>
<p>
Groups should have enough meetings to keep their agendas
below {agendaLengthSLO} items.
</p>
</dd>
</dl>
</main>
Expand Down
50 changes: 39 additions & 11 deletions frontend/src/pages/index.astro
@@ -1,7 +1,7 @@
---
import GhLabel from "@components/GhLabel.astro";
import { IssueSummary } from "@lib/repo-summaries";
import { groupBySlo } from "@lib/slo";
import { agendaLengthSLO, groupBySlo } from "@lib/slo";
import * as ghLabels from "@lib/triage-labels";
import { getCollection } from "astro:content";
import Layout from "../layouts/Layout.astro";
Expand All @@ -17,6 +17,7 @@ let totalUrgent = 0;
let totalSoon = 0;
let totalAgenda = 0;
let totalOther = 0;
let totalGroupsOverAgendaLimit = 0;
const andFormatter = new Intl.ListFormat("en", {
style: "long",
Expand Down Expand Up @@ -45,22 +46,35 @@ const repoSummaries = repos.map((repo) => {
totalSoon += soon;
totalAgenda += agenda;
totalOther += other;
if (agenda + agendaViolations > agendaLengthSLO) {
totalGroupsOverAgendaLimit++;
}
let message: string[] = [];
let class_ = "";
if (triageViolations > 0 || urgentViolations > 0) {
class_ = "error";
if (triageViolations > 0) {
message.push(`${triageViolations} triage SLO violations`);
}
if (urgentViolations > 0) {
message.push(`${urgentViolations} urgent SLO violations`);
}
} else if (soonViolations > 0 || agendaViolations > 0) {
} else if (
soonViolations > 0 ||
agendaViolations > 0 ||
agenda + agendaViolations > agendaLengthSLO
) {
class_ = "warning";
if (soonViolations > 0) {
message.push(`${soonViolations} soon SLO violations`);
}
if (agendaViolations > 0) {
message.push(`${agendaViolations} agenda SLO violations`);
}
if (agenda + agendaViolations > agendaLengthSLO) {
message.push(`${agenda + agendaViolations} issues on the agenda`);
}
} else if (needTriage > 0 || urgent > 0) {
if (needTriage > 0) {
message.push(`${needTriage} issues that need triage`);
Expand All @@ -87,12 +101,7 @@ const repoSummaries = repos.map((repo) => {
soon,
agenda,
other,
class_:
triageViolations > 0 || urgentViolations > 0
? "error"
: soonViolations > 0 || agendaViolations > 0
? "warning"
: "",
class_,
message: andFormatter.format(message),
});
});
Expand All @@ -106,10 +115,21 @@ function sortKey(summary: (typeof repoSummaries)[0]): {
priority: 4,
count: summary.triageViolations + summary.urgentViolations,
};
} else if (summary.soonViolations > 0 || summary.agendaViolations > 0) {
} else if (
summary.soonViolations > 0 ||
summary.agendaViolations > 0 ||
summary.agenda + summary.agendaViolations > agendaLengthSLO
) {
let agendaIfTooMany = 0;
if (summary.agenda + summary.agendaViolations > agendaLengthSLO) {
agendaIfTooMany = summary.agenda;
}
return {
priority: 3,
count: summary.soonViolations + summary.agendaViolations,
count:
summary.soonViolations +
summary.agendaViolations +
agendaIfTooMany,
};
} else if (summary.needTriage > 0 || summary.urgent > 0) {
return { priority: 2, count: summary.needTriage + summary.urgent };
Expand Down Expand Up @@ -170,6 +190,14 @@ repoSummaries.sort(compareByKey);
</li>
) : null
}
{
totalGroupsOverAgendaLimit > 0 ? (
<li class="warning">
{totalGroupsOverAgendaLimit} group(s) with too many issues
on the agenda
</li>
) : null
}
{
totalNeedTriage > 0 ? (
<li>{totalNeedTriage} issues that need triage</li>
Expand All @@ -192,7 +220,7 @@ repoSummaries.sort(compareByKey);
<dt>
<a href={`${repo.data.org}/${repo.data.repo}`}>
{repo.data.org}/{repo.data.repo}
</a>{" "}
</a>
{repo.data.labelsPresent ? null : (
<>
(no <GhLabel {...ghLabels.eventually} />
Expand Down

0 comments on commit 462222c

Please sign in to comment.