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

Make compatible with Jenkins Workflow/Pipeline plugin for report publishing #50

Closed
60secs opened this issue Feb 23, 2016 · 80 comments

Comments

Projects
None yet
@60secs
Copy link

commented Feb 23, 2016

The Jenkins Workflow/Pipeline plugin does not support post build steps. To support it, plugins need to make changes as outline in the Plugin Developer Guide at:

https://github.com/jenkinsci/workflow-plugin/blob/master/COMPATIBILITY.md

See corresponding issue in Jenkins Issue tracker
https://issues.jenkins-ci.org/browse/JENKINS-30700

@leth

This comment has been minimized.

Copy link

commented Feb 23, 2016

I'm working a changeset for this, but I could do with some advice from someone more familiar with how Jenkins plugins work, as I'm mostly guessing and copying from the junit and xunit plugins.
I'll post a PR with more info in the next couple of days.

@leth

This comment has been minimized.

Copy link

commented Feb 24, 2016

These are the areas I could use some advice on: leth@52a2ce9

@ghost

This comment has been minimized.

Copy link

commented Mar 14, 2016

@leth, any chance to get your changes merged in the near feature?

@leth

This comment has been minimized.

Copy link

commented Mar 14, 2016

Sorry, I've not got around to working on it recently; I would need to find the time to do some more digging to understand the refactoring needed.

So no, it's not likely to be soon, sorry. Feel free to work on it if you find time to do so before I do!

On 14 March 2016 13:29:06 GMT+00:00, Stijn Van Nieuwenhuyse notifications@github.com wrote:

@leth, any chance to get your changes merged in the near feature?


Reply to this email directly or view it on GitHub:
#50 (comment)

Sent from my phone. Please excuse my brevity.

@vekexasia

This comment has been minimized.

Copy link

commented Mar 14, 2016

Keep us updated @leth

@s0undt3ch

This comment has been minimized.

Copy link

commented May 6, 2016

I've been waiting for this support for a while now, unfortunately I do not know enough Java to do it myself or I would.

Are there any plans to implement this? Besides eventually of course.

@rudicba

This comment has been minimized.

Copy link

commented May 13, 2016

+1

3 similar comments
@karlhaas

This comment has been minimized.

Copy link

commented May 18, 2016

+1

@piccarsso

This comment has been minimized.

Copy link

commented May 18, 2016

+1

@ceelian

This comment has been minimized.

Copy link

commented May 18, 2016

+1

@nickbroon

This comment has been minimized.

Copy link

commented May 31, 2016

I think what's needed is to implement the SimpleBuildStep interface. similar to what the xunit plugin does: https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/java/org/jenkinsci/plugins/xunit/XUnitPublisher.java#L63

@nickbroon

This comment has been minimized.

@haugthom

This comment has been minimized.

Copy link

commented Jun 8, 2016

+1

mbarrien added a commit to mbarrien/cobertura-plugin that referenced this issue Jun 9, 2016

@DJViking

This comment has been minimized.

Copy link

commented Jun 9, 2016

+1

mbarrien added a commit to mbarrien/cobertura-plugin that referenced this issue Jun 9, 2016

mbarrien added a commit to mbarrien/cobertura-plugin that referenced this issue Jun 16, 2016

@IvanAnishchuk

This comment has been minimized.

Copy link

commented Jun 21, 2016

Any news?

@francisdb

This comment has been minimized.

Copy link

commented Jul 15, 2016

Can we have a release (and docs) for this?

@nickbroon

This comment has been minimized.

Copy link

commented Jul 15, 2016

I don't think it's been fully implemented yet.

@francisdb

This comment has been minimized.

Copy link

commented Jul 15, 2016

@mbarrien mind to let us know what the state of this ticket is?

@cernenwein

This comment has been minimized.

Copy link

commented Jul 20, 2016

+1

4 similar comments
@arpheno

This comment has been minimized.

Copy link

commented Jul 20, 2016

+1

@RockLobster

This comment has been minimized.

Copy link

commented Aug 12, 2016

+1

@Hochoban

This comment has been minimized.

Copy link

commented Aug 15, 2016

+1

@rpocase

This comment has been minimized.

Copy link

commented Aug 19, 2016

+1

@nickbroon

This comment has been minimized.

Copy link

commented Aug 19, 2016

Pull Request #55 appears to be to add this feature request.

@zackpollard

This comment has been minimized.

Copy link

commented Sep 14, 2016

Any update on this? Seems like a great shame that this isn't getting implemented. Seems like #55 is mostly there, but has some issues right now. Anyone who is a contributor on this project able to give an update regarding whether this will be implemented soon?

@sxamit

This comment has been minimized.

Copy link

commented Nov 22, 2016

+1

@GabLeRoux

This comment has been minimized.

Copy link

commented Nov 23, 2016

This is a feature killer, is there a way we can help here? I see there's currently 6 commits referencing this. Anyone with experience with Jenkins pipeline and cobertura-plugin could provide us with details on what's left to do and or what could be done to finish this faster?

I'm not very familiar with Java nor jenkins plugin development, but I really want this feature. If I can do something to help here, I'd be very happy to contribute.

Oh I'll start by testing #55 🍸
Edit: while trying to setup the plugin, I found a few other jenkinfiles on github and they seem to use this instead:
https://github.com/cwacek/cobertura-clover-transform

