Git Product home page Git Product logo

Comments (17)

tomasbjerre avatar tomasbjerre commented on June 26, 2024

Specify only credentialsId. There use to be other alternatives, but they are deprecated:

And I would not use the withCredentials. I would just supply the id to credentialsId.

Like this:

  ViolationsToBitbucketServer([
    bitbucketServerUrl: <URL>,
    createCommentWithAllSingleFileComments: true,
    createSingleFileComments: true,
    projectKey: to_project_key,
    repoSlug: to_project_slug,
    pullRequestId: pull_request_id,
    credentialsId: <ID>, 
          
    violationConfigs: [
      [parser: 'CLANG', pattern: 'sa.log', reporter: 'clang-tidy'],
    ]
  ])

from violation-comments-to-stash-plugin.

acizmarik avatar acizmarik commented on June 26, 2024

Sorry for delayed reply. I can only try this while at work. I just tried using credentialsId and it works - thanks! It already said how many violations it found (had to change pattern a bit).

Right now, however, I am having issues with this error: Not using proxy, no Jenkins instance. Can you give me any hints on how to solve this?

Thanks.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 26, 2024

Do you need to use a proxy?

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 26, 2024

I think this happens when running on master. Will have a look at it...

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 26, 2024

I'm releasing 1.76 now. Moving proxy configuration to the master. Available through update site within a few hours.

from violation-comments-to-stash-plugin.

acizmarik avatar acizmarik commented on June 26, 2024

I don't think I need proxy.

Will try out the 1.76 when it's available. Right now my pipeline hangs on the mentioned error. I don't see anything like Will comment .... or something.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 26, 2024

from violation-comments-to-stash-plugin.

acizmarik avatar acizmarik commented on June 26, 2024

You are right I already changed the pattern to: .*/sa\\.log\$ which seems to work in my case.
It reports:

Found 178 violations from ViolationConfig [pattern=.*/sa\.log$, reporter=clang-tidy, parser=CLANG].
14:19:17 PR: <PR> on <URL>
14:19:17 Not using proxy, no Jenkins instance.

I already know the new version of this plugin is available I just have to wait for jenkins to restart

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 26, 2024

So the job actually hangs and never completes?

from violation-comments-to-stash-plugin.

acizmarik avatar acizmarik commented on June 26, 2024

It completes. The message Not using proxy, no Jenkins instance is the last output of this stage. This is also the last stage of the job. In jenkins it even appears like the job finished successfully.

But there are no visible comments on Bitbucket.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 26, 2024

Common causes are:

  1. No merge was performed before the analysis
  2. People are using Bitbucket Cloud, not Bitbucket Server

I would also check the global Jenkins log available at something like http://localhost:8080/jenkins/log/all

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 26, 2024

And if the merge was performed. Make sure there are violations reported in the files that were changed in the PR.

from violation-comments-to-stash-plugin.

acizmarik avatar acizmarik commented on June 26, 2024
  1. I performed merge, run static-analysis (clang-tidy) while storing warnings to a file, then I run this plugin.
  2. I checked and there are some violations in the files which were changed by pull request. They are not exactly in diff but as long as it is not specified to comment only diff it should probably work, right?
  3. Bitbucket is self-hosted (link does not start https://bitbucket.org/) so I think it is Bitbucket Server

Unfortunately right now I don't have access to global Jenkins logs.

Actually I just tested using the new version 1.76 and things got worse. Last time it at least parsed warnings out of the file now it crashes.

14:11:14 Not using proxy, no proxy configured.
14:11:14 ---
14:11:14 --- Jenkins Violation Comments to Bitbucket Server ---
14:11:14 ---
14:11:14 bitbucketServerUrl: <URL>
14:11:14 projectKey: SDK
14:11:14 repoSlug: <REPO>
14:11:14 pullRequestId: 336
14:11:14 credentialsId: true
14:11:14 createSingleFileComments: true
14:11:14 createSingleFileCommentsTasks: false
14:11:14 createCommentWithAllSingleFileComments: true
14:11:14 commentOnlyChangedContent: false
14:11:14 commentOnlyChangedContentContext: 0
14:11:14 minSeverity: INFO
14:11:14 keepOldComments: false
14:11:14 commentTemplate: null
14:11:14 clang-tidy with pattern .*/sa\.log$
14:11:14 Pull request: 336
14:11:14 java.io.IOException: remote file operation failed: /data/jenkins/w/workspace/<PATH> at hudson.remoting.Channel@d62dcd4:Channel to /10.11.4.31: java.io.IOException: Unable to serialize org.jenkinsci.plugins.jvctb.perform.JvctbPerformer$1@6e79cf3b
14:11:14 	at hudson.FilePath.act(FilePath.java:1016)
14:11:14 	at hudson.FilePath.act(FilePath.java:998)
14:11:14 	at org.jenkinsci.plugins.jvctb.perform.JvctbPerformer.jvctsPerform(JvctbPerformer.java:220)
14:11:14 	at org.jenkinsci.plugins.jvctb.ViolationsToBitbucketServerRecorder.perform(ViolationsToBitbucketServerRecorder.java:81)
14:11:14 	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
14:11:14 	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
14:11:14 	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
14:11:14 	at hudson.security.ACL.impersonate(ACL.java:290)
14:11:14 	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
14:11:14 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
14:11:14 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
14:11:14 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
14:11:14 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
14:11:14 	at java.lang.Thread.run(Thread.java:748)
14:11:14 Caused by: java.io.IOException: Unable to serialize org.jenkinsci.plugins.jvctb.perform.JvctbPerformer$1@6e79cf3b
14:11:14 	at hudson.remoting.UserRequest.serialize(UserRequest.java:261)
14:11:14 	at hudson.remoting.UserRequest.<init>(UserRequest.java:100)
14:11:14 	at hudson.remoting.Channel.call(Channel.java:950)
14:11:14 	at hudson.FilePath.act(FilePath.java:1009)
14:11:14 	... 13 more
14:11:14 Caused by: java.io.NotSerializableException: se.bjurr.violations.comments.bitbucketserver.lib.ViolationCommentsToBitbucketServerApi
14:11:14 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
14:11:14 	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
14:11:14 	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
14:11:14 	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
14:11:14 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
14:11:14 	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
14:11:14 	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
14:11:14 	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
14:11:14 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
14:11:14 	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
14:11:14 	at hudson.remoting.UserRequest._serialize(UserRequest.java:250)
14:11:14 	at hudson.remoting.UserRequest.serialize(UserRequest.java:259)
14:11:14 	... 16 more

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 26, 2024

Oh, sorry. Releasing 1.77 now with a fix =)

Are you looking at the overview page of the PR?

from violation-comments-to-stash-plugin.

acizmarik avatar acizmarik commented on June 26, 2024

Yes I am looking at overview. There are no comments yet.

Thank you for such fast replies. Will try out the new version as soon as I can.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on June 26, 2024

I just made a test with version 1.77 of the plugin and 5.13.1 of Bitbucket Server.

This pipeline:

node('LOCAL') {
 deleteDir()
 
 stage('Merge') {
  sh '''
  git clone http://admin:admin@localhost:7990/bitbucket/scm/project_1/violations-test.git .
  git checkout master
  git merge origin/feature/addingcrap
  '''
 }

 stage('Build') {
  sh '''
  ./build.sh || ls
  '''
 }

 stage('Static code analysis') {
  ViolationsToBitbucketServer([
   bitbucketServerUrl: 'http://localhost:7990/bitbucket',
   commentOnlyChangedContent: true,
   commentOnlyChangedContentContext: 5,
   createCommentWithAllSingleFileComments: false,
   createSingleFileComments: true,
   createSingleFileCommentsTasks: true,
   keepOldComments: false,
   projectKey: 'PROJECT_1', // Use environment variable here
   pullRequestId: '1', // Use environment variable here
   repoSlug: 'violations-test', // Use environment variable here
   credentialsId: 'bbs',
   violationConfigs: [
    // Many more formats available, check https://github.com/tomasbjerre/violations-lib
    [parser: 'FINDBUGS', pattern: '.*/findbugs/.*\\.xml\$', reporter: 'Findbugs'],
    [parser: 'CHECKSTYLE', pattern: '.*/checkstyle/.*\\.xml\$', reporter: 'Checkstyle']
   ]
  ])
 }
}

This log:

Started by user anonymous
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on local in /var/jenkins/workspace/pipe
[Pipeline] {
[Pipeline] deleteDir
[Pipeline] stage
[Pipeline] { (Merge)
[Pipeline] sh
[pipe] Running shell script
+ git clone http://admin:admin@localhost:7990/bitbucket/scm/project_1/violations-test.git .
Klonar till "."...
+ git checkout master
Redan på "master"
Din gren är à jour med "origin/master".
+ git merge origin/feature/addingcrap
Merge made by the 'recursive' strategy.
 src/main/java/se/bjurr/violations/lib/example/MyClass.java | 2 ++
 1 file changed, 2 insertions(+)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] sh
[pipe] Running shell script
+ ./build.sh
Initialized native services in: /root/.gradle/native
Removing 0 daemon stop events from registry
Starting a Gradle Daemon (subsequent builds will be faster)
Starting process 'Gradle build daemon'. Working directory: /root/.gradle/daemon/4.4.1 Command: /usr/lib/jvm/java-8-oracle/bin/java -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=SE -Duser.language=sv -Duser.variant -cp /root/.gradle/wrapper/dists/gradle-4.4.1-bin/46gopw3g8i1v3zqqx4q949t2x/gradle-4.4.1/lib/gradle-launcher-4.4.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.4.1
Successfully started process 'Gradle build daemon'
An attempt to start the daemon took 0.61 secs.
The client will now receive all logging from the daemon (pid: 11157). The daemon log file: /root/.gradle/daemon/4.4.1/daemon-11157.out.log
Starting build in new daemon [memory: 954,7 MB]
Closing daemon's stdin at end of input.
The daemon will no longer process any standard input.
Using 8 worker leases.
Creating new cache for fileHashes, path /root/.gradle/caches/4.4.1/fileHashes/fileHashes.bin, access org.gradle.cache.internal.DefaultCacheAccess@3b6c28a9
Creating new cache for resourceHashesCache, path /root/.gradle/caches/4.4.1/fileHashes/resourceHashesCache.bin, access org.gradle.cache.internal.DefaultCacheAccess@3b6c28a9
Creating new cache for fileHashes, path /var/jenkins/workspace/pipe/.gradle/4.4.1/fileHashes/fileHashes.bin, access org.gradle.cache.internal.DefaultCacheAccess@1eb7bddb
Starting Build
Settings evaluated using settings file '/var/jenkins/workspace/pipe/settings.gradle'.
Projects loaded. Root project using build file '/var/jenkins/workspace/pipe/build.gradle'.
Included projects: [root project 'pipe']
Evaluating root project 'pipe' using build file '/var/jenkins/workspace/pipe/build.gradle'.
Creating new cache for metadata-1.1/results, path /root/.gradle/caches/transforms-1/metadata-1.1/results.bin, access org.gradle.cache.internal.DefaultCacheAccess@41bda24b
Creating new cache for metadata-2.36/module-metadata, path /root/.gradle/caches/modules-2/metadata-2.36/module-metadata.bin, access org.gradle.cache.internal.DefaultCacheAccess@5c34f569
Creating new cache for metadata-2.36/module-artifact, path /root/.gradle/caches/modules-2/metadata-2.36/module-artifact.bin, access org.gradle.cache.internal.DefaultCacheAccess@5c34f569
Using PIT: 1.1.0
All projects evaluated.
Selected primary task 'clean' from project :
Selected primary task 'build' from project :
Creating new cache for annotation-processors, path /var/jenkins/workspace/pipe/.gradle/4.4.1/fileContent/annotation-processors.bin, access org.gradle.cache.internal.DefaultCacheAccess@17a7ab23
Tasks to be executed: [task ':clean', task ':compileJava', task ':processResources', task ':classes', task ':jar', task ':assemble', task ':checkstyleMain', task ':compileTestJava', task ':processTestResources', task ':testClasses', task ':checkstyleTest', task ':findbugsMain', task ':findbugsTest', task ':pmdMain', task ':pmdTest', task ':test', task ':check', task ':pitest', task ':build']
Creating new cache for resourceHashesCache, path /var/jenkins/workspace/pipe/.gradle/4.4.1/fileHashes/resourceHashesCache.bin, access org.gradle.cache.internal.DefaultCacheAccess@1eb7bddb
Creating new cache for taskHistory, path /var/jenkins/workspace/pipe/.gradle/4.4.1/taskHistory/taskHistory.bin, access org.gradle.cache.internal.DefaultCacheAccess@3942c9b5
Creating new cache for outputFiles, path /var/jenkins/workspace/pipe/.gradle/buildOutputCleanup/outputFiles.bin, access org.gradle.cache.internal.DefaultCacheAccess@531a1c0f
:clean (Thread[Task worker for ':' Thread 2,5,main]) started.
:clean
Putting task artifact state for task ':clean' into context took 0.001 secs.
Up-to-date check for task ':clean' took 0.0 secs. It is not up-to-date because:
  Task has not declared any outputs.
:clean UP-TO-DATE
:clean (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.014 secs.
:compileJava (Thread[Task worker for ':' Thread 2,5,main]) started.
:compileJava
Putting task artifact state for task ':compileJava' into context took 0.005 secs.
Up-to-date check for task ':compileJava' took 0.017 secs. It is not up-to-date because:
  No history is available.
All input files are considered out-of-date for incremental task ':compileJava'.
Compiling with JDK Java compiler API.
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:compileJava (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.392 secs.
:processResources (Thread[Task worker for ':' Thread 2,5,main]) started.
:processResources
Putting task artifact state for task ':processResources' into context took 0.0 secs.
file or directory '/var/jenkins/workspace/pipe/src/main/resources', not found
Skipping task ':processResources' as it has no source files and no previous output files.
:processResources NO-SOURCE
:processResources (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.001 secs.
:classes (Thread[Task worker for ':' Thread 2,5,main]) started.
:classes
Skipping task ':classes' as it has no actions.
:classes (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.0 secs.
:jar (Thread[Task worker for ':' Thread 2,5,main]) started.
:jar
Putting task artifact state for task ':jar' into context took 0.0 secs.
Up-to-date check for task ':jar' took 0.005 secs. It is not up-to-date because:
  No history is available.
:jar (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.041 secs.
:assemble (Thread[Task worker for ':' Thread 2,5,main]) started.
:assemble
Skipping task ':assemble' as it has no actions.
:assemble (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.0 secs.
:checkstyleMain (Thread[Task worker for ':' Thread 2,5,main]) started.
:checkstyleMain
Putting task artifact state for task ':checkstyleMain' into context took 0.0 secs.
Up-to-date check for task ':checkstyleMain' took 0.245 secs. It is not up-to-date because:
  No history is available.
[ant:checkstyle] Running Checkstyle 6.19 on 2 files
[ant:checkstyle] [ERROR] /var/jenkins/workspace/pipe/src/main/java/se/bjurr/violations/lib/example/MyClass.java:0: Missing package-info.java file. [JavadocPackage]
[ant:checkstyle] [INFO] /var/jenkins/workspace/pipe/src/main/java/se/bjurr/violations/lib/example/MyClass.java:9:10: Must have at least one statement. [EmptyBlock]
[ant:checkstyle] [INFO] /var/jenkins/workspace/pipe/src/main/java/se/bjurr/violations/lib/example/MyClass.java:27:10: Must have at least one statement. [EmptyBlock]
[ant:checkstyle] [INFO] /var/jenkins/workspace/pipe/src/main/java/se/bjurr/violations/lib/example/OtherClass.java:10:31: Must have at least one statement. [EmptyBlock]
[ant:checkstyle] [WARN] /var/jenkins/workspace/pipe/src/main/java/se/bjurr/violations/lib/example/OtherClass.java:26:3: Boolean expression complexity is 8 (max allowed is 1). [BooleanExpressionComplexity]
[ant:xslt] Processing /var/jenkins/workspace/pipe/build/reports/checkstyle/main.xml to /var/jenkins/workspace/pipe/build/reports/checkstyle/main.html
[ant:xslt] Loading stylesheet <xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<xsl:output method="html" indent="yes"/>
<xsl:decimal-format decimal-separator="." grouping-separator="," />

<xsl:key name="files" match="file" use="@name" />

<!-- Checkstyle XML Style Sheet by Stephane Bailliez <[email protected]>         -->
<!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->
<!-- UsageContext (generates checkstyle_report.html):                                      -->
<!--    <checkstyle failonviolation="false" config="${check.config}">               -->
<!--      <fileset dir="${src.dir}" includes="**/*.java"/>                          -->
<!--      <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/>         -->
<!--    </checkstyle>                                                               -->
<!--    <style basedir="${doc.dir}" destdir="${doc.dir}"                            -->
<!--            includes="checkstyle_report.xml"                                    -->
<!--            style="${doc.dir}/checkstyle-noframes-sorted.xsl"/>                 -->

<xsl:template match="checkstyle">
	<html>
		<head>
		<style type="text/css">
    .bannercell {
      border: 0px;
      padding: 0px;
    }
    body {
      margin-left: 10;
      margin-right: 10;
      font:normal 80% arial,helvetica,sanserif;
      background-color:#FFFFFF;
      color:#000000;
    }
    .a td {
      background: #efefef;
    }
    .b td {
      background: #fff;
    }
    th, td {
      text-align: left;
      vertical-align: top;
    }
    th {
      font-weight:bold;
      background: #ccc;
      color: black;
    }
    table, th, td {
      font-size:100%;
      border: none
    }
    table.log tr td, tr th {

    }
    h2 {
      font-weight:bold;
      font-size:140%;
      margin-bottom: 5;
    }
    h3 {
      font-size:100%;
      font-weight:bold;
      background: #525D76;
      color: white;
      text-decoration: none;
      padding: 5px;
      margin-right: 2px;
      margin-left: 2px;
      margin-bottom: 0;
    }
		</style>
		</head>
		<body>
			<a name="top"></a>
      <!-- jakarta logo -->
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td class="bannercell" rowspan="2">
          <!--a href="http://jakarta.apache.org/">
          <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
          </a-->
        </td>
    		<td class="text-align:right"><h2>CheckStyle Audit</h2></td>
    		</tr>
    		<tr>
    		<td class="text-align:right">Designed for use with <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
    		</tr>
      </table>
    	<hr size="1"/>

			<!-- Summary part -->
			<xsl:apply-templates select="." mode="summary"/>
			<hr size="1" width="100%" align="left"/>

			<!-- Package List part -->
			<xsl:apply-templates select="." mode="filelist"/>
			<hr size="1" width="100%" align="left"/>

			<!-- For each package create its part -->
            <xsl:apply-templates select="file[@name and generate-id(.) = generate-id(key('files', @name))]" />

			<hr size="1" width="100%" align="left"/>


		</body>
	</html>
</xsl:template>



	<xsl:template match="checkstyle" mode="filelist">
		<h3>Files</h3>
		<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
      <tr>
        <th>Name</th>
        <th>Errors</th>
      </tr>
          <xsl:for-each select="file[@name and generate-id(.) = generate-id(key('files', @name))]">
                <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error)"/>
				<xsl:variable name="errorCount" select="count(error)"/>
				<tr>
          <xsl:call-template name="alternated-row"/>
					<td><a href="#f-{@name}"><xsl:value-of select="@name"/></a></td>
					<td><xsl:value-of select="$errorCount"/></td>
				</tr>
			</xsl:for-each>
		</table>
	</xsl:template>


	<xsl:template match="file">
    <a name="f-{@name}"></a>
    <h3>File <xsl:value-of select="@name"/></h3>

    <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
    	<tr>
    	  <th>Error Description</th>
    	  <th>Line</th>
      </tr>
        <xsl:for-each select="key('files', @name)/error">
          <xsl:sort data-type="number" order="ascending" select="@line"/>
    	<tr>
        <xsl:call-template name="alternated-row"/>
    	  <td><xsl:value-of select="@message"/></td>
    	  <td><xsl:value-of select="@line"/></td>
    	</tr>
    	</xsl:for-each>
    </table>
    <a href="#top">Back to top</a>
	</xsl:template>


	<xsl:template match="checkstyle" mode="summary">
		<h3>Summary</h3>
        <xsl:variable name="fileCount" select="count(file[@name and generate-id(.) = generate-id(key('files', @name))])"/>
		<xsl:variable name="errorCount" select="count(file/error)"/>
		<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
		<tr>
			<th>Files</th>
			<th>Errors</th>
		</tr>
		<tr>
		  <xsl:call-template name="alternated-row"/>
			<td><xsl:value-of select="$fileCount"/></td>
			<td><xsl:value-of select="$errorCount"/></td>
		</tr>
		</table>
	</xsl:template>

  <xsl:template name="alternated-row">
    <xsl:attribute name="class">
      <xsl:if test="position() mod 2 = 1">a</xsl:if>
      <xsl:if test="position() mod 2 = 0">b</xsl:if>
    </xsl:attribute>
  </xsl:template>
</xsl:stylesheet>


Checkstyle rule violations were found. See the report at: file:///var/jenkins/workspace/pipe/build/reports/checkstyle/main.html
:checkstyleMain (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 1.113 secs.
:compileTestJava (Thread[Task worker for ':' Thread 2,5,main]) started.
:compileTestJava
Putting task artifact state for task ':compileTestJava' into context took 0.0 secs.
Up-to-date check for task ':compileTestJava' took 0.085 secs. It is not up-to-date because:
  No history is available.
All input files are considered out-of-date for incremental task ':compileTestJava'.
Compiling with JDK Java compiler API.
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:compileTestJava (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.113 secs.
:processTestResources (Thread[Task worker for ':' Thread 3,5,main]) started.
:processTestResources
Putting task artifact state for task ':processTestResources' into context took 0.0 secs.
file or directory '/var/jenkins/workspace/pipe/src/test/resources', not found
Skipping task ':processTestResources' as it has no source files and no previous output files.
:processTestResources NO-SOURCE
:processTestResources (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.001 secs.
:testClasses (Thread[Task worker for ':' Thread 3,5,main]) started.
:testClasses
Skipping task ':testClasses' as it has no actions.
:testClasses (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.0 secs.
:checkstyleTest (Thread[Task worker for ':' Thread 3,5,main]) started.
:checkstyleTest
Putting task artifact state for task ':checkstyleTest' into context took 0.0 secs.
Up-to-date check for task ':checkstyleTest' took 0.018 secs. It is not up-to-date because:
  No history is available.
[ant:checkstyle] Running Checkstyle 6.19 on 1 files
[ant:checkstyle] [ERROR] /var/jenkins/workspace/pipe/src/test/java/se/bjurr/violations/lib/example/MyClassTest.java:0: Missing package-info.java file. [JavadocPackage]
[ant:xslt] Processing /var/jenkins/workspace/pipe/build/reports/checkstyle/test.xml to /var/jenkins/workspace/pipe/build/reports/checkstyle/test.html
[ant:xslt] Loading stylesheet <xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<xsl:output method="html" indent="yes"/>
<xsl:decimal-format decimal-separator="." grouping-separator="," />

<xsl:key name="files" match="file" use="@name" />

<!-- Checkstyle XML Style Sheet by Stephane Bailliez <[email protected]>         -->
<!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->
<!-- UsageContext (generates checkstyle_report.html):                                      -->
<!--    <checkstyle failonviolation="false" config="${check.config}">               -->
<!--      <fileset dir="${src.dir}" includes="**/*.java"/>                          -->
<!--      <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/>         -->
<!--    </checkstyle>                                                               -->
<!--    <style basedir="${doc.dir}" destdir="${doc.dir}"                            -->
<!--            includes="checkstyle_report.xml"                                    -->
<!--            style="${doc.dir}/checkstyle-noframes-sorted.xsl"/>                 -->

<xsl:template match="checkstyle">
	<html>
		<head>
		<style type="text/css">
    .bannercell {
      border: 0px;
      padding: 0px;
    }
    body {
      margin-left: 10;
      margin-right: 10;
      font:normal 80% arial,helvetica,sanserif;
      background-color:#FFFFFF;
      color:#000000;
    }
    .a td {
      background: #efefef;
    }
    .b td {
      background: #fff;
    }
    th, td {
      text-align: left;
      vertical-align: top;
    }
    th {
      font-weight:bold;
      background: #ccc;
      color: black;
    }
    table, th, td {
      font-size:100%;
      border: none
    }
    table.log tr td, tr th {

    }
    h2 {
      font-weight:bold;
      font-size:140%;
      margin-bottom: 5;
    }
    h3 {
      font-size:100%;
      font-weight:bold;
      background: #525D76;
      color: white;
      text-decoration: none;
      padding: 5px;
      margin-right: 2px;
      margin-left: 2px;
      margin-bottom: 0;
    }
		</style>
		</head>
		<body>
			<a name="top"></a>
      <!-- jakarta logo -->
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td class="bannercell" rowspan="2">
          <!--a href="http://jakarta.apache.org/">
          <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
          </a-->
        </td>
    		<td class="text-align:right"><h2>CheckStyle Audit</h2></td>
    		</tr>
    		<tr>
    		<td class="text-align:right">Designed for use with <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
    		</tr>
      </table>
    	<hr size="1"/>

			<!-- Summary part -->
			<xsl:apply-templates select="." mode="summary"/>
			<hr size="1" width="100%" align="left"/>

			<!-- Package List part -->
			<xsl:apply-templates select="." mode="filelist"/>
			<hr size="1" width="100%" align="left"/>

			<!-- For each package create its part -->
            <xsl:apply-templates select="file[@name and generate-id(.) = generate-id(key('files', @name))]" />

			<hr size="1" width="100%" align="left"/>


		</body>
	</html>
</xsl:template>



	<xsl:template match="checkstyle" mode="filelist">
		<h3>Files</h3>
		<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
      <tr>
        <th>Name</th>
        <th>Errors</th>
      </tr>
          <xsl:for-each select="file[@name and generate-id(.) = generate-id(key('files', @name))]">
                <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error)"/>
				<xsl:variable name="errorCount" select="count(error)"/>
				<tr>
          <xsl:call-template name="alternated-row"/>
					<td><a href="#f-{@name}"><xsl:value-of select="@name"/></a></td>
					<td><xsl:value-of select="$errorCount"/></td>
				</tr>
			</xsl:for-each>
		</table>
	</xsl:template>


	<xsl:template match="file">
    <a name="f-{@name}"></a>
    <h3>File <xsl:value-of select="@name"/></h3>

    <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
    	<tr>
    	  <th>Error Description</th>
    	  <th>Line</th>
      </tr>
        <xsl:for-each select="key('files', @name)/error">
          <xsl:sort data-type="number" order="ascending" select="@line"/>
    	<tr>
        <xsl:call-template name="alternated-row"/>
    	  <td><xsl:value-of select="@message"/></td>
    	  <td><xsl:value-of select="@line"/></td>
    	</tr>
    	</xsl:for-each>
    </table>
    <a href="#top">Back to top</a>
	</xsl:template>


	<xsl:template match="checkstyle" mode="summary">
		<h3>Summary</h3>
        <xsl:variable name="fileCount" select="count(file[@name and generate-id(.) = generate-id(key('files', @name))])"/>
		<xsl:variable name="errorCount" select="count(file/error)"/>
		<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
		<tr>
			<th>Files</th>
			<th>Errors</th>
		</tr>
		<tr>
		  <xsl:call-template name="alternated-row"/>
			<td><xsl:value-of select="$fileCount"/></td>
			<td><xsl:value-of select="$errorCount"/></td>
		</tr>
		</table>
	</xsl:template>

  <xsl:template name="alternated-row">
    <xsl:attribute name="class">
      <xsl:if test="position() mod 2 = 1">a</xsl:if>
      <xsl:if test="position() mod 2 = 0">b</xsl:if>
    </xsl:attribute>
  </xsl:template>
</xsl:stylesheet>


Checkstyle rule violations were found. See the report at: file:///var/jenkins/workspace/pipe/build/reports/checkstyle/test.html
:checkstyleTest (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.126 secs.
:findbugsMain (Thread[Task worker for ':' Thread 3,5,main]) started.
:findbugsMain
Putting task artifact state for task ':findbugsMain' into context took 0.0 secs.
Up-to-date check for task ':findbugsMain' took 0.328 secs. It is not up-to-date because:
  No history is available.
Starting process 'Gradle FindBugs Worker 1'. Working directory: /var/jenkins/workspace/pipe Command: /usr/lib/jvm/java-8-oracle/bin/java -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dfile.encoding=UTF-8 -Duser.country=SE -Duser.language=sv -Duser.variant -cp /root/.gradle/caches/4.4.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle FindBugs Worker 1'
Successfully started process 'Gradle FindBugs Worker 1'
Initialized native services in: /root/.gradle/native
FindBugs rule violations were found. See the report at: file:///var/jenkins/workspace/pipe/build/reports/findbugs/main.xml
:findbugsMain (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 2.63 secs.
:findbugsTest (Thread[Task worker for ':' Thread 3,5,main]) started.
:findbugsTest
Putting task artifact state for task ':findbugsTest' into context took 0.0 secs.
Up-to-date check for task ':findbugsTest' took 0.004 secs. It is not up-to-date because:
  No history is available.
Starting process 'Gradle FindBugs Worker 2'. Working directory: /var/jenkins/workspace/pipe Command: /usr/lib/jvm/java-8-oracle/bin/java -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dfile.encoding=UTF-8 -Duser.country=SE -Duser.language=sv -Duser.variant -cp /root/.gradle/caches/4.4.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle FindBugs Worker 2'
Successfully started process 'Gradle FindBugs Worker 2'
Initialized native services in: /root/.gradle/native
:findbugsTest (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 2.131 secs.
:pmdMain (Thread[Task worker for ':' Thread 3,5,main]) started.
:pmdMain
Putting task artifact state for task ':pmdMain' into context took 0.0 secs.
Up-to-date check for task ':pmdMain' took 0.14 secs. It is not up-to-date because:
  No history is available.
2 PMD rule violations were found. See the report at: file:///var/jenkins/workspace/pipe/build/reports/pmd/main.html
:pmdMain (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.456 secs.
:pmdTest (Thread[Task worker for ':' Thread 3,5,main]) started.
:pmdTest
Putting task artifact state for task ':pmdTest' into context took 0.0 secs.
Up-to-date check for task ':pmdTest' took 0.003 secs. It is not up-to-date because:
  No history is available.
:pmdTest (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.067 secs.
:test (Thread[Task worker for ':' Thread 3,5,main]) started.
:test
Putting task artifact state for task ':test' into context took 0.0 secs.
Up-to-date check for task ':test' took 0.005 secs. It is not up-to-date because:
  No history is available.
Starting process 'Gradle Test Executor 3'. Working directory: /var/jenkins/workspace/pipe Command: /usr/lib/jvm/java-8-oracle/bin/java -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dorg.gradle.native=false -Dfile.encoding=UTF-8 -Duser.country=SE -Duser.language=sv -Duser.variant -ea -cp /root/.gradle/caches/4.4.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 3'
Successfully started process 'Gradle Test Executor 3'
Gradle Test Executor 3 started executing tests.
Gradle Test Executor 3 finished executing tests.
Finished generating test XML results (0.005 secs) into: /var/jenkins/workspace/pipe/build/test-results/test
Generating HTML test report...
Finished generating test html results (0.015 secs) into: /var/jenkins/workspace/pipe/build/reports/tests/test
:test (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.593 secs.
:check (Thread[Task worker for ':' Thread 3,5,main]) started.
:check
Skipping task ':check' as it has no actions.
:check (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.0 secs.
:pitest (Thread[Task worker for ':' Thread 3,5,main]) started.
:pitest
Putting task artifact state for task ':pitest' into context took 0.0 secs.
Up-to-date check for task ':pitest' took 0.02 secs. It is not up-to-date because:
  No history is available.
Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0
Starting process 'command '/usr/lib/jvm/java-8-oracle/bin/java''. Working directory: /var/jenkins/workspace/pipe Command: /usr/lib/jvm/java-8-oracle/bin/java -Dfile.encoding=UTF-8 -Duser.country=SE -Duser.language=sv -Duser.variant -cp /root/.gradle/caches/modules-2/files-2.1/org.pitest/pitest-command-line/1.1.0/b7774009a868591910a10621fefbd103877344ac/pitest-command-line-1.1.0.jar:/root/.gradle/caches/modules-2/files-2.1/org.pitest/pitest/1.1.0/b2f1ca0c2e3777f315b136041ae5593c7297453c/pitest-1.1.0.jar:/root/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.1.1/a94d7d28cabfa782f0cfd4275cbe4106aecd6aec/testng-6.1.1.jar:/root/.gradle/caches/modules-2/files-2.1/junit/junit/4.11/4e031bb61df09069aeb2bffb4019e7a5034a4ee0/junit-4.11.jar:/root/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar:/root/.gradle/caches/modules-2/files-2.1/org.beanshell/bsh/2.0b4/a05f0a0feefa8d8467ac80e16e7de071489f0d9c/bsh-2.0b4.jar:/root/.gradle/caches/modules-2/files-2.1/com.beust/jcommander/1.12/7409692b48022f9eca7445861defbcdb9ee3c2a8/jcommander-1.12.jar:/root/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.6/a1e23e31c424d566ee27382e373d73a28fdabd88/snakeyaml-1.6.jar org.pitest.mutationtest.commandline.MutationCoverageReport --sourceDirs=/var/jenkins/workspace/pipe/src/main/resources,/var/jenkins/workspace/pipe/src/main/java --reportDir=/var/jenkins/workspace/pipe/build/reports/pitest --targetClasses=se.bjurr.* --threads=4 --outputFormats=XML,HTML --classPath=/var/jenkins/workspace/pipe/build/classes/java/test,/var/jenkins/workspace/pipe/build/resources/test,/var/jenkins/workspace/pipe/build/classes/java/main,/var/jenkins/workspace/pipe/build/resources/main,/root/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar,/root/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar --mutableCodePaths=/var/jenkins/workspace/pipe/build/classes/java/main --includeLaunchClasspath=false
Successfully started process 'command '/usr/lib/jvm/java-8-oracle/bin/java''
16:25:10 PIT >> INFO : Verbose logging is disabled. If you encounter an problem please enable it before reporting an issue.
16:25:10 PIT >> INFO : Sending 1 test classes to slave
16:25:10 PIT >> INFO : Sent tests to slave
�/16:25:10 PIT >> INFO : Calculated coverage in 0 seconds.
16:25:11 PIT >> INFO : Created  2 mutation test units
�/�-16:25:11 PIT >> INFO : Completed in 0 seconds
================================================================================
- Timings
================================================================================
> scan classpath : < 1 second
> coverage and dependency analysis : < 1 second
> build mutation tests : < 1 second
> run mutation analysis : < 1 second
--------------------------------------------------------------------------------
> Total  : < 1 second
--------------------------------------------------------------------------------
================================================================================
- Statistics
================================================================================
>> Generated 22 mutations Killed 3 (14%)
>> Ran 3 tests (0.14 tests per mutation)
================================================================================
- Mutators
================================================================================
> org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator
>> Generated 2 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0 
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 
> NO_COVERAGE 2 
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.ReturnValsMutator
>> Generated 5 Killed 1 (20%)
> KILLED 1 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0 
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 
> NO_COVERAGE 4 
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator
>> Generated 15 Killed 2 (13%)
> KILLED 2 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0 
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 
> NO_COVERAGE 13 
--------------------------------------------------------------------------------
:pitest (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 1.192 secs.
:build (Thread[Task worker for ':' Thread 3,5,main]) started.
:build
Skipping task ':build' as it has no actions.
:build (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.0 secs.

BUILD SUCCESSFUL in 12s
12 actionable tasks: 11 executed, 1 up-to-date
3.5.2
./build.sh: rad 9: ./node_modules/.bin/grunt: Filen eller katalogen finns inte
./build.sh: rad 13: ./node_modules/.bin/csslint: Filen eller katalogen finns inte
./build.sh: rad 28: flake8: kommandot finns inte
+ ls
build
build_and_copy.sh
build.gradle
build.sh
config
cpp
eslint.json
gradle
gradle.properties
gradlew
gradlew.bat
Gruntfile.js
package.json
perl
python
README.md
src
web
xml
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Static code analysis)
[Pipeline] ViolationsToBitbucketServer
Not using proxy, no proxy configured.
---
--- Jenkins Violation Comments to Bitbucket Server ---
---
bitbucketServerUrl: http://localhost:7990/bitbucket
projectKey: PROJECT_1
repoSlug: violations-test
pullRequestId: 1
credentialsId: true
createSingleFileComments: true
createSingleFileCommentsTasks: true
createCommentWithAllSingleFileComments: false
commentOnlyChangedContent: true
commentOnlyChangedContentContext: 5
minSeverity: INFO
keepOldComments: false
commentTemplate: null
Findbugs with pattern .*/findbugs/.*\.xml$
Checkstyle with pattern .*/checkstyle/.*\.xml$
Pull request: 1
Workspace: /var/jenkins/workspace/pipe
Found 7 violations from ViolationConfig [pattern=.*/findbugs/.*\.xml$, reporter=Findbugs, parser=FINDBUGS].
Found 6 violations from ViolationConfig [pattern=.*/checkstyle/.*\.xml$, reporter=Checkstyle, parser=CHECKSTYLE].
PR: PROJECT_1/violations-test/1 on http://localhost:7990/bitbucket
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

And this result in BBS:
sc1

from violation-comments-to-stash-plugin.

acizmarik avatar acizmarik commented on June 26, 2024

Thank you for your help! It's working now :)

It's a really nice plugin.

from violation-comments-to-stash-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.