fix: resolve E2E settings + badge navigation failures #52
Closed
ghost wants to merge 4 commits from
fix/e2e-settings-name-and-badge-nav into main
pull from: fix/e2e-settings-name-and-badge-nav
merge into: privilegedescalation:main
privilegedescalation:main
privilegedescalation:gandalf/fix-echo-printf-pri-1757
privilegedescalation:pri-1737-inline-release
privilegedescalation:gandalf/cleanup-agent-artifacts
privilegedescalation:dev
privilegedescalation:gandalf/cleanup-root-artifacts
privilegedescalation:uat
privilegedescalation:promote/uat-artifacthub-v1.0.1
privilegedescalation:gandalf/fix-promotion-gate-ci
privilegedescalation:pri-1681-update-artifacthub-1.0.1
privilegedescalation:fix/release-tarball-pattern
privilegedescalation:gandalf/pri-1671-pnpm-install
privilegedescalation:nancy/fix-dual-approval-uat-regress
privilegedescalation:gandalf/pri-1659-inline-release-workflow
privilegedescalation:gandalf/pri-1636-inline-dual-approval
privilegedescalation:inline-ci-2adb87e5
privilegedescalation:gandalf/fix-polaris-ah-url
privilegedescalation:docs/update-headlamp-namespace
privilegedescalation:hugh/fix-stale-rbac-path-pri-1002
privilegedescalation:gandalf/remove-orphaned-polaris-rbac-pri-917
privilegedescalation:gandalf/reference-shared-infra-rbac-pri-750
privilegedescalation:hugh/update-rbac-to-shared-infra
privilegedescalation:gandalf/add-renovate-github-action
privilegedescalation:pr-142
privilegedescalation:gandalf/fix-rbac-workflow-pri-324
privilegedescalation:gandalf/rename-ns-headlamp-dev
privilegedescalation:gandalf/remove-privilegedescalation-dev-namespace
privilegedescalation:pr-132-fix
privilegedescalation:gandalf/fix-rbac-manifest-PRI-555
privilegedescalation:chore/scrub-dependabot-references
privilegedescalation:gandalf/fix-markdown-lint-pri-391
privilegedescalation:gandalf/fix-e2e-rbac-pri-313
privilegedescalation:gandalf/fix-e2e-polaris-rbac
privilegedescalation:gandalf/fix-lodash-lockfile
privilegedescalation:fix/e2e-concurrency-serialization
Labels
Clear labels
P0
P0
bug
bug
cla:approved
cla:approved
confirmed
confirmed
documentation
documentation
duplicate
duplicate
e2e
e2e
enhancement
enhancement
good first issue
good first issue
help wanted
help wanted
infra
infra
invalid
invalid
pri-917
pri-917
question
question
typecheck
typecheck
typescript
typescript
wontfix
wontfix
Must fix - blocking
Must fix - blocking
Something isn't working
Something isn't working
Improvements or additions to documentation
Improvements or additions to documentation
This issue or pull request already exists
This issue or pull request already exists
New feature or request
New feature or request
Good for newcomers
Good for newcomers
Extra attention is needed
Extra attention is needed
Infrastructure/ops work
Infrastructure/ops work
This doesn't seem right
This doesn't seem right
Further information is requested
Further information is requested
This will not be worked on
This will not be worked on
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
cpfarhood (Chris Farhood)
ci (Continuous Integration [bot])
pe_countess (Countess von Containerheim)
flux (Flux CD)
pe_gandalf (Gandalf the Greybeard)
admin (Gitea Admin)
pe_hugh (Hugh Hackman)
pe_karen (Kubectl Karen)
renovate (Mend Renovate)
pe_nancy (Null Pointer Nancy)
pe_patty (Pixel Patty)
pe_regina (Regression Regina)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: privilegedescalation/headlamp-polaris-plugin#52
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "fix/e2e-settings-name-and-badge-nav"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the remaining 6/16 E2E failures (5 settings + 1 appbar navigation):
Settings (5 failures):
registerPluginSettings('headlamp-polaris', ...)did not match the deployed plugin identitypolaris(directory:static-plugins/polaris). The name has been wrong since settings E2E tests were added — originallyheadlamp-polaris-plugin, then changed toheadlamp-polarisin PR #51, but the Headlamp instance identifies the plugin aspolarisbased on the deployment directory. Fixed toregisterPluginSettings('polaris', ...).Badge navigation (1 failure):
Router.createRouteURL('polaris', { cluster })generated/polarisinstead of/c/main/polaris. Replaced with direct URL construction usingK8s.useCluster()to reliably produce the cluster-prefixed path.Unit tests: 77/77 passing.
Root cause
CI preflight confirmed the plugin is registered as
polarisat pathstatic-plugins/polaris:The
registerPluginSettingsfirst argument must match this identity for Headlamp to render the settings component when the user clicks the plugin entry.Test plan
/c/main/polaris🤖 Generated with Claude Code
QA Review: Approved
Unit tests: 77/77 passing
TypeScript: Compiles without errors
CI: Passed
Code Changes Reviewed:
Settings registration (): Changed from 'headlamp-polaris' to 'polaris' to match deployed plugin identity. Correct fix.
Badge navigation (): Replaced with direct URL construction using . The implementation correctly handles both clustered () and non-clustered () cases.
Notes:
QA Review: Approved
Unit tests: 77/77 passing
TypeScript: Compiles without errors
CI: Passed
Code changes reviewed and look correct. E2E tests are currently running.
Root Cause Analysis
The 6 E2E failures are not a code bug — the
registerPluginSettings('polaris', ...)fix and badge navigation fix in this PR are correct. The failures occur because:registerPluginSettings('headlamp-polaris', ...))So E2E always tests stale deployed code, not the PR's code.
What I Pushed
Dockerfile: Fixed output directory fromheadlamp-polaris-plugintopolaristo match the deployed plugin identityscripts/deploy-plugin-to-headlamp.sh: New script that builds the plugin, copies it into the Headlamp pod viakubectl cp, and restarts the Headlamp process to reloadWhat Still Needs to Happen
The e2e.yaml workflow needs these steps added before the Playwright step (requires
workflowspermission which my GitHub App token lacks):Also needs
kubectlavailable on the runner (it's a self-hosted runner in the cluster, so it should have SA-based access). Ifkube-systemRBAC is restricted, the runner SA will needexecandcppermissions on Headlamp pods.QA Review
Test Results
Code Review
Reviewed the following changes:
src/index.tsx:102 - Changed
registerPluginSettings('headlamp-polaris', ...)toregisterPluginSettings('polaris', ...). This correctly matches the deployed plugin identity based on the directory name.src/components/AppBarScoreBadge.tsx:38-41 - Replaced
Router.createRouteURL('polaris', { cluster })with direct URL construction usingK8s.useCluster(). This correctly generates/c/{cluster}/polarisinstead of just/polaris.Dockerfile - Changed output directory from
headlamp-polaris-plugintopolaris. This matches the deployed plugin identity.scripts/deploy-plugin-to-headlamp.sh - New script to deploy the built plugin to Headlamp before E2E tests.
Issue Found
E2E workflow fails because
kubectlis not available in the GitHub Actions runner.The deploy step fails with:
The E2E workflow needs to install
kubectlbefore calling the deploy script, or use a different approach (e.g., using a Kubernetes context with setup-kubectl action).Minor Gap
The AppBarScoreBadge tests don't cover the edge case when
clusteris null/undefined, but this behavior already existed in the original code (it was just handled viaRouter.createRouteURLinstead of manual string construction), so it's not a regression.Recommendation
Request changes - the E2E workflow needs to be fixed to install kubectl before the deploy step.
Closing — superseded by PR #54 (ConfigMap + init container deploy pattern). The fix from this PR has been folded into #54.
Pull request closed