Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 25 2019 06:05
  • Jan 23 2019 13:32

    cizezsy on dev

    [maven-release-plugin] prepare … (compare)

  • Jan 23 2019 13:32

    cizezsy on code-coverage-api-1.0.7

    (compare)

  • Jan 23 2019 13:32

    cizezsy on dev

    [maven-release-plugin] prepare … (compare)

  • Jan 23 2019 13:24

    cizezsy on dev

    Fix: thresholds set in global l… Merge pull request #67 from jen… (compare)

  • Jan 23 2019 13:24
    cizezsy closed #67
  • Jan 23 2019 07:09
    cizezsy synchronize #67
  • Jan 23 2019 07:09

    cizezsy on duplicated-thresholds

    Fix: thresholds set in global l… (compare)

  • Jan 23 2019 07:06
    cizezsy reopened #67
  • Jan 23 2019 07:06
    cizezsy closed #67
  • Jan 23 2019 07:03
    cizezsy opened #67
  • Jan 23 2019 07:02

    cizezsy on duplicated-thresholds

    Fix: thresholds set in global l… (compare)

  • Jan 23 2019 03:31

    cizezsy on dev

    remove unused import (compare)

  • Jan 22 2019 09:46

    cizezsy on dev

    Fix: threshold cannot be serial… Merge pull request #66 from jen… (compare)

  • Jan 22 2019 09:46
    cizezsy closed #66
  • Jan 22 2019 09:31
    cizezsy opened #66
  • Jan 22 2019 09:30

    cizezsy on threshold-serialize

    Fix: threshold cannot be serial… (compare)

  • Jan 18 2019 03:48
    cizezsy commented #65
  • Jan 17 2019 18:08
    andre2007 opened #65
  • Jan 17 2019 12:35
    cizezsy closed #64
Lu Liu
@afkbrb
@oleg-nenashev Thanks for your advice, I'll try to fix some issues.
Lu Liu
@afkbrb

@cizezsy
I've been studying this project these days, I found that the embedded jacoco adapter and istanbul adapter cannot find source code. For example, if we need to copy a java file named com.mycompany.project.Foo.java which located at workspace/project-name/src/main/java/com/mycompany/project/Foo.java, the plugin will try to find it at workspace/project-name/com/mycompany/project/Foo.java, thus causing an exception.

The plugin will try other possible paths if it fails at first, but the property possiblePaths at DefaultSourceFileResolver.SourceFilePainter depends on additionalProperty at JavaCoverageParser, which needs the corresponding configuration at jacoco-to-standard.xsl or istanbul-cobertura-to-standard.xsl. But there is no configuration about addtionalProperty at these two xsl files. I found that in the proejct cobertura-plugin, the cobertura-to-standard.xsl does have configuration for addtionalPropery, so after I install this plugin, the api plugin can find the source code when I use cobertura adapter (not istanbul cobertura plugin).

Maybe we can change istanbul-cobertura-to-standard.xsl according to cobertura-to-standard.xsl so that the istanbul adapter can work.

As for the jacoco adapter, I found that the jacoco report file (jacoco.xml) doesn't contain source path information (sources/source element) like cobertura report file (coverage.xml), so we cannot solve the problem by changing jacoco-to-standard.xsl.

I'd suggest providing an option to specify the source path at the position where Report File Path is set when configuring the pipeline. We can still use coverage report to guess the possible paths, but when guessing doesn't work, we need to configure it manually.

I may have some misunderstanding to this project since I'm new to it, please point out wherever I'm wrong.

Shenyu Zheng
@cizezsy

@afkbrb Thanks for your report~

This is a bug introduced by https://github.com/jenkinsci/code-coverage-api-plugin/pull/131/files. We had used **/path to search source files if we cannot find it, but this piece of code had been removed https://github.com/jenkinsci/code-coverage-api-plugin/pull/131/files#diff-bfc1049a19a171aa030105c927e1c8a8L228 because of this operation is not very efficient. Maybe we should not remove it.

Maybe we can change istanbul-cobertura-to-standard.xsl according to cobertura-to-standard.xsl so that the istanbul adapter can work.

Although they are using the same report format, there are some tiny differences between them. I think it is better to keep the two different XSL files and add the addtionalProperty to istanbul-cobertura-to-standard.xsl.

I'd suggest providing an option to specify the source path at the position where Report File Path is set when configuring the pipeline.

Yeah, good suggestion. We can add an option so that don't need to search source files every time
.

@afkbrb Do you want to open a PR to fix these problems? thanks!
Lu Liu
@afkbrb

@cizezsy

Do you want to open a PR to fix these problems? thanks!

Of course, I'm glad to contribute to this project!

jftsunami
@jftsunami
@afkbrb I think I'm running into the same issue you are having, where the plugin used to wildcard search for the way 'jacoco.xml' specified relative paths?
Ullrich Hafner
@uhafner
I wonder if it would make sense to extract the source code searching, rendering and storing into a new plugin. So that other plugins (like the warnings plugin) can share the same code. I have done that for the UI components (echarts, boostrap, data tables) and plan to do that for the source code rendering part as well.
Ullrich Hafner
@uhafner
@cizezsy BTW: I extracted ECharts as a Jenkins plugin now: https://github.com/jenkinsci/echarts-api-plugin. Then you can depend on this library rather than download and bundle a copy of the chart lib with your code.
jftsunami
@jftsunami
@uhafner I think that would be a good idea. warnings and coverage are already doing two very similar things as it stands.
Oleg Nenashev
@oleg-nenashev
@uhafner What about adding it to the GSoC project idea? https://jenkins.io/projects/gsoc/2020/project-ideas/code-coverage-api-improvements/
I also wonder whether the Code Coverage API and Warnings NG could share the GitHub Checks API integration (when somebody works on it)
Jean-Christophe Morin
@JeanChristopheMorinPerso
It would make sense I think if they share the same code/integration, and same for Bitbucket (Bitbucket server has the same concept as GitHub Checks API). It would make things simpler for users I think.
Oleg Nenashev
@oleg-nenashev
Could be. Though we should be careful to avoid over-engineering there (beware of SCM API plugin)
Lu Liu
@afkbrb

I can try adding this feature in the next few days.

I'd suggest providing an option to specify the source path at the position where Report File Path is set when configuring the pipeline.

rameshar16
@rameshar16
Hi
I am getting the below error with Jacoco reports

Source
Source code is unavailable. Some possible reasons are:

You have specified source file storing level to never save.
Code Coverage API plugin cannot found source files.
You do not have sufficient permissions to view this file.

publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')], sourceFileResolver: sourceFiles('STORE_ALL_BUILD')
Here is pipeline syntax I am using
My Jenkins Version is 2.213
Please help me if anyone is getting same issue
rameshar16
@rameshar16

Publishing Coverage report....

A total of 1 reports were found

Source File Navigation is enabled - Current level: STORE_ALL_BUILD

55 source files need to be copied.

Starting copy source file DateTime.java.

java.io.IOException: Unable to find source file DateTime.java in workspace /tmp/workspace/DevOps/JobName

at io.jenkins.plugins.coverage.source.DefaultSourceFileResolver$SourceFilePainter.invoke(DefaultSourceFileResolver.java:147)

at io.jenkins.plugins.coverage.source.DefaultSourceFileResolver$SourceFilePainter.invoke(DefaultSourceFileResolver.java:127)

at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3069)

at hudson.remoting.UserRequest.perform(UserRequest.java:211)

at hudson.remoting.UserRequest.perform(UserRequest.java:54)

at hudson.remoting.Request$2.run(Request.java:369)

at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)

at java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

at java.lang.Thread.run(Thread.java:834)

Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to slave06_medium
Here is the error I am seeing in Jenkins job console
Ullrich Hafner
@uhafner
@oleg-nenashev That would be a possible project, yes. Also creating a generic plugin that provides GitHub checks API in Jenkins would be a good project (this one is on my list for possible bachelor thesis projects) . I have a lot of additional ideas for similar new features ;-) But since I start again working at 100% in the university starting from March I doubt that I will find enough spare time to serve as a mentor. (But I can write a proposal if that helps at least…)
Oleg Nenashev
@oleg-nenashev
@uhafner it would be great. I can help with facilitating the idea in the community
Shenyu Zheng
@cizezsy

I wonder if it would make sense to extract the source code searching, rendering and storing into a new plugin. So that other plugins (like the warnings plugin) can share the same code. I have done that for the UI components (echarts, boostrap, data tables) and plan to do that for the source code rendering part as well.

