Files
Bifrost/.claude/skills/sonarqube-frontend-extension/SKILL.md
T
Arnaud Dartois 021281f3dd
Build Bifrost / build (push) Failing after 2m37s
feat: add reproducible local import validation
2026-10-29 10:56:19 +01:00

2.2 KiB

name, description
name description
sonarqube-frontend-extension Use when implementing or changing a SonarQube 25.9 page extension, its JavaScript bundle, navigation placement, API calls, or browser permissions.

SonarQube frontend extension

  • Register a global page with PageDefinition; its key is bifrost/import.
  • Put the matching unbundled JavaScript at src/main/resources/static/import.js; call window.registerExtension("bifrost/import", start).
  • Use only options.el as the page mount point; return a cleanup callback.
  • Do not assume global libraries except React. Plain browser JavaScript avoids an unnecessary build step.
  • Use same-origin fetch for api/bifrost/*; rely on the active SonarQube session and never send the Gitea token to the browser. For non-GET requests, copy the readable XSRF-TOKEN cookie into the X-XSRF-TOKEN header; SonarQube 25.9 rejects cookie-authenticated POSTs without it.
  • Render API errors as accessible text; use labels for controls, semantic table headers, keyboard-accessible controls, and text status in addition to color.
  • Validate repository links as HTTP or HTTPS before assigning them to an anchor.
  • Grey out imported rows and disable their checkboxes. Keep selection in page state across organization changes.
  • Page visibility is not authorization. The server must enforce Create Projects permission on every endpoint.
  • Do not embed inline scripts or use eval.

Checklist

  • PageDefinition key matches JS registration key and resource filename.
  • Bundle packaged under /static/bifrost/import.js.
  • Accessible labels, feedback and keyboard controls.
  • No token in browser or authorization based only on menu visibility.

Sources

Not verified

  • Live page routing, bundle loading, accessible controls, selection retention, and POST CSRF behavior were verified on Community Build 25.9.0.112764. Conditional menu hiding based on Create Projects permission is not supported by the selected public page API.