Jesse Glick commented on New Feature JENKINS-27039

I am wondering if I am focusing wrongly on input, when there can be other steps that wait for external agents to allow the build to proceed. (waitForCond, for example, lets you do this generally.) Arguably this feature really belongs in stage itself. For example:

stage name: 'DevBuild'/* optionally add: concurrency: 1 */
echo "doing dev build"
stage name: 'Waiting to integrate', concurrency: 1, eager: true
input message: 'Proceed?'
stage name: 'Integration', concurrency: 1
echo "doing integration"

Here the eager on the second stage would change the handling of concurrency somewhat. Normally when the stage is at full capacity, a new build coming in will wait to enter it (possibly canceling a somewhat older build already waiting to enter it). With this proposed option, stage would always allow the new build to proceed immediately, but the oldest build running in the stage would be interrupted (meaning any running input would stop waiting, any running sh would be asked to stop, and so on). That would effectively implement my “second behavior” for input (the one you seem to want), but in a more generic way.

I think something like the “third behavior” is also possible with a modified stage semantics (not using concurrency): instead of interrupting older builds upon entering the stage, they would be interrupted upon leaving it. In other words, builds could move through the stage in linear order, but if an older build fails to make it through the stage before a newer build has left it, it would be canceled:

stage name: 'DevBuild'/* optionally add: concurrency: 1 */
echo "doing dev build"
stage name: 'Waiting to integrate', linear: true
input message: 'Proceed?'
stage name: 'Integration', concurrency: 1
echo "doing integration"

I can imagine this could be useful in various scenarios, not just with input.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to