Repository navigation
Update jacoco version - #55
Conversation
|
Unfortunately we cannot merge this right away as it breaks compatibility to older versions of jacoco.exec, thus breaking any project that still uses <=0.7.4. Some other solution is necessary, likely a new plugin which is based on the xml/tml report would be the right thing to do here... |
|
Ok, thanks for the info. |
|
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
|
So now all users who has updated jacoco version in their build tool will get no coverage info from Jenkins? New solutions notoriously take a lot of time. |
Correct. |
|
Yes, unfortunately this is the current state due to the initial decision to base the visualization on the jacoco.exec binary and not the resulting .xml-file, I can't think of any other way than to rewrite the plugin to be based on the XML-data instead. |
|
What about a determination which jacoco.exec file version is present and change the interpreter? |
|
It's probably not easy to package two different versions, you need to shade at least one of them and switch. We can put it in if somebody comes up with the relevant patches to code and pom.xml. Also I couldn't see a "version" in the file after a quick look, is there a way to distinguish which version wrote the file? However the official statement from the JaCoCo development team is that the binary format is internal and should not be used across different versions of JaCoCo, so the "real" fix is to use the XML Report... |
|
The header contains some data about it: I am on your side centic9, the xml report would be the better choice. |
|
hmm, what about doing the same as jacoco did? |
|
Would be another way. I like the idea, make it simple as possible. Administrators have to read the release notes and similar before updating. @centic9 What do you think? |
|
I thought about doing this, but I am running into roadblocks with this myself, I have an open source project which I contribute to, I build it both locally on a Jenkins instance and on another shared Jenkins instance which I do not maintain. So if I raise JaCoCo to 0.7.5 in this project, I can get this to build on my local Jenkins instance by using a newer JaCoCo plugin, but it will not build any more on the global one. If I get the global Jenkins to be updated as well, many other projects that are built on that instance will break unless they update their JaCoCo dependency, which may cause the projects to fail on yet other Jenkins instances... As a result I would expect some negative responses/bug-entries/... as many admins expect the newer versions to be backwards compatible to some degree without failing completely. |
|
In this case the header I pointed out the days would be the solution. |
|
+1 for this issue. I just ran into the error and had to downgrade to 0.7.4 in my project.
I could see this scenario becoming a problem if the existing plugin changed from using the binary files to the XML reports. Existing jobs would need to be reconfigured to point to the XML files instead of the binaries. If the change is made to this plugin, it's probably a good idea to provide some sensible defaults to help with the upgrade path (naive approach: just copy the exec files path and replace |
|
SonarQube seems to be able to handle the new version of JaCoCo fine. Is there any progress on this issue? |
|
Yup. @SonarSource guys now (from 5.2 version) just support both versions of jacoco. And they display warning message that you are using older version and you should consider to upgrade. For a good couple months they just use old version and builds just fail with I think of couple simple solutions, that could deliver seamless work/upgrade without introducing regression into many people builds:
Last solution is best for me. What do you think about my propositions? BTW. I also think that, when you use RANT! It's 2015 now, guys. Did you hear about semantic versioning? Jacoco |
|
Just merge after all of this discussion? What next? |
|
Not much likely as no-one seems to be able to put effort into a different/better solution... |
|
Mayby I will provide a PR with additional support for http://search.maven.org/#artifactdetails%7Corg.sonarsource.java%7Cjava-jacoco-previous%7C3.7.1%7Cjar |
|
Yes, a PR would be highly welcome! |
|
I don't mean to bring up a dead thread but have there been any updates on this? We would like to upgrade our plugin to the latest version so we can have Jenkins pipeline support but cannot because hundreds of jobs use the old one which only works with jacoco 0.7.4 and below. Has XML read support been added? How bad was the backwards compatibility breakage? Could a custom org.jacoco.core.data.ExecutionDataReader be written to read in old formats and store them in memory converting them to the new form? Update: Looks like if there was a way to determine the version (or try again with the old version if loading with the new version results in all 0's or something) then https://mvnrepository.com/artifact/org.sonarsource.java/java-jacoco-previous/4.4.0.8066 might work as suggested. |
|
Using the XML file proved to be quite some work when I last did take a quick look. Without somebody willing to invest the time and effort to build it, it won't be available anytime soon. Adding support for the older format may be possible, but you would likely need to "shadow" the older code of JaCoCo and try that if the newer one is not able to read the information from the binary. Again it will only happen if somebody steps up to provide the changes and is willing to maintain it to some degree. |
|
I was able to use the shadowing approach by having delegates of ExecutionDataReader and Analyzer to call the real implementation or a shadowed 0.7.4 compatible one mentioned earlier based on the exec file versions. The file format of the exec files starts with a header of
0.7.4 uses version 0x1006. 0.7.5 - present uses version 0x1007. I may not be able to contribute - it depends on legal. Where is the license for this repository? |
https://github.com/jenkinsci/jacoco-plugin/blob/master/pom.xml#L2 |
|
As this PR is already merged/closed you should probably start a new issue or PR where you describe this so at least someone else can re-do the work if you are not able to contribute it. |
|
PR for backwards compatibility @ #82 |
jacoco 0.7.5 has been released