-
Notifications
You must be signed in to change notification settings - Fork 179
[JENKINS-27120] Adding Workflow support for JaCoCo publisher #63
Conversation
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
@lordofthejars 👍 to review the coding style. Probably you will receive the common message "Unrelated changes", but... |
Well pom.xml file originally was formatted with tabs, white spaces (2 and 4) |
<dependency> | ||
<groupId>org.codehaus.plexus</groupId> | ||
<artifactId>plexus-utils</artifactId> | ||
<version>3.0.15</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know it was in the original pom, I have not introduced this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did introduce this change - thats why making unrelated changes is a bad idea!
see a whitespace ignoring diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is ok with no scope since it is used in one class. In previous Jenkins dependency (1.424.6) this artifact was resolved with transitivity. Now that we have moved the minimum Jenkins version to 1.609, this dependency is not there anymore and must be added specifically.
so at least one 🐛 on the The backwards incompatable changes likely warrant another 🐛 unless the maintainer is fine with this - and in this case you should go further with the changes and remove the public field (seeing as it could break pluginsanyway you may as well break them in a good way) The whole formatting changes made this really hard to review as well - which is almost another bug in itself. |
} | ||
|
||
protected static String resolveFilePaths(AbstractBuild<?, ?> build, BuildListener listener, String input) { | ||
protected String resolveFilePaths(Run<?, ?> build, TaskListener listener, String input) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incompatible change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's protected. Acceptable IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the class is public and non-final.
Well I disagree about format changing, since it is only pom.xml, which in reality has been untouched and at least it fixes that something happens in the past that PR were accepted with different formats, but the other I agree with you |
There is no public plugin depending on this one (except the terrible DotCi starter pack), so the backward compatibility issue may be irrelevant. |
It's not. It's everywhere and it makes reviews terribly cumbersome. |
Ok let me fix some of the problems and let's discuss with the maintainer if we want to add BCT or we can leave as is changing the attribute to private or package. |
* Loads the configuration set by user. | ||
*/ | ||
@DataBoundConstructor | ||
@Deprecated | ||
public JacocoPublisher(String execPattern, String classPattern, String sourcePattern, String inclusionPattern, String exclusionPattern, String maximumInstructionCoverage, String maximumBranchCoverage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next several hundred lines of diff are nothing but formatting changes. Also, it looks like there's some reordering of methods going on as well.
Really difficult to read the diff. Sorry @recena I don't agree. +1 to format the code, but in a separate PR please. I'm sure I missed some important changes because of formatting changes. |
What's not executed? Did you try to use |
New Commit (number 2) fixes the |
For me the change of AbstractBuild -> Run is ok and it should not be a problem at all. As all of you suggest I prefer to not start using BCT |
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests. |
With the whitespace changes this is unreviewable. Let us know when you can prepare a minimal diff. |
Well the only thing that I can do is discard the change and rework it again. |
@jglick have you tried passing w=1 to the url? https://github.com/jenkinsci/jacoco-plugin/pull/63/files?w=1 to avoid white space diffs? Next time I will not do automatic format but at least if you can review it with this option I wouldn't have to redo the change. |
But reviewing without whitespaces will still leave the PR unmergeable due to the huge number of unrelated changes! I have compared the changes locally and created PR #66 with the reduced changes to allow us to make progress on this one... I suggest you base further work on that branch. This PR is therefore obsoleted now by #66 . |
@centic9 Thanks, I started the same last evening. |
There is no test since testing JaCoCo plugin in unit test it goes to a chicken-egg problem. JaCoCo needs a classes directory to copy them to its internal structure, so the first idea is to copy those classes before executing the job, but then Jenkins complains that this job has already created a directory and it is not executed. I have tested manually and it works and a test should be added to ATH.
In fact if you look at all JaCoCoPublisher tests that were already created you'll notice that they do nothing or are commented, probably because of the same problem I faced during Workflow integration.
Issue: https://issues.jenkins-ci.org/browse/JENKINS-27120
@reviewbybees