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

Add sonar plugin and github actions file for sonar analysis #5835

Closed
wants to merge 3 commits into from

Conversation

XiangRongLin
Copy link
Collaborator

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Add sonar plugin and github actions file for sonar analysis
  • Copied from sonarcloud.io setup page with minor adjustments. Adjusted branch to 'dev' and updated versions

Fixes the following issue(s)

Relies on the following changes

Due diligence

Copied from sonarcloud.io setup page with minor adjustments. Adjusted branch to 'dev' and updated versions
@XiangRongLin XiangRongLin added the meta Related to the project but not strictly to code label Mar 15, 2021
@XiangRongLin
Copy link
Collaborator Author

XiangRongLin commented Mar 15, 2021

@TobiGr Do you have any idea why checkstyle fails on JDK 11?

@TobiGr
Copy link
Contributor

TobiGr commented Mar 15, 2021

I have no idea. Maybe the checkstyle suppressions are ignored? I changed a few lines, could you try it again after rebasing on https://github.com/TobiGr/NewPipe/tree/listHelper ?

@XiangRongLin
Copy link
Collaborator Author

XiangRongLin commented Mar 15, 2021

does not work. I don't even need to rebase, just checking out your branch and running gradle build with jdk 11 fails.

@TobiGr
Copy link
Contributor

TobiGr commented Mar 15, 2021

it looks like the checkstyle-suppressions.xml is not processed correctly. All the failing checks are mentioned in that file and should be ignored.

@TobiGr
Copy link
Contributor

TobiGr commented Mar 15, 2021

Try this:

diff --git a/app/build.gradle b/app/build.gradle
index c75bd43178f..957597ad955 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -116,6 +116,7 @@ configurations {
 
 checkstyle {
     configFile rootProject.file('checkstyle.xml')
+    suppressionsLocation rootProject.file('checkstyle-suppressions.xml')
     ignoreFailures false
     showViolations true
     toolVersion = checkstyleVersion

@XiangRongLin
Copy link
Collaborator Author

@TobiGr That fails before even running checkstyle with: No signature of method: build_dfldf361ev1py0dzqgbyjtld3.checkstyle() is applicable for argument types: (build_dfldf361ev1py0dzqgbyjtld3$_run_closure4) values: [build_dfldf361ev1py0dzqgbyjtld3$_run_closure4@2814b9cd]

I would translate it to "no method with given parameters exists"

@TobiGr
Copy link
Contributor

TobiGr commented Mar 15, 2021

try also adding this:
suppressionsFileExpression checkstyle.suppressions.file
Otherwise, I don't have a plan what to do

@TobiGr
Copy link
Contributor

TobiGr commented Mar 15, 2021

Screw it, Do not even try that thing above. But this looks promising. you can also try to replace the value attr with the default one.

diff --git a/checkstyle.xml b/checkstyle.xml
index af8c5480f88..c1405c2ce36 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -23,7 +23,7 @@
     <!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
     <module name="SuppressionFilter">
         <property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
-                  default="checkstyle-suppressions.xml" />
+                  default="${config_loc}/checkstyle-suppressions.xml" />
         <property name="optional" value="true"/>
     </module>

@XiangRongLin
Copy link
Collaborator Author

XiangRongLin commented Mar 15, 2021

@TobiGr Checkstyle problem is solved.

Are you sure, you set the secret corretly? It fails with unauthorized error
https://github.com/TeamNewPipe/NewPipe/pull/5835/checks?check_run_id=2115356764#step:6:57885

@TobiGr
Copy link
Contributor

TobiGr commented Mar 16, 2021

The auth error is probably caused by you opening the PR from a fork. Please push this branch to our repo and open another PR.
Edit: #5844

@TobiGr
Copy link
Contributor

TobiGr commented Mar 16, 2021

#5844 succeeded. We should work on that branch, so this pr can be closed.

@TobiGr TobiGr closed this Mar 16, 2021
@XiangRongLin XiangRongLin deleted the sonar_workflow branch March 10, 2022 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Related to the project but not strictly to code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SonarQube] Add workflow file for analysis and adjust gradle file
2 participants