From 61bf1fe7535883e32255ba1871b2f044685acbf0 Mon Sep 17 00:00:00 2001 From: "gandalf-the-greybeard[bot]" Date: Sun, 8 Mar 2026 01:21:51 +0000 Subject: [PATCH] fix: restore badge emoji, fix aria-label, and correct service proxy URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three root causes for E2E test failures since March 4: 1. Service proxy URL missing http: protocol prefix — Kubernetes requires the format http:service-name:port, not service-name:port. This caused all data fetches to fail, making data-dependent components render empty states instead of expected content. 2. AppBarScoreBadge aria-label "Polaris cluster score: X%" doesn't match the E2E test regex /Polaris: \d+%/. Simplified to "Polaris: X%". 3. Shield emoji was removed from badge in commit 514de78 but E2E tests still assert its presence. Fixes PRI-20 Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 2 +- src/api/polaris.ts | 2 +- src/components/AppBarScoreBadge.test.tsx | 2 +- src/components/AppBarScoreBadge.tsx | 3 ++- src/components/PolarisSettings.tsx | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 770b856..fd13c33 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Project -Headlamp plugin surfacing Fairwinds Polaris audit results. Queries the Polaris dashboard API via Kubernetes service proxy (`/api/v1/namespaces/polaris/services/polaris-dashboard/proxy/results.json`). Read-only — no cluster write operations except exemption annotation patches. +Headlamp plugin surfacing Fairwinds Polaris audit results. Queries the Polaris dashboard API via Kubernetes service proxy (`/api/v1/namespaces/polaris/services/http:polaris-dashboard:80/proxy/results.json`). Read-only — no cluster write operations except exemption annotation patches. - **Plugin name**: `polaris` - **Target**: Headlamp >= v0.26 diff --git a/src/api/polaris.ts b/src/api/polaris.ts index 9348625..671ebdb 100644 --- a/src/api/polaris.ts +++ b/src/api/polaris.ts @@ -218,7 +218,7 @@ const REFRESH_STORAGE_KEY = 'polaris-plugin-refresh-interval'; const DEFAULT_INTERVAL_SECONDS = 300; // 5 minutes const URL_STORAGE_KEY = 'polaris-plugin-dashboard-url'; -const DEFAULT_DASHBOARD_URL = '/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/'; +const DEFAULT_DASHBOARD_URL = '/api/v1/namespaces/polaris/services/http:polaris-dashboard:80/proxy/'; /** * Retrieves the configured refresh interval from localStorage. diff --git a/src/components/AppBarScoreBadge.test.tsx b/src/components/AppBarScoreBadge.test.tsx index 3e22819..f73ca9e 100644 --- a/src/components/AppBarScoreBadge.test.tsx +++ b/src/components/AppBarScoreBadge.test.tsx @@ -131,6 +131,6 @@ describe('AppBarScoreBadge', () => { mockUsePolarisDataContext.mockReturnValue({ data, loading: false }); render(); - expect(screen.getByLabelText('Polaris cluster score: 100%')).toBeInTheDocument(); + expect(screen.getByLabelText('Polaris: 100%')).toBeInTheDocument(); }); }); diff --git a/src/components/AppBarScoreBadge.tsx b/src/components/AppBarScoreBadge.tsx index aaa8d56..726e523 100644 --- a/src/components/AppBarScoreBadge.tsx +++ b/src/components/AppBarScoreBadge.tsx @@ -54,8 +54,9 @@ export default function AppBarScoreBadge() { alignItems: 'center', gap: '4px', }} - aria-label={`Polaris cluster score: ${score}%`} + aria-label={`Polaris: ${score}%`} > + {'\u{1F6E1}\uFE0F'} Polaris: {score}% ); diff --git a/src/components/PolarisSettings.tsx b/src/components/PolarisSettings.tsx index bcbeee2..72e0262 100644 --- a/src/components/PolarisSettings.tsx +++ b/src/components/PolarisSettings.tsx @@ -105,7 +105,7 @@ export default function PolarisSettings(props: PluginSettingsProps) { type="text" value={currentUrl} onChange={handleUrlChange} - placeholder="/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/" + placeholder="/api/v1/namespaces/polaris/services/http:polaris-dashboard:80/proxy/" style={{ width: '100%', padding: '4px 8px', @@ -125,7 +125,7 @@ export default function PolarisSettings(props: PluginSettingsProps) { > Examples:
• K8s proxy:{' '} - /api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/ + /api/v1/namespaces/polaris/services/http:polaris-dashboard:80/proxy/
• Full URL: https://my-polaris.example.com