Skip to content

chore: PLTF-3502 add SonarQube analysis - #350

Draft
aivong-openhands wants to merge 1 commit into
mainfrom
av/sonarqube-scan
Draft

chore: PLTF-3502 add SonarQube analysis#350
aivong-openhands wants to merge 1 commit into
mainfrom
av/sonarqube-scan

Conversation

@aivong-openhands

Copy link
Copy Markdown
Contributor

Why

We're evaluating SonarQube as a code health scorecard across five repos, and this is the analysis config for this one. It runs as a step in tests.yml rather than a separate workflow, because the pytest step there already writes coverage.xml via --cov-report=xml — so coverage always comes from the commit being analysed, and no test run is duplicated. sonar.sources is openhands with tests declared separately: SonarQube requires the two to be disjoint sets and aborts if a file is reachable from both. The POC is time-boxed and the instance is disposable, so this is expected to be reverted rather than kept.

The scan is skipped for fork pull requests, which get no secrets and could only fail on a missing token.

Validation

  • coverage.xml already exists at the path configuredtests.yml runs pytest with --cov=openhands/automation --cov-report=xml:coverage.xml, so no new coverage plumbing was needed.
  • Sources and tests are disjointtests/ is top level, not nested inside openhands/, so the indexed-twice failure does not apply here.
  • sonar.python.version=3.12 matches .python-version and requires-python = ">=3.12".
  • This repo is Python only — 1.66 MB Python with no package.json, frontend/ or JS lockfile, so no frontend coverage or dependency install is involved.
  • The scanner action is pinned to a full commit SHA, with the version in a trailing comment.

This PR was drafted by an AI agent on behalf of the user.

Runs as a step in tests.yml rather than a separate workflow: the pytest step
already writes coverage.xml via --cov-report, so the report is from the analysed
commit and nothing is duplicated.

tests/ is top level, so sources and tests are disjoint -- SonarQube aborts if a
file is reachable from both. Checkout gains fetch-depth: 0, which SonarQube needs
to attribute issues to authors.
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

@aivong-openhands aivong-openhands changed the title PLTF-3502: Add SonarQube analysis with coverage chore: PLTF-3502 add SonarQube analysis with coverage Aug 19, 2026
@aivong-openhands aivong-openhands changed the title chore: PLTF-3502 add SonarQube analysis with coverage chore: PLTF-3502 add SonarQube analysis Aug 19, 2026
@github-actions github-actions Bot added the type: chore Maintenance / chores label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: chore Maintenance / chores

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant