Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:07
    dependabot[bot] labeled #98
  • 06:07
    dependabot[bot] labeled #98
  • 06:07
    dependabot[bot] opened #98
  • 06:07

    dependabot[bot] on maven

    Bump analysis-pom from 5.30.0 t… (compare)

  • Jul 06 18:49
    dependabot[bot] synchronize #71
  • Jul 06 18:49

    dependabot[bot] on maven

    Bump git-changelist-maven-exten… (compare)

  • Jul 06 18:49
    dependabot[bot] edited #71
  • Jul 06 18:49
    dependabot[bot] edited #71
  • Jul 06 18:49
    uhafner commented #71
  • Jul 06 18:49

    uhafner on master

    Bump analysis-pom from 5.28.0 t… Merge pull request #97 from jen… (compare)

  • Jul 06 18:49
    uhafner closed #97
  • Jul 06 18:49

    uhafner on maven

    (compare)

  • Jul 04 09:32
    codecov[bot] commented #1304
  • Jul 04 09:27
    codecov[bot] commented #1302
  • Jul 04 09:07
    github-actions[bot] assigned #1304
  • Jul 04 09:05
    github-actions[bot] assigned #1303
  • Jul 04 09:01
    dependabot[bot] labeled #1304
  • Jul 04 09:01
    dependabot[bot] labeled #1304
  • Jul 04 09:01
    dependabot[bot] opened #1304
  • Jul 04 09:01
    github-actions[bot] assigned #1302
Marcus Klein
@kleini
Is it possible to record warnings written by Gradle? Not the Java compiler warnings but the ones from Gradle telling me, that I am using Gradle features, that will be removed in upcoming versions.
Ulli Hafner
@uhafner:matrix.org
[m]
Not yet. You need to write a new parser. But that should be quite simple.
Marcus Klein
@kleini
Okay, thanks.
Yuriy Tymchuk
@Uko
Hi everyone! It looks like Gradle has a different output format than that expected by java, javaDoc, scala tools. Are there any recommended solutions for this? Do people use custom parsers? Is there a way to tell Gradle to use the default output format?
Ulli Hafner
@uhafner:matrix.org
[m]

I do not use Gradle on my own. But normally the format is not much different, so that the parser could be changed to parse both formats, here is an example: https://github.com/jenkinsci/analysis-model/blob/master/src/test/resources/edu/hm/hafner/analysis/parser/javac.log

Maybe it helps to see what is actually different in Gradle.

Joel Armstrong
@jrarmstro
Hello. Is it possible to post warnings to a separate job?
Ulli Hafner
@uhafner:matrix.org
[m]
No, this is not possible.
1 reply
Ulli Hafner
@uhafner:matrix.org
[m]
But where does this other build come from? Can you please elaborate your planned use case?
Joel Armstrong
@jrarmstro
We want a shared library to trigger another build to perform some common linting operations, then post any warnings it finds back to the original build.
Ulli Hafner
@uhafner:matrix.org
[m]
I think you are trying to misuse builds or separate jobs, shouldn’t these linters run as a step of your original pipeline? I am very reluctant in introducing a new API that cannot be used from UI and Freestyle jobs. I‘m also not sure what this means for the original build: it is already finished, so I am not sure if it is even possible to add additional results.
Jordan Gibson
@JordanGibson
Hi all - I'm trying to get spotbugs results to be published to github for a multibranch pipeline job, but for some reason it doesn't seem to be working. The checks are published in Jenkins correctly, but not to github. Is there a particular way to specify to publish checks to github that I'm missing currently? Thanks.
Ulli Hafner
@uhafner:matrix.org
[m]
Did you follow the instructions on how to connect the Checks with your Jenkins instance?
What exactly happens when you write " it doesn't seem to be working"? What does the warnings plugin (and checks plugin) show in the console log of the build?
Jordan Gibson
@JordanGibson
Yeah - followed the instructions in the docs. Apologies for the ambiguity - what I mean is the results are not published to github, the only difference that I can see between the setup guide and our own implementation is that we are using a user instead of an app. This was a dedicated user for publishing statuses, and using it has worked so far for us. There is mention in the logs of [Checks API] saying no suitable checks publisher is found, however the results of the build are still published with the default context of continuous-integration/jenkins/pr-merge. The following are the final relevant logs of the build.
[Static Analysis] Created analysis result for 331 issues (found 0 new issues, fixed 0 issues)
[Static Analysis] Attaching ResultAction with ID 'analysis' to build 'Pull_Requests_SpotBugs_Pipeline_Build/PR-27926 #50'.
[Checks API] No suitable checks publisher found.

