Skip to content

Fix SonarQube Coverage Reporting After Gradle 9.4 Upgrade#1694

Merged
meladRaouf merged 1 commit into
mainfrom
bugfix/sonar-coverage
Jun 4, 2026
Merged

Fix SonarQube Coverage Reporting After Gradle 9.4 Upgrade#1694
meladRaouf merged 1 commit into
mainfrom
bugfix/sonar-coverage

Conversation

@meladRaouf
Copy link
Copy Markdown
Collaborator

@meladRaouf meladRaouf commented Jun 3, 2026

JIRA ticket
Will be released in: 2026.3.0

Root cause analysis (for bugfixes only)

First known affected version: 2026.3.0

  • After upgrading to Gradle 9.4, the Sonar plugin stopped working because the source code path was being provided in twice in some places and the jacoco report paths were changed.

Notable changes

  • Removed the duplicate SonarQube configuration block and fixed the JaCoCo lookup configuration.
  • Updated two unrelated Kotlin files to ensure unit tests are executed, and coverage reports are generated correctly.

Testing guidance

  • the sonar should succeed, and coverage report should be generated

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repository’s SonarQube configuration to restore coverage reporting after the Gradle 9.4 upgrade, primarily by centralizing Sonar settings and making binary output discovery more resilient across modules.

Changes:

  • Refactors build-logic/sonarqube.gradle to set the Jacoco XML report path and dynamically locate compiled class directories for sonar.java.binaries.
  • Removes the module-local SonarQube skip configuration from :infra:resources, relying on centralized Sonar configuration instead.
  • Updates multiple Hilt-injected Context constructor parameters to use the @param:ApplicationContext use-site target.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
testing/data-generator/src/main/java/com/simprints/feature/datagenerator/events/SqlEventTemplateLoader.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/ui-base/src/main/java/com/simprints/infra/uibase/camera/qrscan/CameraHelper.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/security/src/main/java/com/simprints/infra/security/root/RootManagerImpl.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/resources/build.gradle.kts Removes module-local SonarQube skip block (skip now handled centrally).
infra/network/src/main/java/com/simprints/infra/network/url/BaseUrlProviderImpl.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/network/src/main/java/com/simprints/infra/network/httpclient/BuildOkHttpClientUseCase.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/network/src/main/java/com/simprints/infra/network/connectivity/ConnectivityManagerWrapper.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/events/src/main/java/com/simprints/infra/events/event/local/EventDatabaseFactory.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/event-sync/src/main/java/com/simprints/infra/eventsync/permission/CommCarePermissionChecker.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/event-sync/src/main/java/com/simprints/infra/eventsync/event/commcare/CommCareEventDataSource.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/enrolment-records/room-store/src/main/java/com/simprints/infra/enrolment/records/room/store/SubjectsDatabaseFactory.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/config-store/src/main/java/com/simprints/infra/config/store/local/migrations/DeviceConfigSharedPrefsMigration.kt Adjusts Hilt qualifier use-site target for injected Context.
infra/config-store/src/main/java/com/simprints/infra/config/store/LastCallingPackageStore.kt Adjusts Hilt qualifier use-site target and minor formatting update.
fingerprint/infra/scanner/src/main/java/com/simprints/fingerprint/infra/scanner/tools/BatteryLevelChecker.kt Adjusts Hilt qualifier use-site target for injected Context.
fingerprint/capture/src/main/java/com/simprints/fingerprint/capture/screen/PlayAudioBeepUseCase.kt Adjusts Hilt qualifier use-site target for injected Context.
feature/dashboard/src/test/java/com/simprints/feature/dashboard/tools/di/FakeCoreModule.kt Simplifies WorkManager provider (no longer requires @ApplicationContext parameter).
face/infra/simface/src/main/java/com/simprints/face/infra/simface/initialization/SimFaceInitializer.kt Adjusts Hilt qualifier use-site target for injected Context.
face/capture/src/main/java/com/simprints/face/capture/usecases/IsUsingAutoCaptureUseCase.kt Adjusts Hilt qualifier use-site target for injected Context.
build-logic/sonarqube.gradle Central Sonar configuration updated: sets android variant, Jacoco XML path, and dynamically resolves compiled binaries directories.
build-logic/convention/src/main/kotlin/PipelineSonarConventionPlugin.kt Removes the now-redundant Sonar convention plugin implementation.

Comment thread build-logic/sonarqube.gradle Outdated
@meladRaouf meladRaouf force-pushed the bugfix/sonar-coverage branch 4 times, most recently from 02fc112 to 4c70993 Compare June 3, 2026 21:01
@meladRaouf meladRaouf force-pushed the bugfix/sonar-coverage branch from 4c70993 to fdec1a9 Compare June 3, 2026 21:16
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@meladRaouf meladRaouf merged commit 64ed291 into main Jun 4, 2026
15 checks passed
@meladRaouf meladRaouf deleted the bugfix/sonar-coverage branch June 4, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants