Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29892

Block of stages functioning as a concurrency unit

    Details

    • Similar Issues:

      Description

      Sometimes it is desirable to mark several stage boundaries in a build even though from the perspective of the concurrency semantics they are logically a single stage. This would require a new option to the stage step. Thus

      stage 'build'
      ...
      stage name: 'deploy', concurrency: 1
      ...
      stage name: 'test', labelOnly: true
      ...
      

      would behave exactly like

      stage 'build'
      ...
      stage name: 'deployAndTest', concurrency: 1
      ...
      

      other than the labeling via StageAction. In other words, with labelOnly set, the execution would run this part but then return true to avoid interaction with the concurrency system.

      Alternately there could be a block-scoped variant of the step

      stageBlock('build') {
        ...
      }
      stageBlock(name: 'deployAndTest', concurrency: 1) {
        stageBlock('deploy') {
          ...
        }
        stageBlock('test') {
          ...
        }
      }
      

      where concurrency would have the same meaning as in stage except that "entering" and "exiting" would refer to the block scope rather than a standalone step. This would overlap somewhat with JENKINS-26107 and might be a good stepping stone to a parallel-aware stage that blocks only within the given branch of various builds. The downside is that blocks must nest, which could be a problem if you wanted finer control over node allocation and so on.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-26107 [ JENKINS-26107 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-27039 [ JENKINS-27039 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-30269 [ JENKINS-30269 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 164970 ] JNJira + In-Review [ 181766 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]
            jglick Jesse Glick made changes -
            Component/s pipeline-stage-step-plugin [ 21709 ]
            Component/s pipeline [ 21692 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Won't Do [ 10001 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                4 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: