Modify

Opened 14 months ago

Closed 11 months ago

Last modified 11 months ago

#23115 closed task (fixed)

Update SonarQube to latest LTS

Reported by: gaben Owned by: Don-vip
Priority: minor Milestone:
Component: unspecified Version:
Keywords: sonar sonarqube Cc: Don-vip, stoecker

Description

The title says it all. The currently deployed version (9.2.4 build 50792) is almost two years old (release announcement) probably there are more rules for Java and other languages as well.

For running, it requires Java 17.

Also, I see many deprecated and outdated rule copies in the current deployment.

Attachments (1)

missing_xml_reference.png (29.5 KB ) - added by gaben 12 months ago.

Download all attachments as: .zip

Change History (23)

comment:1 by taylor.smock, 14 months ago

Cc: Don-vip stoecker added

SonarQube 10 was released back in April. I don't think we want to upgrade to that. With that said, if we do want to upgrade to SonarQube 10, we still need to make an intermediate upgrade to SonarQube 9.9.

For the deprecated rules, see https://josm.openstreetmap.de/sonar/profiles .

Scanning through https://docs.sonarsource.com/sonarqube/latest/setup-and-upgrade/release-upgrade-notes/, it looks like the following changes are in place:

  • SHA1 hashed password support has been removed. I think we use an external system for auth, so I don't think that is an issue. Even if we didn't, all it requires is a password reset.
  • Project analysis tokens
  • 9.8 supports Java 17 while 9.9 requires Java 17; postgresql versions are 11-15
  • master -> main for new projects. This is configurable.
  • Some environment variables have been removed (SONARQUBE_JDBC_*)
Last edited 14 months ago by taylor.smock (previous) (diff)

comment:2 by Don-vip, 14 months ago

Owner: changed from team to Don-vip
Status: newassigned

Thanks for the reminder, indeed I didn't upgrade it for a long time. I'll take a look tomorrow.

comment:3 by taylor.smock, 12 months ago

2 month ping. We have until February 2024 to update to 9.9 (at which point IDE SonarLint integrations will have a baseline of 9.9, if I understand the docs correctly).

comment:4 by stoecker, 12 months ago

I downloaded and extracted the files and copied the config. I'll test starting the new version tomorrow. If I forget this weekend remind me on Monday.

comment:5 by stoecker, 12 months ago

Note for me: Switch to SystemD.

comment:6 by gaben, 12 months ago

Wait, which version will we have? In case it's LTS, then the link is this.

in reply to:  6 comment:7 by stoecker, 12 months ago

Replying to gaben:

Wait, which version will we have? In case it's LTS, then the link is this.

You know that the only difference between these two is the sonarqube version which is anyway wrong in both cases? And I'll for sure not hardcode it, but rather use a "*" so it will work for future updates.

comment:8 by stoecker, 12 months ago

Seems to run.

comment:9 by gaben, 12 months ago

Thank you, looks good. Could you please also check the quality profiles? https://josm.openstreetmap.de/sonar/profiles

Sonar is saying some of them outdated, but still default. I see in the Java section there is a customized JOSM rule, it's probably modification of an old rule which doesn't have some of the new inspections: https://josm.openstreetmap.de/sonar/profiles/compare?language=java&name=JOSM&withKey=AV20PiyL8dRWxlrdvbzV

comment:10 by stoecker, 12 months ago

Ok. Dropped all deprecated stuff, dropped lots of outdated configs, added all missing default rules to JOSM and JMapViewer.

Next would probably be to have a look again and deactivate any rules which make no real sense.

comment:11 by stoecker, 12 months ago

Nice side note: For JSP the sonar default is empty and the server install is also empty (but outdated :-) Now I can't delete this one as it is default and I can't make the sonar one default as it's empty. So I have to keep the outdated one.

comment:12 by gaben, 12 months ago

by gaben, 12 months ago

Attachment: missing_xml_reference.png added

in reply to:  12 comment:13 by stoecker, 12 months ago

Replying to gaben:

Thank you! I noticed a missing XML rule reference in two project config:

Should be fixed, but it seems it will only be applied after the next run.

comment:14 by stoecker, 12 months ago

P.S. @Taylor: I made you sonar-admin ;-)

comment:15 by taylor.smock, 11 months ago

P.S. @Taylor: I made you sonar-admin ;-)

Thanks. I don't know what I'll do as an admin, but I'll figure something out. There has got to be a way to mark the TODO lint comments in the todo plugin as false positives...

I don't know if it took though -- in https://josm.openstreetmap.de/sonar/account, I'm only seeing sonar-users in the Groups section.

comment:16 by stoecker, 11 months ago

Hmpf. Some settings tend to get lost. That's disturbing. Ugly software. E.G. one of the outdated XML rules above is gone. The other one wont vanish, but my changed setting vanishes. Tss.

comment:17 by taylor.smock, 11 months ago

Some settings tend to get lost.

This is never fun when it happens.

Next would probably be to have a look again and deactivate any rules which make no real sense.

In other news, we've gone from 1.3k issues to 4k issues.
I don't know if I would deactivate any rules just yet. I'll fix new issues as I touch files and mark false positives (example: https://josm.openstreetmap.de/sonar/project/issues?resolved=false&severities=BLOCKER&id=josm&open=AYnbAsFvj8Ry6a_C0YWk ).

comment:18 by taylor.smock, 11 months ago

The last sonar job failed: https://josm.openstreetmap.de/jenkins/job/Sonar-JOSM/5797/console

ERROR: You're not authorized to run analysis. Please contact the project administrator.

I don't know if the previous token got revoked, expired, or something else happened.

comment:19 by stoecker, 11 months ago

Umpf. I changed something and now JOSM Sonar fails. And again I have no idea what the real reason is. "You're not authorized to run analysis. Please contact the project administrator" isn't so very helpful.

comment:20 by stoecker, 11 months ago

Found it. Dropping default access as suggested killed the JOSM server access ;-)

comment:21 by stoecker, 11 months ago

Resolution: fixed
Status: assignedclosed

Closing for now. Optimization of config will be an ongoing task.

comment:22 by taylor.smock, 11 months ago

At least it is working now. I still have to fix the plugins job.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.