mc1arke / sonarqube-community-branch-plugin

A plugin that allows branch analysis and pull request decoration in the Community version of Sonarqube
GNU Lesser General Public License v3.0
2.24k stars 524 forks source link

Plugin 1.18 not Uploading Report with 10.3 #883

Closed zunera-aion closed 8 months ago

zunera-aion commented 8 months ago

Describe the bug Unable to upload report from Azure DevOps to the SonarQube. SonarAnalyze@5 fails at report upload.

To Reproduce This is the docker-compose file I used

version: "3"

services:
  sonarqube:
    image: sonarqube:10.3-community
    depends_on:
      - db
    environment:
      SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
      SONAR_JDBC_USERNAME: sonar
      SONAR_JDBC_PASSWORD: sonar
    volumes:
      - sonarqube1_data:/opt/sonarqube/data
      - sonarqube1_extensions:/opt/sonarqube/extensions
      - sonarqube1_logs:/opt/sonarqube/logs
      - /root/sonarqube/plugins/sonarqube-community-branch-plugin-1.18.0.jar:/opt/sonarqube/lib/common/sonarqube-community-branch-plugin-1.18.0.jar
    ports:
      - "9000:9000"
  db:
    image: postgres:12
    environment:
      POSTGRES_USER: sonar
      POSTGRES_PASSWORD: sonar
    volumes:
      - postgresql1:/var/lib/postgresql
      - postgresql1_data:/var/lib/postgresql/data

volumes:
  sonarqube1_data:
  sonarqube1_extensions:
  sonarqube1_logs:
  postgresql1:
  postgresql1_data:

Expected behavior The reports should be uploaded successfully.

Screenshots image

Software Versions

Additional context I have tried adding branch name to sonar additional properties I have also tried using the Default branch name set to my branch name in SQ settings.

mc1arke commented 8 months ago

If you're using the Sonarqube docker image rather than the one with the plugin embedded then you'll need to ensure you're setting SONAR_WEB_JAVAADDITIONALOPTS and SONAR_CE_JAVAADDITIONALOPTS in the container environment, e.g.

...
services:
  sonarqube:
    image: sonarqube:10.3-community
    depends_on:
      - db
    environment:
      SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
      SONAR_JDBC_USERNAME: sonar
      SONAR_JDBC_PASSWORD: sonar
      SONAR_WEB_JAVAADDITIONALOPTS: "-javaagent:/opt/sonarqube/lib/common/sonarqube-community-branch-plugin-1.18.0.jar=web"
      SONAR_CE_JAVAADDITIONALOPTS: "-javaagent:/opt/sonarqube/lib/common/sonarqube-community-branch-plugin-1.18.0.jar=ce"
    volumes:
      - sonarqube1_data:/opt/sonarqube/data
      - sonarqube1_extensions:/opt/sonarqube/extensions
      - sonarqube1_logs:/opt/sonarqube/logs
      - /root/sonarqube/plugins/sonarqube-community-branch-plugin-1.18.0.jar:/opt/sonarqube/lib/common/sonarqube-community-branch-plugin-1.18.0.jar
...
zunera-aion commented 8 months ago

Thanks the issue is resolved now.