This is a good idea, could you add it to the project idea? Thanks!

Shenyu Zheng
@cizezsy

@afkbrb I think I'm running into the same issue you are having, where the plugin used to wildcard search for the way 'jacoco.xml' specified relative paths?

@jftsunami The plugin uses the wildcard search to look for relative paths under the workspace.

Please help me if anyone is getting same issue

@rameshar16 This might be caused by this change. If it is possible, could you post your coverage report so that I can test it locally to confirm the bugs?

rameshar16
@rameshar16
@cizezsy May I know the path? Is it in target dir?
Lu Liu
@afkbrb
@cizezsy I opened PR #136 and #139 , can you please review them?
Lu Liu
@afkbrb
@oleg-nenashev @cizezsy Will the draft (https://jenkins.io/projects/gsoc/2020/project-ideas/code-coverage-api-improvements) finally be accepted as a gsoc project idea?
Oleg Nenashev
@oleg-nenashev
@afkbrb Draft project ideas are also accepted ones, they just need some action from potential mentors to be published as finalized ones
So yes, yo can apply
Shenyu Zheng
@cizezsy

@cizezsy May I know the path? Is it in target dir?

yes, it is usually in target/site/jacoco/jacoco.xml

Lu Liu
@afkbrb
@cizezsy I've managed to fix ENKINS-60359, the PR is #141 , waiting for your review!
Stephan Vedder
@feliwir
Does this work for LCOV/GCOV already?
vaibhav agarwal
@vaibhav-46
Hi everyone. I am really impressed with this plugin and the kind of the things that it provides. I have a few minor questions that I am trying to answer: 1. The release [https://www.jenkins.io/blog/2018/08/17/code-coverage-api-plugin-1/] has a section on Source Code Navigation which talks about enabling it in a Post-build Actions. Is there a way to do this in the groovy-pipeline model? I would like to keep the files around and be able to dive deep into the current run. Even if there is no such way, is there a way to change the default in Jenkins to keep the last x builds? 2. Haven't used it enough but does the trending chart show up on the home page of the job? If not, is there a configuration that can help add that? Thank you so much for this plugin.
Kezhi Xiong
@XiongKezhi

Hi @jeffpearce @cizezsy, do you have time to join our tomorrow's meeting at UTC 2 pm? We will be talking about the progress on the coverage checks.

@all, anyone else here (whether users or developers) is also welcome :)

Ullrich Hafner
@uhafner
Oleg Nenashev
@oleg-nenashev
:+1:
rompic
@rompic
hi :) what's the best way to get gcov reports into this? using gcovr with cobertura?
Oleg Nenashev
@oleg-nenashev
@rompic yes, it's the best way
rompic
@rompic
@oleg-nenashev thanks works like a charm
rompic
@rompic
Hi i see that, publishCoverage with STORE_LAST_BUILD takes quite some time on ours setups. this copies files back to master right?
Ullrich Hafner
@uhafner
Yes
The files are currently logged into the console so you could compute the time manually to see if this is the problem.
rompic
@rompic
Yeah that's it. Yesterday it took 5-10 seconds per file. with 399 files it took 53mins 1s. :O
Ullrich Hafner
@uhafner
Ups, that is really slow. In the warnings plugin I’m also copying the sources, but there I never experienced such problems. Maybe not the copying but the transforming to a colored HTML source is so expensive?
rompic
@rompic
it looks like this
09:40:22 Publishing Coverage report....
09:40:27 A total of 1 reports were found
09:40:27 Source File Navigation is enabled - Current level: STORE_LAST_BUILD
09:40:27 399 source files need to be copied.
09:40:35 Starting copy source file a.java.
09:40:40 Copied a.java.
09:40:40 Starting copy source file b.java.
09:40:45 Copied b.java.
...
10:33:15 Starting copy source file c.java.
10:33:18 Copied c.java.
10:33:18 Calculating coverage change for change request build is enabled, target branch master
10:33:24 [GitHub Checks] GitHub check (name: Code Coverage, status: COMPLETED) has been published.
Ender Tunc
@endertunc_gitlab
Hi all, am I missing something or option sourceFileResolver: sourceFiles('STORE_ALL_BUILD') is not mentioned anywhere. I had to come here to find out how to configure it :)