-
Notifications
You must be signed in to change notification settings - Fork 79
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
updated getSonarProjectFromBuildReport to handle analysis URL that is… #131
updated getSonarProjectFromBuildReport to handle analysis URL that is… #131
Conversation
… provided by sonarqube 9.3 which includes /dashboard?id=.." in the URL
Hello @cburne-oshyn, sorry for my late response. I was a busy with other stuffs. So, for 8.9 LTS release, the build log also looks like as follows: 12:14:49 INFO: ANALYSIS SUCCESSFUL, you can browse https://prod.sonarqube.blahblah.net/dashboard?id=63e375e6-0b19-4b9e-87d0-218a629fda9c&branch=develop
12:14:49 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
12:14:49 INFO: More about the report processing at https://prod.sonarqube.blahblah.net/api/ce/task?id=AX94Ql3Pr0yhtSb6a_cC
12:14:50 INFO: Analysis total time: 32.529 s Which it's the same with yours. Right? I am not getting this issue, because I have set the influxdb-plugin/src/main/java/jenkinsci/plugins/influxdb/generators/SonarQubePointGenerator.java Line 193 in 57bacf6
So, I believe that, below snippet should fix this issue: url = match.group(1); // url = "https://prod.sonarqube.blahblah.net/dashboard?id=63e375e6-0b19-4b9e-87d0-218a629fda9c&branch=develop"
url = url.substring(0,url.lastIndexOf(('/'))); // url = "https://prod.sonarqube.blahblah.net" |
@@ -302,6 +302,10 @@ protected String getResult(String url) throws IOException { | |||
match = p_analysis_url.matcher(line); | |||
if (match.matches()) { | |||
url = match.group(1); | |||
long count = url.chars().filter(ch -> ch == '/').count(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
below should be fine
url = match.group(1); // url = "https://prod.sonarqube.blahblah.net/dashboard?id=63e375e6-0b19-4b9e-87d0-218a629fda9c&branch=develop"
url = url.substring(0,url.lastIndexOf(('/'))); // url = "https://prod.sonarqube.blahblah.net"
Hi @cburne-oshyn @kumbasar , I know this has been hanging for quite a while already. I'm currently increasing the overall unit test coverage for the whole plugin and I stumbled on this same bug and fixed it with d6bd919. I'll soon merge these unit tests/bug fixes into the main branch, so I will close this in favour of that PR. I did implement the fix based on this PR, so thanks for opening this 🙏 |
Ha! Good deal! That's great to hear. I'm still using the plugin successfully and am thankful for your maintenance of it all these years.
CHRISTIAN BURNE
…-------- Original message --------
From: Aleksi Simell ***@***.***>
Date: 2/14/24 10:51 PM (GMT-08:00)
To: jenkinsci/influxdb-plugin ***@***.***>
Cc: Christian Burne ***@***.***>, Mention ***@***.***>
Subject: Re: [jenkinsci/influxdb-plugin] updated getSonarProjectFromBuildReport to handle analysis URL that is… (PR #131)
Hi @cburne-oshyn<https://github.com/cburne-oshyn> @kumbasar<https://github.com/kumbasar> ,
I know this has been hanging for quite a while already. I'm currently increasing the overall unit test coverage for the whole plugin and I stumbled on this same bug and fixed it with d6bd919<d6bd919>. I'll soon merge these unit tests/bug fixes into the main branch, so I will close this in favour of that PR. I did implement the fix based on this PR, so thanks for opening this 🙏
—
Reply to this email directly, view it on GitHub<#131 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AS43J7EQ4GX23NYY46HNQ33YTWV7ZAVCNFSM5P76HVGKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJUGU2DMNJWGA4Q>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
… provided by sonarqube 9.3 which includes /dashboard?id=.." in the URL
Sonarqube Analysis url from Sonarqube 9.3 in the build log has the following structure:
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarqube.xxx.com/dashboard?id=XXX.Web
The current logic just appends the api call after the "/dashboard?id=XXX.Web". This new logic checks to see if there are three "/" chars in the url and if there are, it grabs the url prior to the 3rd "/". It should not touch the URL if there are only 2 slashes as in "https://sonarqube.xyz.com" (although I am unable to test this, I'm hoping @kumbasar can check this for me in his installation).
Re-add getting sonar project parameters from build log feature #129