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

Branch plugin can break SonarQube projects #991

Open
DanielKubisch opened this issue Oct 30, 2024 · 2 comments
Open

Branch plugin can break SonarQube projects #991

DanielKubisch opened this issue Oct 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@DanielKubisch
Copy link

Describe the bug
The branch plugin can break SonarQube projects in some cases when sonar.pullrequest.branch is defined in the analysis.
Users have reported reported unreachable projects, on closer inspection the error is caused by one or more faulty project pull request, that shouldn't exist in the first place. This completely blocks the access to the project on the GUI. Deleting the faulty pull requests through the API fixes the project.

Error message on GUI:
image
Closer inspection of the error:
image

To Reproduce
Steps to reproduce the behavior (1st option):
-Create a new project and run a branch analysis without ever running an analysis on the main branch.
-Arguments that were used when running the analysis: -Dsonar.analysis.mode=publish -Dsonar.pullrequest.branch= -Dsonar.pullrequest.key= -Dsonar.pullrequest.base=master

Steps to reproduce the behavior (2nd option):
-Set a faulty server side project setting (for example: sonar.issue.ignore.multicriteria and leaving the File Path Pattern empty)
-Set the same setting in the analysis setting but in a correct way.
-Run the analysis with the following arguments defined: -Dsonar.analysis.mode=publish -Dsonar.pullrequest.branch= -Dsonar.pullrequest.key= -Dsonar.pullrequest.base=master

Expected behavior
It is expected to not create faulty Pull Request when the analysis fails.

Software Versions

  • SonarQube Version: 9.9.4 and 9.9.6
  • Plugin Version: 1.14.0
@DanielKubisch DanielKubisch added the bug Something isn't working label Oct 30, 2024
@m-goetz
Copy link

m-goetz commented Oct 31, 2024

Ran into the same problem today. As @DanielKubisch mentioned, deleting the faulty PR via the API solves the problem: https://next.sonarqube.com/sonarqube/web_api/api/project_pull_requests/delete

In my case (GitLab MRs), the "Pull request id" matches the ID in GitLab without the prefix "MR-".

@mc1arke
Copy link
Owner

mc1arke commented Nov 11, 2024

This sounds like #738 against the LTS branch, however the fix for that introduced #909 as far as I remember.

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

3 participants