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

Wrong Gitlab API url for MR decoration #84

Closed
Brightside56 opened this issue Feb 4, 2020 · 5 comments
Closed

Wrong Gitlab API url for MR decoration #84

Brightside56 opened this issue Feb 4, 2020 · 5 comments

Comments

@Brightside56
Copy link

Hello. First of all, thanks for a good job.

I've compiled jar from here:

https://github.com/mc1arke/sonarqube-community-branch-plugin/tree/sq-8_1-support

and when it comes publishing MR comment, plugin fails to do that. I'm seeing following in console:

GET /api/v4/api/v4/projects/root%2Fsonarqube/merge_requests/13/commits

As I see plugin gets hostURL with /api/v4, but also adds its own /api/v4 to url

@mc1arke
Copy link
Owner

mc1arke commented Feb 4, 2020

Firstly, can you confirm this is the latest version of that branch you're using (the one that was published on Sunday)?

Can you also confirm how the host URL is being submitted? Is this auto-detected from the Gitlab CI environment by the Sonar Runner, of a property that you're passing as part of the launch arguments for the scanner?

@Brightside56
Copy link
Author

Brightside56 commented Feb 4, 2020

Hello. Yes, it's last commit, you can see my git output below:

brightside@hp ~/git/sonarqube-community-branch-plugin
% git fetch origin
brightside@hp ~/git/sonarqube-community-branch-plugin
% git pull
Already up to date.
brightside@hp ~/git/sonarqube-community-branch-plugin
% git status
On branch sq-8_1-support

It seems to be autodetected. I'm running gitlab-ci ce pipeline this way:

  • sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.projectKey=sonatest -Dsonar.pullrequest.key=$CI_MERGE_REQUEST_ID -Dsonar.pullrequest.branch=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME -Dsonar.pullrequest.base=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME

@mc1arke
Copy link
Owner

mc1arke commented Feb 4, 2020

Ok. We're auto-detecting it from the CI pipeline variables then. I'll update the Gitlab decorator to not include the /api/v4 in the URL, and make sure it's clear to users that they need to include this if manually specifying it from the command line

@Brightside56
Copy link
Author

After removing /api/v4 from URL it's working great with gitlab

tisoft added a commit to tisoft/sonarqube-community-branch-plugin that referenced this issue Feb 11, 2020
mc1arke pushed a commit that referenced this issue Feb 17, 2020
@mc1arke
Copy link
Owner

mc1arke commented Feb 20, 2020

Fixed in #87

@mc1arke mc1arke closed this as completed Feb 20, 2020
mc1arke pushed a commit that referenced this issue Apr 19, 2020
mc1arke pushed a commit that referenced this issue Apr 20, 2020
mc1arke pushed a commit that referenced this issue May 17, 2020
mc1arke pushed a commit that referenced this issue May 17, 2020
mc1arke pushed a commit that referenced this issue Jun 7, 2020
mc1arke pushed a commit that referenced this issue Jun 7, 2020
mc1arke pushed a commit that referenced this issue Jun 7, 2020
mc1arke pushed a commit that referenced this issue Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants