Skip to content

feat: opt-in Security Hotspot support (include-hotspots) - #96

Merged
vmvarela merged 1 commit into
masterfrom
feat/hotspots
Dec 4, 2026
Merged

vmvarela merged 1 commit into
masterfrom
feat/hotspots

Conversation

@vmvarela

@vmvarela vmvarela commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Closes #48.

What

Adds an opt-in include-hotspots input. When enabled, the action fetches /api/hotspots/search (SonarQube >= 9.8) and exports Security Hotspots alongside issues.

  • Normalizes hotspots into the existing issue model: HIGH → CRITICAL, MEDIUM → MAJOR, LOW → MINOR, so min-severity, PR file filtering, stats, check runs and SARIF conversion work unchanged.
  • Fetches hotspot rule details via /api/rules/show and derives security-severity from vulnerabilityProbability (hotspot rules report severity INFO).
  • Sends both project and projectKey to cover the 10.2 rename and 2026.6 removal; branch only when configured; status=TO_REVIEW unless include-resolved.
  • Warns and truncates above the 10k API cap; under pin-to-analysis an incomplete export fails with incomplete-fetch.
  • A 403 (server older than 9.8) warns and continues without hotspots.

Tests

  • 18 new tests: pagination/dedup, status filter, 403 in both modes, 10k and incomplete-fetch branches, severity mapping, golden SARIF security-severity, stats, and pin fetch ordering.
  • format -- --check, lint, test:coverage (264 tests) and build pass; dist rebuilt.

Notes

  • Requires SonarQube >= 9.8: /api/hotspots/search was internal before that.
  • The endpoint is deprecated in SonarQube 2026.4, where hotspots become security issues.
  • Not verified against a live Community Edition instance.

Fetches /api/hotspots/search (SQ >= 9.8) when include-hotspots is true, normalizes hotspots into the issue model (HIGH->CRITICAL, MEDIUM->MAJOR, LOW->MINOR), fetches rule details and derives SARIF security-severity from vulnerabilityProbability. Reuses the existing severity filter, PR file filter, stats and pin verification; warns and truncates above the 10k API cap, refuses incomplete pinned exports.
@github-actions github-actions Bot added the type:feature New functionality label Dec 4, 2026
@vmvarela
vmvarela merged commit 22e4171 into master Dec 4, 2026
6 checks passed
vmvarela added a commit that referenced this pull request Dec 4, 2026
…be 2026.4 (#98)

* Revert "feat: opt-in Security Hotspot support (include-hotspots) (#96)"

This reverts commit 22e4171.

* chore: drop hotspots-count output and require SonarQube 2026.4

Follow-up to reverting #96: the deprecated /api/hotspots/search endpoint is no longer queried, so the output is removed and the supported minimum moves to 2026.4, where hotspots are reported as issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: optional Security Hotspot support via /api/hotspots/search

1 participant