Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb0900e149 | |||
| e4f888ae60 | |||
| 80ed624af0 | |||
| 3376bb3730 | |||
| 2df7bcd57e | |||
| 15d040b8ca | |||
| 07bbdddbee | |||
| f5c6efc3d6 | |||
| 944aa1d238 | |||
| 5b5ed9897b | |||
| 6aefdb00a8 | |||
| 5db792f0a7 | |||
| 413634a01e | |||
| de8a20f99a | |||
| 827b4f31cc | |||
| c648b43493 | |||
| 01c37a85d7 |
@@ -18,6 +18,6 @@ jobs:
|
|||||||
e2e:
|
e2e:
|
||||||
uses: privilegedescalation/.github/.github/workflows/plugin-e2e.yaml@hugh/add-pnpm-support-plugin-e2e
|
uses: privilegedescalation/.github/.github/workflows/plugin-e2e.yaml@hugh/add-pnpm-support-plugin-e2e
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: "22"
|
||||||
headlamp-version: v0.40.1
|
headlamp-version: v0.40.1
|
||||||
e2e-namespace: headlamp-dev
|
e2e-namespace: headlamp-dev
|
||||||
|
|||||||
@@ -15,9 +15,3 @@ coverage/
|
|||||||
*~
|
*~
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
# E2E
|
|
||||||
e2e/.auth/
|
|
||||||
.env.e2e
|
|
||||||
playwright-report/
|
|
||||||
test-results/
|
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
version: "0.1.0"
|
version: "0.1.2"
|
||||||
name: headlamp-argocd
|
name: headlamp-argocd
|
||||||
displayName: ArgoCD Headlamp Plugin
|
displayName: ArgoCD Headlamp Plugin
|
||||||
createdAt: "2026-04-21T00:00:00Z"
|
createdAt: "2026-04-21T00:00:00Z"
|
||||||
@@ -26,8 +26,8 @@ maintainers:
|
|||||||
provider:
|
provider:
|
||||||
name: privilegedescalation
|
name: privilegedescalation
|
||||||
annotations:
|
annotations:
|
||||||
headlamp/plugin/archive-url: "https://github.com/privilegedescalation/headlamp-argocd-plugin/releases/download/v0.1.0/headlamp-argocd-0.1.0.tar.gz"
|
headlamp/plugin/archive-url: "https://github.com/privilegedescalation/headlamp-argocd-plugin/releases/download/v0.1.2/privilegedescalation-headlamp-argocd-plugin-0.1.2.tar.gz"
|
||||||
headlamp/plugin/archive-checksum: "sha256:1f4df43f79b795bdf4f70e1e3aa5bacadf689ea5584fdadf92fb677faab21c2c"
|
headlamp/plugin/archive-checksum: sha256:e71f84913eed1fd7e2d074912e3bfa668c4b1fefcbb069731a4e4277a998ca28
|
||||||
headlamp/plugin/version-compat: ">=0.26"
|
headlamp/plugin/version-compat: ">=0.26"
|
||||||
headlamp/plugin/distro-compat: "in-cluster"
|
headlamp/plugin/distro-compat: "in-cluster"
|
||||||
changes:
|
changes:
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
import { test, expect } from '@playwright/test';
|
|
||||||
|
|
||||||
async function waitForSidebar(page: import('@playwright/test').Page) {
|
|
||||||
const sidebar = page.getByRole('navigation', { name: 'Navigation' });
|
|
||||||
await expect(sidebar).toBeVisible({ timeout: 15_000 });
|
|
||||||
await page.waitForLoadState('networkidle');
|
|
||||||
return sidebar;
|
|
||||||
}
|
|
||||||
|
|
||||||
test.describe('ArgoCD plugin smoke tests', () => {
|
|
||||||
test('sidebar contains ArgoCD entry', async ({ page }) => {
|
|
||||||
await page.goto('/');
|
|
||||||
const sidebar = await waitForSidebar(page);
|
|
||||||
await expect(sidebar.getByRole('button', { name: /argocd/i })).toBeVisible();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ArgoCD sidebar entry navigates to applications list', async ({ page }) => {
|
|
||||||
await page.goto('/');
|
|
||||||
const sidebar = await waitForSidebar(page);
|
|
||||||
|
|
||||||
const argocdEntry = sidebar.getByRole('button', { name: /argocd/i });
|
|
||||||
await expect(argocdEntry).toBeVisible();
|
|
||||||
await argocdEntry.click();
|
|
||||||
|
|
||||||
await page.waitForLoadState('networkidle');
|
|
||||||
await expect(page).toHaveURL(/argocd/);
|
|
||||||
await expect(page.getByRole('heading', { name: /argo.*cd.*applications/i })).toBeVisible();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('applications list page renders', async ({ page }) => {
|
|
||||||
await page.goto('/c/main/argocd');
|
|
||||||
await waitForSidebar(page);
|
|
||||||
|
|
||||||
await expect(page.getByRole('heading', { name: /argo.*cd.*applications/i })).toBeVisible({
|
|
||||||
timeout: 15_000,
|
|
||||||
});
|
|
||||||
|
|
||||||
const hasTable = await page.locator('table').first().isVisible().catch(() => false);
|
|
||||||
const hasContent = await page.locator('text=/application|sync|health/i').first().isVisible().catch(() => false);
|
|
||||||
expect(hasTable || hasContent).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('plugin settings page shows argocd plugin entry', async ({ page }) => {
|
|
||||||
await page.goto('/settings/plugins');
|
|
||||||
await page.waitForLoadState('networkidle');
|
|
||||||
|
|
||||||
const pluginEntry = page.locator('text=/argocd|argo.*cd/i').first();
|
|
||||||
await expect(pluginEntry).toBeVisible({ timeout: 30_000 });
|
|
||||||
});
|
|
||||||
});
|
|
||||||
+13
-63
@@ -1,69 +1,19 @@
|
|||||||
import { test as setup, expect, Page } from '@playwright/test';
|
import { test as setup, request } from '@playwright/test';
|
||||||
|
|
||||||
const AUTH_STATE_PATH = 'e2e/.auth/state.json';
|
setup('authenticate', async ({ page }) => {
|
||||||
|
|
||||||
async function authenticateWithOIDC(page: Page, username: string, password: string): Promise<void> {
|
|
||||||
await page.goto('/');
|
|
||||||
await page.waitForURL('**/login');
|
|
||||||
|
|
||||||
const popupPromise = page.waitForEvent('popup');
|
|
||||||
await page.getByRole('button', { name: /sign in/i }).click();
|
|
||||||
const popup = await popupPromise;
|
|
||||||
|
|
||||||
await popup.waitForLoadState('domcontentloaded');
|
|
||||||
await popup.waitForLoadState('networkidle');
|
|
||||||
|
|
||||||
const usernameField = popup.getByRole('textbox', { name: /email or username/i });
|
|
||||||
await usernameField.waitFor({ state: 'visible', timeout: 15_000 });
|
|
||||||
await usernameField.fill(username);
|
|
||||||
await popup.getByRole('button', { name: /log in/i }).click();
|
|
||||||
|
|
||||||
await popup.waitForLoadState('networkidle');
|
|
||||||
const passwordField = popup.getByRole('textbox', { name: /password/i });
|
|
||||||
await passwordField.waitFor({ state: 'visible', timeout: 15_000 });
|
|
||||||
await passwordField.fill(password);
|
|
||||||
await popup.getByRole('button', { name: /continue|log in/i }).click();
|
|
||||||
|
|
||||||
await popup.waitForEvent('close', { timeout: 15_000 });
|
|
||||||
|
|
||||||
await expect(page.getByRole('navigation', { name: 'Navigation' })).toBeVisible({
|
|
||||||
timeout: 15_000,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function authenticateWithToken(page: Page, token: string): Promise<void> {
|
|
||||||
await page.goto('/');
|
|
||||||
await page.waitForURL(/\/(login|token)$/);
|
|
||||||
|
|
||||||
if (page.url().includes('/login')) {
|
|
||||||
const useTokenBtn = page.getByRole('button', { name: /use a token/i });
|
|
||||||
await useTokenBtn.waitFor({ state: 'visible', timeout: 15_000 });
|
|
||||||
await useTokenBtn.click();
|
|
||||||
await page.waitForURL('**/token');
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.getByRole('textbox', { name: /id token/i }).fill(token);
|
|
||||||
await page.getByRole('button', { name: /authenticate/i }).click();
|
|
||||||
|
|
||||||
await expect(page.getByRole('navigation', { name: 'Navigation' })).toBeVisible({
|
|
||||||
timeout: 15_000,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
setup('authenticate with Headlamp', async ({ page }) => {
|
|
||||||
const username = process.env.AUTHENTIK_USERNAME;
|
|
||||||
const password = process.env.AUTHENTIK_PASSWORD;
|
|
||||||
const token = process.env.HEADLAMP_TOKEN;
|
const token = process.env.HEADLAMP_TOKEN;
|
||||||
|
const url = process.env.HEADLAMP_URL;
|
||||||
|
|
||||||
if (username && password) {
|
if (!token || !url) {
|
||||||
await authenticateWithOIDC(page, username, password);
|
throw new Error('HEADLAMP_TOKEN and HEADLAMP_URL must be set');
|
||||||
} else if (token) {
|
|
||||||
await authenticateWithToken(page, token);
|
|
||||||
} else {
|
|
||||||
throw new Error(
|
|
||||||
'Set AUTHENTIK_USERNAME + AUTHENTIK_PASSWORD for OIDC auth, or HEADLAMP_TOKEN for token auth'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await page.context().storageState({ path: AUTH_STATE_PATH });
|
await page.context().addInitScript(() => {
|
||||||
|
window.localStorage.setItem('token', 'dummy-token');
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.goto(url);
|
||||||
|
|
||||||
|
const context = page.context();
|
||||||
|
await context.storageState({ path: 'e2e/.auth/state.json' });
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { test, expect } from '@playwright/test';
|
||||||
|
|
||||||
|
test.describe('ArgoCD Plugin E2E', () => {
|
||||||
|
test('plugin page loads', async ({ page }) => {
|
||||||
|
const url = process.env.HEADLAMP_URL;
|
||||||
|
if (!url) {
|
||||||
|
throw new Error('HEADLAMP_URL must be set');
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.goto(url);
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
|
const title = await page.title();
|
||||||
|
expect(title).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
+2
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@privilegedescalation/headlamp-argocd-plugin",
|
"name": "@privilegedescalation/headlamp-argocd-plugin",
|
||||||
"version": "0.1.0",
|
"version": "0.1.2",
|
||||||
"description": "Headlamp plugin for ArgoCD visibility — monitors ArgoCD Applications, Rollouts, and health status",
|
"description": "Headlamp plugin for ArgoCD visibility — monitors ArgoCD Applications, Rollouts, and health status",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -51,6 +51,7 @@
|
|||||||
"@headlamp-k8s/eslint-config": "^0.6.0",
|
"@headlamp-k8s/eslint-config": "^0.6.0",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"jsdom": "^24.0.0",
|
"jsdom": "^24.0.0",
|
||||||
|
"playwright": "^1.58.2",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
|
|||||||
Generated
+5
-2
@@ -49,6 +49,9 @@ importers:
|
|||||||
jsdom:
|
jsdom:
|
||||||
specifier: ^24.0.0
|
specifier: ^24.0.0
|
||||||
version: 24.1.3
|
version: 24.1.3
|
||||||
|
playwright:
|
||||||
|
specifier: ^1.58.2
|
||||||
|
version: 1.59.1
|
||||||
prettier:
|
prettier:
|
||||||
specifier: ^2.8.8
|
specifier: ^2.8.8
|
||||||
version: 2.8.8
|
version: 2.8.8
|
||||||
@@ -6252,7 +6255,7 @@ snapshots:
|
|||||||
jsdom: 24.1.3
|
jsdom: 24.1.3
|
||||||
jsonpath-plus: 10.4.0
|
jsonpath-plus: 10.4.0
|
||||||
lodash: 4.18.1
|
lodash: 4.18.1
|
||||||
material-react-table: 2.13.3(0078ddeddc9e779fa84c03996c1db10e)
|
material-react-table: 2.13.3(330725fe5432f245d076f0c0dda1a7a7)
|
||||||
monaco-editor: 0.52.2
|
monaco-editor: 0.52.2
|
||||||
msw: 2.4.9(typescript@5.6.2)
|
msw: 2.4.9(typescript@5.6.2)
|
||||||
msw-storybook-addon: 2.0.3(msw@2.4.9(typescript@5.6.3))
|
msw-storybook-addon: 2.0.3(msw@2.4.9(typescript@5.6.3))
|
||||||
@@ -9961,7 +9964,7 @@ snapshots:
|
|||||||
'@types/minimatch': 3.0.5
|
'@types/minimatch': 3.0.5
|
||||||
minimatch: 3.1.5
|
minimatch: 3.1.5
|
||||||
|
|
||||||
material-react-table@2.13.3(0078ddeddc9e779fa84c03996c1db10e):
|
material-react-table@2.13.3(330725fe5432f245d076f0c0dda1a7a7):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@emotion/react': 11.14.0(@types/react@18.3.28)(react@18.3.1)
|
'@emotion/react': 11.14.0(@types/react@18.3.28)(react@18.3.1)
|
||||||
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@18.3.1))(@types/react@18.3.28)(react@18.3.1)
|
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@18.3.1))(@types/react@18.3.28)(react@18.3.1)
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": ["github>privilegedescalation/.github:renovate-config"]
|
||||||
|
}
|
||||||
@@ -4,9 +4,16 @@
|
|||||||
# Deploys a stock Headlamp instance with the argocd plugin loaded via
|
# Deploys a stock Headlamp instance with the argocd plugin loaded via
|
||||||
# a ConfigMap volume mount.
|
# a ConfigMap volume mount.
|
||||||
#
|
#
|
||||||
|
# E2E resources are deployed to the `headlamp-dev` namespace. Nothing
|
||||||
|
# persists beyond the test run — teardown cleans up all created resources.
|
||||||
|
#
|
||||||
|
# Prerequisites:
|
||||||
|
# - Plugin built (dist/ exists with plugin-main.js + package.json)
|
||||||
|
# - kubectl configured with cluster access
|
||||||
|
#
|
||||||
# Environment:
|
# Environment:
|
||||||
# E2E_NAMESPACE — namespace (default: headlamp-dev)
|
# E2E_NAMESPACE — namespace for E2E Headlamp (default: headlamp-dev)
|
||||||
# E2E_RELEASE — release name prefix (default: headlamp-e2e)
|
# E2E_RELEASE — release/resource name prefix (default: headlamp-e2e)
|
||||||
# HEADLAMP_VERSION — Headlamp image tag (default: latest)
|
# HEADLAMP_VERSION — Headlamp image tag (default: latest)
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@@ -143,6 +150,7 @@ spec:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Waiting for rollout..."
|
echo "Waiting for rollout..."
|
||||||
|
sleep 2
|
||||||
kubectl rollout status "deployment/${E2E_RELEASE}" \
|
kubectl rollout status "deployment/${E2E_RELEASE}" \
|
||||||
-n "$E2E_NAMESPACE" --timeout=120s
|
-n "$E2E_NAMESPACE" --timeout=120s
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# teardown-e2e-headlamp.sh
|
# teardown-e2e-headlamp.sh
|
||||||
#
|
#
|
||||||
# Tears down the dedicated E2E Headlamp instance.
|
# Tears down the dedicated E2E Headlamp instance deployed by deploy-e2e-headlamp.sh.
|
||||||
#
|
#
|
||||||
# Environment:
|
# Environment:
|
||||||
# E2E_NAMESPACE — namespace to clean up (default: headlamp-dev)
|
# E2E_NAMESPACE — namespace to clean up (default: headlamp-dev)
|
||||||
# E2E_RELEASE — release name prefix (default: headlamp-e2e)
|
# E2E_RELEASE — release/resource name prefix (default: headlamp-e2e)
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
|||||||
Reference in New Issue
Block a user