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
Closed

Comments

@60secs
Copy link

60secs 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
Copy link

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

leth commented Feb 24, 2016

These are the areas I could use some advice on: https://github.com/leth/cobertura-plugin/commit/52a2ce9b2ec9dde01ff9054e1184c2e833e00a60

@ghost
Copy link

ghost commented Mar 14, 2016

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

@leth
Copy link

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

Keep us updated @leth

@s0undt3ch
Copy link

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

rudicba commented May 13, 2016

+1

3 similar comments
@karlhaas
Copy link

+1

@piccarsso
Copy link

+1

@ceelian
Copy link

ceelian commented May 18, 2016

+1

@nickbroon
Copy link

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

@haugthom
Copy link

haugthom commented Jun 8, 2016

+1

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

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

Any news?

@francisdb
Copy link

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

@nickbroon
Copy link

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

@francisdb
Copy link

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

@cernenwein
Copy link

+1

4 similar comments
@arpheno
Copy link

arpheno commented Jul 20, 2016

+1

@RockLobster
Copy link

+1

@samroyt
Copy link

samroyt commented Aug 15, 2016

+1

@rpocase
Copy link

rpocase commented Aug 19, 2016

+1

@nickbroon
Copy link

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

@zackpollard
Copy link

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

sxamit commented Nov 22, 2016

+1

@GabLeRoux
Copy link

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

y0n1 commented Feb 21, 2017

👍

3 similar comments
@HereWeAreFromFrance
Copy link

+1

@DanielKoehler
Copy link

+1

@morganchristiansson
Copy link

+1

@sielay
Copy link

sielay commented Mar 9, 2017

+1 +10 +100 +1000 +10000

@mamghari
Copy link

Any news on it ?

@GabLeRoux
Copy link

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

@gabrielcsapo
Copy link

+1

7 similar comments
@kulkarnisu
Copy link

+1

@zephiyr
Copy link

zephiyr commented Apr 11, 2017

+1

@vrommer
Copy link

vrommer commented Apr 18, 2017

+1

@nergal
Copy link

nergal commented Apr 18, 2017

+1

@Tautvis
Copy link

Tautvis commented Apr 21, 2017

+1

@ADobrodey
Copy link

+1

@KenLai
Copy link

KenLai commented Apr 22, 2017

+1

mbarrien added a commit that referenced this issue Apr 25, 2017
JENKINS-30700 / #50 Jenkins pipeline support
@mbarrien
Copy link
Contributor

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

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

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

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

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

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

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

gena01 commented Apr 27, 2017

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

@akhy
Copy link

akhy 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
Copy link
Contributor

mbarrien commented May 5, 2017

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

@mbarrien mbarrien closed this as completed May 5, 2017
@LizaKelly
Copy link

LizaKelly commented May 17, 2017

@anton-johansson
Copy link

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

@esmaras
Copy link

esmaras 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
Labels
None yet
Projects
None yet
Development

No branches or pull requests