-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
[Gitlab] Merge Request Decoration doesn't support MR from fork project to main project #181
Comments
I believe this is related to the fix that @arch1tect0r has proposed as part of #179 |
Yup, you're right. It's duplicated. |
…ed project When submitting the status of a merge request to Gitlab, the plugin was attempting to submit to a commit on the MR's target project, but was getting a `404 Not Found` response from the Gitlab API where the source project was not the same as the target project, such as the source project being a fork. This change retrieves the MR details from the Gitlab API and retrieves the source project ID for use during subsequent decoration calls, so the commit will be searched for in the correct project.
Fixed in 1.7.0 of the plugin |
Hi, @mc1arke |
Hi there,
First I want to thank you for the good work on the plugin!
but It seems the latest plugin 1.3.0 still not support Gitlab MR decoration for MR from forked project to main project.
I have a main project main/master and a fork project own/master, when I create a MR and trigger the CI pipeline, sonarqube showing the correct MR analysis, but there's no decoration comment on gitlab side.
From the log I can see
it's reporting the post statuses failed.
The statuses URL is
https://localhost//api/v4/projects/2489/statuses/f75f87d4e49dbf5fac735149e3f8426a2daa7ea
dfc
note the project id in URL is 2489, my main project id is 2489 and the forked project id is 2490, if I understand correctly, the postStatus is trying to update the commit's status, however this commit belongs to forked project, so using main project id 2489 is not gonna find any valid commit.
I think GitlabServerPullRequestDecorator needs to adjust to support this case.
My environment:
Sonarqube: 7.9.3 community
Branch plugin: 1.3.0
Gitlab: 12.4.0
The gradle script for generating analysis is
gradle sonarqube -Dsonar.qualitygate.wait=true -Dsonar.pullrequest.key=$CI_MERGE_REQUEST_IID -Dsonar.pullrequest.branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME -Dsonar.pullrequest.base=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME -Dsonar.pullrequest.gitlab.repositorySlug=$CI_MERGE_REQUEST_PROJECT_ID
The text was updated successfully, but these errors were encountered: