Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Jenkins show me the total number/percent of broken builds per month?

Tags:

jenkins

I have a Jenkins server that builds/tests about 50 projects. Unfortunately, some of these builds fail, but I don't have a good way to measure whether build failures are increasing or decreasing in frequency over time.

What I'd like is something along these lines:

  • A report that shows me, over the course of a month, how many jobs were unstable/failed
  • A report that says "X Days without a broken build" (kind of like at construction sites)
  • A "Red/Green calendar", that would show on a per-day basis whether any builds were broken

I didn't see any plugins that visualized data in any of these ways, but I'm willing to scrape the Jenkins logs to get the information. Is there a better way to see data similar to this?

like image 709
matthewsteele Avatar asked Dec 28 '22 10:12

matthewsteele


2 Answers

I think this work pretty decent using the API. You can get all jobs from your view, then go into the job details and get the build numbers and build date. With those build numbers you can get the corresponding status. You would have to do some coding to collect and display the data, but this would be a possible way.

Another possibility would be using a Groovy script over the console in Manage Jenkins. I do not have much experience working with that feature though, but as you have access to the internal representation it should be pretty easy to get some data out of there.

Finally, the optimal solution would be to write a plugin that does the work, but this is of course also the solution that requires the most effort and know-how.

like image 74
pushy Avatar answered Jan 13 '23 12:01

pushy


The Global Build Stats plugin might provide the reporting you're looking for.

(And if you already considered this plugin, I'm curious what problems you ran into.)

like image 35
Dave Bacher Avatar answered Jan 13 '23 10:01

Dave Bacher