diff --git a/layers/identity/server/utils/daily-health-check.spec.ts b/layers/identity/server/utils/daily-health-check.spec.ts index 6d4c2aa5..46a68cc0 100644 --- a/layers/identity/server/utils/daily-health-check.spec.ts +++ b/layers/identity/server/utils/daily-health-check.spec.ts @@ -66,6 +66,7 @@ function summary(overrides: Partial = {}): DailyHealthC discoveryCandidatesOverdue: 0, discoveryClaimsStale: 0, leaderboardApprovalsStuck: 0, + leaderboardApprovalDetails: [], failedJobDetails: [], }, cost: { @@ -226,6 +227,21 @@ describe('evaluateDailyHealthStatus', () => { }) }) + it('names the invisible leaderboard repositories in the reason', () => { + const input = summary({ + pipeline: { + ...summary().pipeline, + leaderboardApprovalsStuck: 1, + leaderboardApprovalDetails: [{ owner: 'missing-owner', repo: 'missing-repo', reviewedAt: 1_774_473_000 }], + }, + }) + + expect(evaluateDailyHealthStatus(input)).toEqual({ + status: 'AMBER', + reasons: ['1 reviewed leaderboard repository remained invisible for over 15 minutes: missing-owner/missing-repo.'], + }) + }) + it('keeps unengaged source removal informational and flags user impact amber', () => { const informational = summary({ pipeline: { @@ -468,6 +484,9 @@ describe('buildDailyHealthCheck', () => { expect(uncertain.activity.digestsFailed24h).toBe(1) expect(uncertain.pipeline.discoveryCandidatesExhausted).toBe(1) expect(uncertain.pipeline.leaderboardApprovalsStuck).toBe(1) + expect(uncertain.pipeline.leaderboardApprovalDetails).toEqual([ + { owner: 'missing-owner', repo: 'missing-repo', reviewedAt: nowSec - 901 }, + ]) expect(uncertain.status).toBe('RED') sqlite.close() }) @@ -518,6 +537,21 @@ describe('daily health rendering', () => { expect(renderDailyHealthCheckHtml(input)).toContain('Pipeline <degraded>') expect(renderDailyHealthCheckHtml(input)).not.toContain('