[comixed-dev] Re: SonarCloud re-enabled

  • From: "Darryl L. Pierce" <mcpierce@xxxxxxxxx>
  • To: comixed-dev@xxxxxxxxxxxxx
  • Date: Wed, 18 Aug 2021 09:44:36 -0400

I saw that coverage report popup, but then it went back to 0% in a follow
up push.

I did some reading on SonarCloud and found a few things that seem like they
would make it easier to control the coverage:

1) Typescript needs different settings from Java, so the following
properties should be in the comixed-webui/pom.xml file:
    <sonar.sources>src</sonar.sources>
    <sonar.javascript.lcov.reportPaths>coverage/lcov.info
</sonar.javascript.lcov.reportPaths>
2) With those settings moved, then we should be able to put into the root
pom.xml the following properties:
    <sonar.organization>comixed</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.sources>src/main/java</son.sources>

<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/comixed/release/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
3) And we can change .github/workflows/sonarcloud-analysis.yml could use
the following build command line;
    mvn -B clear verify
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-Dsonar.projectKey=comixed -Pci

That should simplify the Github action to just running things and move the
build logic into the build control files where I think they should be.

What do you think?

On Wed, Aug 18, 2021 at 8:55 AM Frédéric Fouret <fouretfrederic@xxxxxxxxx>
wrote:

After taking a look at PR 841 (https://github.com/comixed/comixed/pull/841),
I found that the coverage was not taken into account 0% when it should be
100% on the modifications.
I tried some more corrections and finally came up with something that
seems to work (at least in this case). After modifying the pom and redoing
a build and an analysis by sonarcloud we get 100% coverage.

So the PR should be able to finally solve the SonarCloud problem I think.
[image: before_modification.png]
[image: after_modification.png]

Le mar. 17 août 2021 à 16:58, Darryl L. Pierce <mcpierce@xxxxxxxxx> a
écrit :

Okay, after a few more tweaks things are now actually working (and I
checked this time <g>). I opened fixed a group of issues found by
SonarCloud and have closed #836 as resolved.

Frédéric, merci pour ton aide. :D

On Mon, Aug 16, 2021 at 5:47 PM Darryl L. Pierce <mcpierce@xxxxxxxxx>
wrote:

No, spoke too soon. Or else something else is the issue.

I just pushed up a PR for #706 to add viewing the details for a
duplicate page. I added a new service on the Java side, fully coverage by
unit tests. But SonarCloud is saying there are no unit tests for the code...

On Mon, Aug 16, 2021 at 2:56 PM Darryl L. Pierce <mcpierce@xxxxxxxxx>
wrote:

Boom! It appears to be working correctly now! I had to change the root
POM's name from "comixed-parent" to just "comixed" to get the SonarCloud
display right, but it was your changes, Frédéric, plus fixing the project
key that did the trick. Thank you!

On Mon, Aug 16, 2021 at 2:09 PM Darryl L. Pierce <mcpierce@xxxxxxxxx>
wrote:

I tried changing it to just "comixed" (it was "comixed_comixed") and
pushed that change now.

On Sun, Aug 15, 2021 at 5:13 AM Frédéric Fouret <
fouretfrederic@xxxxxxxxx> wrote:

I made a new PR that should correct the path to the jacoco.xml file.
Regarding the analysis of the branch master, I saw that we have the
following error when the analysis starts:
errorMessage": "Compute Engine task main component key is null."

After searching the internet, I came across the following thread:

https://community.sonarsource.com/t/branch-analysis-fails-for-some-branches-succeeds-for-others-using-azure-devops/11932/2
It seems that updating the project key in sonarcloud can fix the
problem... maybe you can try to see that.

Le sam. 14 août 2021 à 23:10, Darryl L. Pierce <mcpierce@xxxxxxxxx>
a écrit :

Excellent work, Frederic! Thanks for looking into this. I'm
squashing your commits together on master as you tackle them so we can 
keep
the commits together. I have a build running now to see if SonarCloud is
happy again.

On Sat, Aug 14, 2021 at 7:48 AM Frédéric Fouret <
fouretfrederic@xxxxxxxxx> wrote:

Hello,

I am looking at the problem and trying to find a solution. I have
made a PR in development. It has been merged but does not solve the 
problem.

From what I have seen, it looks for the jacoco.exec file in the
wrong place. After fixing that, I have another error, it tries to 
parse the
file as if it is xml when we have a binary I think.

Work in progress... i hope to find the solution for the first issue.


Le sam. 14 août 2021 à 00:08, Darryl L. Pierce <mcpierce@xxxxxxxxx>
a écrit :

I've re-enabled SonarCloud and disabled the GitHub code coverage
tests since the latter weren't doing a very good job IMO. But for some
reason SonarCloud 1) won't check the Java code, it's only doing the
Typescript code, and 2) won't process our master branch.

Can someone (Frederic?) take a look at our sonarcloud-analysis.yml
on master and maybe give us a PR to fix this?

Thanks!

--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap
together." - Gord Downie



--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together."
- Gord Downie



--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie



--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie



--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie



--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie



-- 
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie

PNG image

PNG image

Other related posts: