Skip to content

Fix: Name the Sonar project SonarCloud creates - #1

Merged
ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:fix/sonar-project-key
Sep 23, 2026
Merged

ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:fix/sonar-project-key

Conversation

@ModeSevenIndustrialSolutions

Copy link
Copy Markdown
Member

Summary

The seed named the Sonar project test-python-submodules. SonarCloud names a project it creates from a GitHub repository <organization>_<repository>, so the unprefixed key names no project at all.

Found while building the assertions that consume this fixture (lfreleng-actions/security-workflows#74). Those legs query SonarCloud for this project's analysis, and against the current key they would read nothing.

Evidence

The convention was copied from test-python-project, whose properties file carries the same stale key. SonarCloud knows that project only under the prefixed name:

$ curl -s -o /dev/null -w '%{http_code}' 'https://sonarcloud.io/api/components/show?component=test-python-project'
404
$ curl -s -o /dev/null -w '%{http_code}' 'https://sonarcloud.io/api/components/show?component=lfreleng-actions_test-python-project'
200

The only two anonymously visible projects in the lfreleng-actions SonarCloud organisation both follow the prefixed form: lfreleng-actions_lftools-uv and lfreleng-actions_test-python-project.

Scope

One file at the parent level. The submodule pins name the first three commits by SHA, and they are untouched: all four seed commits remain ancestors of this branch, and the tip still pins direct to 0abcde7.

test-python-project has the same stale key but still works in practice, because an explicit sonar_project_key or SonarCloud's automatic analysis can override it. It deserves its own fix in its own repository rather than a drive-by here.

Validation

  • prek run --all-files: all hooks pass
  • zizmor --persona auditor: 0 findings
  • aislop ci --changes --base upstream/main: 0 errors, 0 warnings
  • gitlint: clean; commit signed with DCO sign-off

The seed named the project test-python-submodules, but SonarCloud
names a project it creates from a GitHub repository
<organization>_<repository>. The unprefixed key names no project, so
the security-workflows legs asserting on this fixture's analysis
would have read nothing.

The convention was copied from test-python-project, whose properties
file carries the same stale key: SonarCloud knows that project only
as lfreleng-actions_test-python-project.

Only the parent level's file changes. The submodule pins name the
first three commits by SHA and are untouched.

Co-authored-by: Claude <[email protected]>
Signed-off-by: Matthew Watkins <[email protected]>

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The focused configuration correction matches SonarCloud naming and introduces no unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Corrects the SonarCloud project key so downstream security-workflow assertions query the actual repository project.

Changes:

  • Prefixes the project key with the SonarCloud organization.
  • Documents the naming convention and related fixture discrepancy.
File Description
sonar-project.properties Corrects and explains the SonarCloud project key.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@zxiiro zxiiro 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.

🤖 Auto-approved by agent: reviewed workflow/code change for security and CI/CD impact, found low risk. Aligns sonar.projectKey to SonarCloud's org_repo naming for this fixture; comments only otherwise; no secrets, permissions, or workflow logic changes.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 9e60865 into lfreleng-actions:main Sep 23, 2026
10 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the fix/sonar-project-key branch September 23, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants