-
Notifications
You must be signed in to change notification settings - Fork 179
[JENKINS-27120] Adding Workflow support for JaCoCo publisher #66
Conversation
…related whitesace/formatting changes
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests. |
👎 not keeping the original authorship. Not polite and discourages contribution. |
oh please, I would like to have this issue fixed and released by Thursday, anyone with permissions think it is going to be possible? |
Is there any chance this could be pulled/merged in the near future? @andresrc, I think @lordofthejars is more concerned with getting this released than with the authorship, and I could also use this fix. Also, there's the link to the original PR, which will show the original authorship. (@lordofthejars) In any case, thanks all. |
Exactly, I don t care the authorship I want that people can improve how
|
|
||
@Override | ||
public void onAttached(Run<?, ?> run) { | ||
this.owner = run; |
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.
Note that this means you could delete the owner
parameter from the constructor (assuming it is not used within the dynamic scope of the constructor).
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.
@jglick so I can remove the first parameter of this constructor: public JacocoBuildAction(Run<?,?> owner, Map<CoverageElement.Type, Coverage> ratios, ...)
without worrying about any side effect. Other plugins currently are not using JaCoCo API.
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.
Right. Note that the load
method will return an action whose getBuild()
would at that time return null, but once you call someBuild.add(theNewAction)
it gets initialized.
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.
Done
Other than the incorrect use of |
Just go ahead please, I actually lack the insight into the Jenkins internals necessary here anyway, just let me know when it is ready to merge |
@@ -92,6 +92,7 @@ THE SOFTWARE. | |||
<project.build.outputEncoding>UTF-8</project.build.outputEncoding> | |||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |||
<jacoco.version>0.7.5.201505241946</jacoco.version> | |||
<workflow.version>1.12</workflow.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.
Why is this here? Seems unused. (Of course you would use it if you wanted to add automated tests.)
fix FreeStyle projects to work as expected
@jglick ok I think that now it is ready to be merged into master. If you agree let's put a bee and I talk with James for the same. |
@reviewbybees |
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. |
Conflicts: src/main/java/hudson/plugins/jacoco/JacocoPublisher.java
Is there any update on this? @reviewbybees ? |
For me it is ok, but after pushing hard for trying to release this and after the time I decided to give it up. |
Are there any plans to merge this soon? |
fixes code review issues
Sure, just let me know when you think it is ready for merge so we can finally release this. |
Hi guys any ETA on this... we are also migrating to pipeline plugin, and it seems this essential plugin is still missing :( |
@jglick must review the last changes. |
I'm also moving to the Pipelne plugin and this PR would be a big help.i |
In order to allow others to give feedback more easily I have published a pre-release with these changes at https://github.com/jenkinsci/jacoco-plugin/releases/tag/2.1.0-beta1, please give it a try by manually installing the .hpi file in the Jenkins installation via "manage jenkins - plugins - advanced options - upload plugin" and report here if it works for you or not. |
BTW, a local build fails for me with the following on 1.638, seems the onAttached() is not called there? The changes set the required jenkins version to 1.609.3. ERROR: Build step failed with exception |
I can confirm the mentioned |
Created #73 to fix the NPE. |
After the NPE was fixed via #73 I have now merged these changes onto trunk. Please test it some more by running "mvn package" and then importing the resulting target/jacoco.hpi manually in Jenkins -> Manage -> Plugins -> Advanced. |
I tested the latest jacoco plugin (mvn package in my local pc) and the pipeline functionality. |
Might be related to JENKINS-31202. |
Could someone post, or link to a post that shows, what the syntax would be in order to use the JacocoPublisher? |
Just run the current master or even mheinzerling_2.1.0 with a current jenkins and you will get the pipeline configuration util for free. You can configure your step with the usual graphical interface. |
@mheinzerling - when using pipeline from a Jenkinsfile, you cannot use the graphical interface to configure. |
@mpchlets, more details please. I was talking about the pipeline snippet page. |
How to use the JacocoPublisher in a pipeline script? I cannot find any syntactical descriptions. I just tried to add |
@jreimone This is not supported in 2.0.1. Update at least to 2.1.0-beta |
@thatsIch, thank you very much. With 2.1.0-beta release I got an NPE but it worked successfully with the latest master I Built locally. Is there a possibility to display the trend of the coverage in the job's overview, as it is also done by the JUnit test results? |
You can use the Jacocopublisher to do that, this allows to display it in each build (in #1, #2 etc on the left side). Sadly the overview on the dashboard is not working since some integration is not working. |
Would really like the ability to have it in dashboard, but in build is good enough for now! I'm in the same place as Jreimone |
You can also use the html publisher to publish the |
I just tried |
It is called |
Oh, silly me, I just copied from a comment above and didn't check... Thanks! |
Always look into the source :P it is actually easier than to rely on hear-say. That is how I know about the class name. You are welcome :) |
Continued from PR #63 without all the whitespace changes...