Workflow Plugin questions

616 views
Skip to first unread message

Jo Shields

unread,
Dec 16, 2014, 5:15:31 AM12/16/14
to jenkins...@googlegroups.com
Hi,

We're looking to use Jenkins w/ workflow to replace our in-house CI
system. However, there's a bunch of stuff that doesn't seem to be
present in the addin (some of it might be missing features, some might
be plugin compatibility, some might be me not seeing something in the
documentation)

1) How can I change the title of a step in the "Running Steps" page?
"Shell Script" three dozen times is not useful. I'd like to be able to
change this header.

2) How can I time out the build on inactivity? Sometimes our test
suite can get stuck - we use build-timeout to kill unresponsive processes

3) How can I add annotation to "Running Steps"? For example, that
screen would be much more useful if a test suite step could explicitly
list the failed tests right from that page, rather than needing to
click through to the logs (or use another plugin like
build-failure-analyzer)

Thanks.

James Nord

unread,
Dec 16, 2014, 5:50:29 AM12/16/14
to jenkins...@googlegroups.com

On 16/12/2014 10:15, Jo Shields wrote:
Hi,

We're looking to use Jenkins w/ workflow to replace our in-house CI
system. However, there's a bunch of stuff that doesn't seem to be
present in the addin (some of it might be missing features, some might
be plugin compatibility, some might be me not seeing something in the
documentation)

if something is missing and you find a way to do it - pull requests with updated documentation would be welcomed.


1) How can I change the title of a step in the "Running Steps" page?
"Shell Script" three dozen times is not useful. I'd like to be able to
change this header.

Its not possible as far as I am aware - and it was something I mentioned a few months ago.

However - in my previous usage of this - it didn't really matter about the 50 shell scripts - as they where grouped logically into several areas
(build it, test it, deploy it to clean test system, test test system, deploy it to another test system (with live data), test it, deploy it to live...)
So all we cared about at the top level was which part of the thing failed (building, testing or deploying...) - and then when something failed - it doesn't matter its called "shell script" as its failed and you are interested in the logs!
This grouping can be acheived with the 'stage' step.

Cloudbees announced a really great visualization for this (non free) but the basis is there in the open source version for you to write your own visualization.  https://www.cloudbees.com/products/jenkins-enterprise/plugins/workflow-stage-view-plugin



2) How can I time out the build on inactivity? Sometimes our test
suite can get stuck - we use build-timeout to kill unresponsive processes

look at the timeout step.

I believe (not used it) that this is implemented with something like

timeout('180s') {
    sh 'thisMayHang.sh'
}


3) How can I add annotation to "Running Steps"? For example, that
screen would be much more useful if a test suite step could explicitly
list the failed tests right from that page, rather than needing to
click through to the logs (or use another plugin like
build-failure-analyzer)

if your test suite can output junit style reports (or cucumber/gherkin maybe coming soon) then you just need to call the plugin to parse these and they will be displayed in the main page as a trend etc just like with normal jobs.


Jo Shields

unread,
Dec 17, 2014, 7:51:39 AM12/17/14
to jenkins...@googlegroups.com
On Tue, Dec 16, 2014 at 10:50 AM, James Nord <te...@teilo.net> wrote:
Its not possible as far as I am aware - and it was something I mentioned a few months ago.

However - in my previous usage of this - it didn't really matter about the 50 shell scripts - as they where grouped logically into several areas
(build it, test it, deploy it to clean test system, test test system, deploy it to another test system (with live data), test it, deploy it to live...)
So all we cared about at the top level was which part of the thing failed (building, testing or deploying...) - and then when something failed - it doesn't matter its called "shell script" as its failed and you are interested in the logs!
This grouping can be acheived with the 'stage' step.

The more hoops my developers need to jump through, especially as compared to our existing in-house CI system, the more pushback I get from them about migrating away from the in-house system to Jenkins. Not being able to see at a glance which step has failed because they don't have meaningful naming isn't useful or helpful. Especially in a long list of steps. I could give every step a named stage, but then I just have output which is twice as verbose as it needs to be. The Groovy DSL already supports multiple properties in a step, why not allow either a 'merge the logging of this step into the parent stage's output' property, or a 'override the name for this step' property? Does that seem insane?
 
Cloudbees announced a really great visualization for this (non free) but the basis is there in the open source version for you to write your own visualization.  https://www.cloudbees.com/products/jenkins-enterprise/plugins/workflow-stage-view-plugin


This might be exactly what I'm after - but there doesn't seem to be any screenshot, or online demo, of the plugin.
 
2) How can I time out the build on inactivity? Sometimes our test
suite can get stuck - we use build-timeout to kill unresponsive processes

look at the timeout step.

I believe (not used it) that this is implemented with something like

timeout('180s') {
    sh 'thisMayHang.sh'
}

This appears to be for purely killing the process after X period of time.

The Build-timeout plugin supports multiple strategies for timeouts, which are better suited to variable-length stuff (like test suites, whose performance isn't guaranteed on a shared VM host): https://github.com/jenkinsci/build-timeout-plugin/tree/master/src/main/java/hudson/plugins/build_timeout/impl 

3) How can I add annotation to "Running Steps"? For example, that
screen would be much more useful if a test suite step could explicitly
list the failed tests right from that page, rather than needing to
click through to the logs (or use another plugin like
build-failure-analyzer)

if your test suite can output junit style reports (or cucumber/gherkin maybe coming soon) then you just need to call the plugin to parse these and they will be displayed in the main page as a trend etc just like with normal jobs.

It's just an example, and again, it's about getting the information density to a point where it's useful. We also use our "summary" field for  reporting on various attributes of the current build environment (such as the versions and license status of installed components), or which decision was made for a step where multiple behaviours are valid (e.g. whether or not an older version of something was overwritten when uploading a version-numbered file). Sure, it could just be in stdout for the logs for the step. But, again, it's about getting information density to a point where it's useful.

Jo Shields

unread,
Dec 19, 2014, 10:17:45 AM12/19/14
to jenkins...@googlegroups.com


On Tuesday, 16 December 2014 10:15:31 UTC, Jo Shields wrote:
Hi,

We're looking to use Jenkins w/ workflow to replace our in-house CI
system. However, there's a bunch of stuff that doesn't seem to be
present in the addin (some of it might be missing features, some might
be plugin compatibility, some might be me not seeing something in the
documentation)

1) How can I change the title of a step in the "Running Steps" page?
"Shell Script" three dozen times is not useful. I'd like to be able to
change this header.

I've been looking at implementing this, though I find myself a bit confused by the code (though I am VERY rusty when it comes to Java - they didn't change anything in the language syntax since 2001, right?)

The name of the step comes from DescriptorImpl.getDisplayName() - but this method is static, so I can't just have a per-instance name property (with default as it is now).

However, the "stage" step is re-nameable. Yet I don't see how this is done, in StageStep.java - what am I missing?

Jesse Glick

unread,
Jan 7, 2015, 7:06:25 PM1/7/15
to jenkins...@googlegroups.com
On Tuesday, December 16, 2014 5:15:31 AM UTC-5, Jo Shields wrote:
How can I change the title of a step in the "Running Steps" page?
"Shell Script" three dozen times is not useful. I'd like to be able to
change this header.

Reply all
Reply to author
Forward
0 new messages