Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNES Fails to Generate Reports for Pull Requests in SonarQube #356

Open
alexandrasims opened this issue May 23, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@alexandrasims
Copy link

Describe the bug

When using the the Sonar CNES Report tool within our CI/CD pipeline, the report fails to generate after CNES attempts to fetch project data from the SonarQube server for a Pull Request.

After reviewing the sonar-cnes-report codebase, it appears that the tool has not yet implemented the ability to handle generating reports for Pull Requests in SonarQube?

As a result, our users are not able to generate CNES reports for their projects during Pull Request builds. This is causing disruptions for them during their normal development workflow.

To reproduce

Steps to reproduce the behavior.

  1. Version control system is configured to trigger a project build in CI/CD tool for a newly opened Pull Request (which includes a sonar scan and CNES report generation).

  2. The sonar scan results for the PR are successfully pushed to the SonarQube server by the sonar scanner from the CI/CD tool; however, the Sonar CNES Report tool fails to run due to not being able to find the project branch name within SonarQube.

I believe this is because the CNES tool only uses the internal SonarQube API call, GET api/navigation/component with the branch parameter to retrieve project data, instead of also accounting for project branches that need to be called with the pullRequest parameter.

It also seems like SonarQube is only expecting the PR number from the pull request name for the parameter value:
https://<sonarqubeserver>/dashboard?id=project-name&pullRequest=412

Expected behavior

Expected behavior is for the Sonar CNES Report tool to be able to successfully make a call to a Pull Request on a SonarQube server.

Screenshots & log

image image

User environment

  • Project version: 4.1.3
  • SonarQube Server version: 9.9.0.65466
@alexandrasims alexandrasims added the bug Something isn't working label May 23, 2023
@bientt210
Copy link

Sonarqube 9.9 support from version 4.2.0, you may need to update to version 4.2.0.

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

No branches or pull requests

2 participants