GitHub has been notified of this commit’s build result
I'm not a Jenkins pro (as you can probably tell) so it may be that I'm missing something quite simple.
Jordan Gibson
@JordanGibson
No, we haven't been able to due to organization permission issues. We have so far been using a user dedicated for publishing statuses. Are users unable to publish detailed statuses (ie with test results)?
Ulli Hafner
@uhafner:matrix.org
[m]
I think GitHub checks API requires a GitHub App. I don't know if there is another way available yet. Maybe this question is better suited for the https://matrix.to/#/#jenkinsci_github-checks-api:gitter.im room?
My plugin simply calls the checks API, which then publishes these results
Jordan Gibson
@JordanGibson
Ok sure - apologies! Thank you for the help :)
Jordan Gibson
@JordanGibson

Hi - thanks for the reference. I was able to get the issue sorted. Just one query - is it possible to define a branch as the baseline branch for new issues? The build which we will be running is for a multibranch pipeline against pull requests. We want to verify that in each pull request, no new warnings are introduced as a result of those changes, otherwise the build fails.

I can see there are quality gates, which I've added with the type NEW, however this compares the basline number of warnings against the previously ran build on the feature branch. I'd like to compare the baseline against the target branch's recent build. Is this possible?

Ulli Hafner
@uhafner:matrix.org
[m]
You need to run the reference build step: https://github.com/jenkinsci/git-forensics-plugin#reference-build
Before you invoke the warnings plug-in
Jordan Gibson
@JordanGibson
I wasn't aware of that - thanks
Ulli Hafner
@uhafner:matrix.org
[m]
You can see this plug-in in action in the CI builds of the warnings plug-in
mkm-dt
@mkm-dt
In a big project with 1k+ checkstyle XML files, I'm seeing a delay of 30s in the step that is recording checkstyle warnings before the first log line is printed. Unfortunately, this increases to 15+ min when executing the same build in the cloud. Any hints on how to debug? Note: this does not happen when there are no files to be found, and putting those files into their own directory hierarchy also does not change anything. Also, java() is not affected, so it seems related to the files, somehow.
1 reply
Ulli Hafner
@uhafner:matrix.org
[m]
Can you please post your original question? It seems that the message somehow disappeared from the server...
mkm-dt
@mkm-dt
Reposting on request: In a big project with 1k+ checkstyle XML files, I'm seeing a delay of 30s in the step that is recording checkstyle warnings before the first log line is printed. Unfortunately, this increases to 15+ min when executing the same build in the cloud. Any hints on how to debug? Note: this does not happen when there are no files to be found, but putting those files into their own directory hierarchy does not help. Also, java() is not affected, so it seems related to the files, somehow.
Ulli Hafner
@uhafner:matrix.org
[m]
The processing depends on the number of issues (and the number of affected files). All issues are serialized to XML and that takes time and memory to create and to transfer from agent to the controller. So if you have 1k warnings are typically ok, but 10k warnings will bring the plugin architecture at its limits. It is developed with the focus on clean projects.
mkm-dt
@mkm-dt
We fail the build if there are any warnings (and use this plugin to report why that happened), so that's not the case here. Most of the files are empty except for XML necessities, but others list some files, so the total size is about 6MB.
3 replies
Jordan Gibson
@JordanGibson
Hi @uhafner:matrix.org , me back again. Everything has been working great so far and we were able to successfully establish baseline builds. There is however an issue I've noticed with resetting quality gates. We have a trunk branch, which for some reason or another, had ~600 warnings less than expected on one build, which decreased the threshold and all subsequent builds then failed. I noticed there was a reset button beside the quality gate on Jenkins, but I think I must be using it wrong as when I click it, the button disappears - when I build again against trunk, it'll fail on the quality gate with the same number of warnings and using the previously successful build as the reference build for the threshold, which is the lower number. Do you have any advice on how we can reset this quality gate?
Ulli Hafner
@uhafner:matrix.org
[m]
The disable button is only for the last build. There’s an open feature request for this issue. The only workaround I see is to disable the quality gates, run a build, and enable again.
You can test the performance by cloning the analysis-model module and running the CheckStyle test with your cal file. Then you see how long the parsing lasts.
Jordan Gibson
@JordanGibson
I don't think that's feasible for us, we only allow committing to our base branches through PRs as they are protected branches. To disable the gates, we need to commit as it's for a multibranch pipeline in a Jenkinsfile so I'm not too sure what our plan is.
and the check this is for is a required check
Ulli Hafner
@uhafner:matrix.org
[m]
I see. You can add yourself as watchee of https://issues.jenkins.io/browse/JENKINS-56178, but I don't have capacity to implement that feature right now.
Jordan Gibson
@JordanGibson
Thanks. I have discovered that even when I reset the quality gate for the given pipeline, the subsequent build flags the same number of issues (the actual number, not the lower number), looks like it's still using the last "successful" build (where the number was lowered). Does resetting the quality gate not work when we fail the build if the quality gate is violated? Build #27 had 1300 warnings, Build #30 then had 700 warnings (which was marked as successful). Build #35 this morning had 1300 issues and failed on the quality gate as it was using #30 as the reference. I then reset the quality gate. Build #36 then had 1300 issues but still failed, saying it was using #30 as a reference. Maybe this is expected, I'll follow that issue on Jira, thanks.
2 replies
Ulli Hafner
@uhafner:matrix.org
[m]
Ok, then this is https://issues.jenkins.io/browse/JENKINS-61140, yet another issue in that part of the code 🤦‍♂️
Richard Eckart de Castilho
@reckart
Hiho all
I am trying to set up a matrix build but it fails at the end with a message
java.lang.IllegalStateException: ID analysis is already used by another action: io.jenkins.plugins.analysis.core.model.ResultAction for Static Analysis
By googling this message. I found amongst other things this channel
I have already tried setting a unique ID for each of the matrix branches - and it seems to have worked once and now again does not work:
                script {
                  def mavenConsoleIssues = scanForIssues tool: mavenConsole("maven-${PLATFORM}")
                  def javaIssues = scanForIssues tool: java("java-${PLATFORM}")
                  def javaDocIssues = scanForIssues tool: javaDoc("javaDoc-${PLATFORM}")
                  def analysisId = "analysis-${PLATFORM}"
                  echo "analysisId: ${analysisId}"
                  publishIssues id: analysisId, issues: [mavenConsoleIssues, javaIssues, javaDocIssues]
Looking at issue reports, experience reports, even the source code, I don't see what I might be doing wrong or what I might be missing 😢
Richard Eckart de Castilho
@reckart
... ok ... as usual after lots of searching and asking, it could be I found the problem... namely a second location in my pipeline script where I call publishIssues and there the ID was not set ... let's see ...
Richard Eckart de Castilho
@reckart
ok... works now 😅 🎉
Ulli Hafner
@uhafner:matrix.org
[m]
Good to see!
Ulli Hafner
@uhafner:matrix.org
[m]
Ok, maybe the parsing overhead for a single file is too large in in the current parser implementation. I must admit that I never encountered a project with more than 10 checkstyle.xml files...
mkm-dt
@mkm-dt
I thought this was quite common, especially since the gradle built-in checkstyle plugin generates one file per source-set per project. Even a tiny gradle multi-module project could easily exceed 10 xmls that way
Sebastian Roth
@sebsnyk

Hi everyone - I'm trying to run multiple instances of the sarif tool within a Jenkinsfile. For example:

recordIssues tool: sarif(pattern: 'results-tool1.sarif')
recordIssues tool: sarif(pattern: 'results-tool2.sarif')

This will cause incorrect UX in Jenkins, with 2 SARIF Warnings Tabs pointing to the same link. Is it possible to separate the data properly?

1 reply