Skip to content

Commit d548b74

Browse files
authored
fix(review): correct the per-project fairness-flags tile's row-count label (#7716)
"Contributor fairness flags" delta said "N contributor(s) evaluated", but contributorGateEval.rows is one row per (login, project) -- a login active on two repos contributes two rows, so the old wording overstated the number of distinct contributors. The new "Global contributor fairness flags" tile already has an accurate per-login count for that.
1 parent a964eaf commit d548b74

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/services/operator-dashboard.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,10 @@ export async function buildOperatorDashboardPayload(
273273
// contributor via GET /v1/internal/fairness/contributors/:login instead.
274274
label: "Contributor fairness flags",
275275
value: String(contributorFairnessFlagCount),
276-
delta: contributorFairnessFlagCount > 0 ? `${contributorGateEval.rows.length} contributor(s) evaluated` : "no outliers detected",
276+
// contributorGateEval.rows is one row per (login, project) -- the SAME login active on two repos
277+
// contributes two rows, so this counts evaluated rows, not unique contributors (that count lives on
278+
// the "Global contributor fairness flags" tile below, via blendedContributorGateEval's per-login fold).
279+
delta: contributorFairnessFlagCount > 0 ? `${contributorGateEval.rows.length} (login, project) row(s) evaluated` : "no outliers detected",
277280
},
278281
{
279282
// #global-contributor-trust: the cross-repo blended counterpart -- one row per LOGIN (pooled across

test/unit/operator-dashboard.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,12 @@ describe("operator dashboard payload", () => {
211211

212212
const payload = await buildOperatorDashboardPayload(env);
213213
expect(payload.metrics).toEqual(
214-
expect.arrayContaining([expect.objectContaining({ label: "Contributor fairness flags", value: "1", delta: "3 contributor(s) evaluated" })]),
214+
expect.arrayContaining([expect.objectContaining({ label: "Contributor fairness flags", value: "1", delta: "3 (login, project) row(s) evaluated" })]),
215215
);
216216
// #global-contributor-trust: every login here touches exactly one project, so the blended fold degenerates
217-
// to the same per-login numbers as the per-project fold -- same outlier, same evaluated count.
217+
// to the same per-login numbers as the per-project fold -- same outlier, same evaluated count. Here the
218+
// "3 contributor(s)" wording IS accurate (unlike the per-project tile above): blendedContributorGateEval
219+
// folds by login alone, so its row count genuinely is a count of unique contributors.
218220
expect(payload.metrics).toEqual(
219221
expect.arrayContaining([expect.objectContaining({ label: "Global contributor fairness flags", value: "1", delta: "3 contributor(s) evaluated" })]),
220222
);

0 commit comments

Comments
 (0)