// install cobertura -> clover transform (until cobertura is supported in pipelines)
// requires python-pip libxslt-devel
sh """
  pip install cobertura-clover-transform"  // needs lxml
  cobertura-clover-transform coverage.xml > clover.xml
"""

step([$class: 'CloverPublisher', cloverReportDir: 'reports', cloverReportFileName: 'clover.xml'])

But I'm personally getting the following stacktrace with this:

java.lang.NullPointerException
	at hudson.plugins.clover.CloverPublisher.processCloverXml(CloverPublisher.java:250)
	at hudson.plugins.clover.CloverPublisher.performImpl(CloverPublisher.java:202)
	at hudson.plugins.clover.CloverPublisher.perform(CloverPublisher.java:167)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:59)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
	at hudson.security.ACL.impersonate(ACL.java:221)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

and Clover is actually 300$ for a single machine

@y0n1

This comment has been minimized.

Copy link

commented Feb 21, 2017

👍

3 similar comments
@HereWeAreFromFrance

This comment has been minimized.

Copy link

commented Feb 23, 2017

+1

@DanielKoehler

This comment has been minimized.

Copy link

commented Feb 28, 2017

+1

@morganchristiansson

This comment has been minimized.

Copy link

commented Mar 9, 2017

+1

@sielay

This comment has been minimized.

Copy link

commented Mar 9, 2017

+1 +10 +100 +1000 +10000

@mamghari

This comment has been minimized.

Copy link

commented Mar 22, 2017

Any news on it ?

@GabLeRoux

This comment has been minimized.

Copy link

commented Mar 22, 2017

See progress in #55 Someone just requested a merge on master.

@gabrielcsapo

This comment has been minimized.

Copy link

commented Mar 28, 2017

+1

7 similar comments
@kulkarnisu

This comment has been minimized.

Copy link

commented Apr 9, 2017

+1

@zephiyr

This comment has been minimized.

Copy link

commented Apr 11, 2017

+1

@vrommer

This comment has been minimized.

Copy link

commented Apr 18, 2017

+1

@nergal

This comment has been minimized.

Copy link

commented Apr 18, 2017

+1

@Tautvis

This comment has been minimized.

Copy link

commented Apr 21, 2017

+1

@ADobrodey

This comment has been minimized.

Copy link

commented Apr 21, 2017

+1

@KenLai

This comment has been minimized.

Copy link

commented Apr 22, 2017

+1

mbarrien added a commit that referenced this issue Apr 25, 2017

Merge pull request #55 from mbarrien/pipeline
JENKINS-30700 / #50 Jenkins pipeline support
@mbarrien

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2017

Fixed in version 1.10 which has been uploaded to the repo. Waiting until it shows up in update center before closing this issue.

@SuperBarracuda

This comment has been minimized.

Copy link

commented Apr 26, 2017

I can see that the plugin has now been published. Does anyone know the pipeline syntax for using it?

Other jenkins plugins support the pipeline syntax generator but I can't see cobertura listed under sample steps.

@lsglick

This comment has been minimized.

Copy link

commented Apr 26, 2017

@SuperBarracuda: If you select the step: General Build Step sample step, you'll see an option to Publish Cobertura Coverage Report.

I haven't used it yet, but seems like it is all there.

image

@reinout

This comment has been minimized.

Copy link

commented Apr 26, 2017

I have a line like this:

   step([$class: 'CoberturaPublisher', coberturaReportFile: 'coverage.xml'])

(My coverage output is in coverage.xml). Works like a charm again.

@SuperBarracuda

This comment has been minimized.

Copy link

commented Apr 26, 2017

@reinout @lsglick Thanks I have it working now. However the snippet doesn't seem to generate " Coverage Metric Targets" for lines. Do you know how this would be specified?

@rpocase

This comment has been minimized.

Copy link

commented Apr 26, 2017

@lsglick I'm not seeing Step: General Build Step in my snippet generator. Is there possibly another plugin I'm missing? Using the snippet that @reinout mentioned works, though.

@nuzz

This comment has been minimized.

Copy link

commented Apr 26, 2017

The default output from the snippet generator I get is:
step([$class: 'CoberturaPublisher',
autoUpdateHealth: false,
autoUpdateStability: false,
coberturaReportFile: 'coverage.xml',
failUnhealthy: false,
failUnstable: false,
maxNumberOfBuilds: 0,
onlyStable: false,
sourceEncoding: 'ASCII',
zoomCoverageChart: false])

@gena01

This comment has been minimized.

Copy link

commented Apr 27, 2017

Would it make sense to add @ Symbol("cobertura") or a different one so it's easier to use/find?

@akhy

This comment has been minimized.

Copy link

commented May 2, 2017

the "coverage metrics target" cannot be generated, need this to fail the build if the coverage is below certain threshold

@mbarrien

This comment has been minimized.

Copy link
Contributor

commented May 5, 2017

Released last week. Please file new issues for any bug found in the pipeline code.

@mbarrien mbarrien closed this May 5, 2017

@LizaKelly

This comment has been minimized.

Copy link

commented May 17, 2017

@anton-johansson

This comment has been minimized.

Copy link

commented Jul 12, 2017

I also cannot get the Coverage metrics target generated by the snippet generator. Anyone knows how to code my pipeline to include it?

@esmaras

This comment has been minimized.

Copy link

commented Oct 23, 2018

+1 for Coverage metrics target from pipeline step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.