build-monitor-plugin icon indicating copy to clipboard operation
build-monitor-plugin copied to clipboard

Choose your own colors for statusses

Open NathanvanDalen opened this issue 6 years ago • 3 comments

As per commit 59483d2b both unknown and aborted should have the same color (which they obviously don't based on the HTML colorcodes), but the reasoning behind this doesn't really get to me. If I abort a build that may be perfectly legitimate. If i for instance have specified the wrong parameters I do not want it to show up grey in my monitor but I want it to stay as it was until I fire another build. Or I want to set it to yellow because somthing is wrong but as it is aborted the reason and state are not unknown.

Also coworkers of me asked if a specific state of the pipeline could be marked pink for instance. This was obviously a joke but it got me thinking, as this is all styling, might it be possible to create statusses and assign different colors to them so we could actually have the colors mean different things?

So for instance if my unittests fail then I could mark the build unstable and if Sonar finds bugs then I could mark the build as a no go (failure) and make it purple or some other arbitrary color I set up within the view properties.

The idea being that, next to all the parameters in the view editor, you have a table with the 5 statusses and 5 textboxes to fill in the HTML colorcode

Or even better is a env variable so you can set the colors from within a jenkinsfile.

NathanvanDalen avatar Jan 05 '18 16:01 NathanvanDalen

@NathanvanDalen this is unrelated to the request but I thought I'd share with you what I do.

I personally like to keep the 3 standard colors Green,Yellow,Red for Success,Unstable,Failure as they map directly to the jenkins standard (well if you ignore the Blue color!)

When I want to visually add extra information on my build, I use badges and I set a different background color to represent different statuses.

e.g.: I add a badge to display if the code coverage is satisfactory with a green background or with a yellow background when it is not.

in pipeline I do the following (requires the groovy postbuild plugin):

manager.addShortText(coverageText, "black", "limegreen", "0px", "white")

OR

manager.addShortText(coverageText, "black", "repeating-linear-gradient(45deg, yellow, yellow 10px, Orange 10px, Orange 20px)", "0px", "white")

So you can have a green job because all tests pass but a yellow badge because some extra checks fail. You can even add a pink one ;-)

image

I hope you find this useful.

dcendents avatar Jan 05 '18 17:01 dcendents

Thank you. It does help a lot indeed. To bad the build result has a preference which means you can not reset buildstatus per stage and you have to mannually create something to get a hold of your stages failing or not.

NathanvanDalen avatar Jan 15 '18 10:01 NathanvanDalen

I also wish if the colors can be customized by users

syeds-git avatar Apr 21 '22 16:04 syeds-git