Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-27120] Adding Workflow support for JaCoCo publisher #63

Closed
wants to merge 4 commits into from
Closed

[JENKINS-27120] Adding Workflow support for JaCoCo publisher #63

wants to merge 4 commits into from

Conversation

lordofthejars
Copy link
Contributor

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

@ghost
Copy link

ghost commented Dec 22, 2015

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 lordofthejars changed the title [FIXED JENKINS-27120] Adding Workflow support for JaCoCo publisher [JENKINS-27120] Adding Workflow support for JaCoCo publisher Dec 22, 2015
@recena
Copy link

recena commented Dec 22, 2015

@lordofthejars 👍 to review the coding style. Probably you will receive the common message "Unrelated changes", but...

@lordofthejars
Copy link
Contributor Author

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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no scope?

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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.

@jtnord
Copy link
Member

jtnord commented Dec 22, 2015

so at least one 🐛 on the RoleSensitive implementation on FileCallable.

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incompatible change.

Copy link
Member

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.

Copy link
Member

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.

@lordofthejars
Copy link
Contributor Author

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

@daniel-beck
Copy link
Member

There is no public plugin depending on this one (except the terrible DotCi starter pack), so the backward compatibility issue may be irrelevant.

@daniel-beck
Copy link
Member

I disagree about format changing, since it is only pom.xml

It's not. It's everywhere and it makes reviews terribly cumbersome.

@lordofthejars
Copy link
Contributor Author

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
Copy link
Member

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.

@amuniz
Copy link
Member

amuniz commented Dec 22, 2015

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.

@amuniz
Copy link
Member

amuniz commented Dec 22, 2015

@lordofthejars

but then Jenkins complains that this job has already created a directory and it is not executed

What's not executed? Did you try to use @LocalData?

@lordofthejars
Copy link
Contributor Author

New Commit (number 2) fixes the @Override problem and updates Java version to 6. Also it creates a static nested class of FileCallableand adds an scope to a dependency.

@lordofthejars
Copy link
Contributor Author

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

@jenkinsadmin
Copy link
Member

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@jglick
Copy link
Member

jglick commented Jan 19, 2016

With the whitespace changes this is unreviewable. Let us know when you can prepare a minimal diff.

@lordofthejars
Copy link
Contributor Author

Well the only thing that I can do is discard the change and rework it again.

@lordofthejars
Copy link
Contributor Author

@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.

@centic9
Copy link
Member

centic9 commented Jan 20, 2016

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 centic9 closed this Jan 20, 2016
@lordofthejars
Copy link
Contributor Author

@centic9 Thanks, I started the same last evening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants