Skip to content

[DEVEX-1727] Add reusable SonarQube manual-scan workflow - #159

Closed
aspencer wants to merge 3 commits into
mainfrom
devex-1727-sonarqube-manual-scan
Closed

[DEVEX-1727] Add reusable SonarQube manual-scan workflow#159
aspencer wants to merge 3 commits into
mainfrom
devex-1727-sonarqube-manual-scan

Conversation

@aspencer

@aspencer aspencer commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds sonarqube-manual.yaml reusable workflow for on-demand SonarCloud scans with a configurable quality profile
  • Supports optional coverage artifact download from a prior workflow run ID
  • Caches ~/.sonar/cache to speed up repeated manual scans
  • Documents consumer setup in README

JIRA

https://revolutionparts.atlassian.net/browse/DEVEX-1727

Merge order

Merge this PR before encodium/common#TBD (consumer wrapper references @main).

Test plan

  • actionlint passes on new workflow YAML
  • After merge, run SonarQube Manual Scan from encodium/common Actions tab with profile Sonar way
  • Optional: re-run with coverage_workflow_run_id from a recent unit_tests run

Made with Cursor

Add workflow_call workflow with quality_profile input, optional coverage
artifact download from a prior run, and Sonar scanner cache.

DEVEX-1727

Co-authored-by: Cursor <cursoragent@cursor.com>
@aspencer
aspencer requested a review from a team as a code owner August 3, 2026 16:45
@aspencer
aspencer requested a review from ronneseth August 3, 2026 16:45
Comment thread .github/workflows/sonarqube-manual.yaml Outdated
Comment thread .github/workflows/sonarqube-manual.yaml Outdated
Comment thread .github/workflows/sonarqube-manual.yaml Outdated
aspencer and others added 2 commits August 3, 2026 10:06
Switch quality profiles via SonarCloud API instead of unsupported
scanner args, remove Docker-era coverage path rewrite, and require an
explicit coverage artifact pattern when downloading from a prior run.

DEVEX-1727

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop coverage artifact download and revert README changes. This
workflow is for on-demand security profile scans only.

DEVEX-1727

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4547cf3. Configure here.

"https://sonarcloud.io/api/qualityprofiles/add_project" \
--data-urlencode "project=${{ steps.sonar_profile.outputs.project_key }}" \
--data-urlencode "qualityProfile=${{ steps.sonar_profile.outputs.previous_profile }}" \
--data-urlencode "language=${{ inputs.sonar_language }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Racy quality profile restore

Medium Severity

The workflow reads the current SonarCloud profile, switches it for the scan, then restores it, with no concurrency guard. Overlapping manual runs—or a normal CI Sonar scan in the same window—can capture another run’s temporary profile and restore that instead, leaving the project stuck on the wrong profile.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4547cf3. Configure here.

@aspencer

aspencer commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing for now — SonarCloud profile switching via API has concurrency/race risks with normal CI scans, and SonarCloud has no UI trigger for on-demand analysis. The simpler path is: disable slow taint rules on the default CI profile + use review-code-security for PR coverage. Can revisit a minimal workflow_dispatch (no API profile mutation) later if needed.

DEVEX-1727

@aspencer aspencer closed this Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant