• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • blueocean-plugin
    • None

      It is a common practice to batch changes in a pipeline via milestone/lock [1]. That way, resources are more efficiently used since there is only one instance of each stage running at a time. In practice, the milestone step aborts any instance of a pipeline if another pipeline instance, with new commits on it, reaches the milestone point.

      Currently, blue-ocean shows the steps that run on the pipeline in green, then the ones that didn't run on that instance (since a newer one hit the milestone) are rendered as grey. Users that need to track where in the pipeline their change is need to close their pipeline instance page, then manually look for the first non-aborted pipeline instance after.

      Ideally, Jenkins should provide a better way to track where the change is. Maybe show the pipeline stages that are running on a different instance (due to a milestone) in grey, but as running? Some other way?

      [1] https://jenkins.io/blog/2016/10/16/stage-lock-milestone/

      Technical notes
      CancelledCause contains the data needed to find out what run replaced one that was canceled. CancelledCause is set on the Runs InterruptedBuildAction.

      This pull request should allow the CancelledCause to serialize all the data we need to do the work here.

      Design notes
      The run that does succeed should roll up all the changesets of the aborted runs that came before it since the last non-aborted run. Perhaps we should be doing this for whole series of successful runs?

        1. activity.png
          activity.png
          107 kB
        2. batch_pipeline.jpg
          batch_pipeline.jpg
          35 kB
        3. Blue_Ocean_2.png
          Blue_Ocean_2.png
          12 kB
        4. Blue-Ocean_1.png
          Blue-Ocean_1.png
          25 kB
        5. Blue-Ocean_1.png
          Blue-Ocean_1.png
          49 kB
        6. run.png
          run.png
          58 kB

          [JENKINS-40871] UI support for milestone and lock

          James Dumay added a comment -

          Thanks for this improvement suggestion adelcast and certainly we should be making the experience here a bit cleaner for users of milestone and lock. I think we will need some more time to dive into this problem and Ill expect we will return to this after the Blue Ocean 1.0 at the end of March.

          James Dumay added a comment - Thanks for this improvement suggestion adelcast and certainly we should be making the experience here a bit cleaner for users of milestone and lock . I think we will need some more time to dive into this problem and Ill expect we will return to this after the Blue Ocean 1.0 at the end of March.

          James Dumay added a comment - - edited

          adelcast do you ever want to see the Pipelines that were aborted because of milestone/lock when you view the run history? Should we be hiding them?

          What if we had a message on the run screen that told you that it had been replaced and allowed you to click through?

          James Dumay added a comment - - edited adelcast do you ever want to see the Pipelines that were aborted because of milestone/lock when you view the run history? Should we be hiding them? What if we had a message on the run screen that told you that it had been replaced and allowed you to click through?

          I think there is value in keeping the pipelines that were aborted. From a user's point of view, his submission creates a pipeline instance and that's all he cares. The tricky part is how to convey visually that a pipeline was aborted/replaced by another one. A link (like the one you proposed) works, but maybe it's possible to show that information on the pipeline visual itself instead of a link. Maybe we can show the running stages on the pipeline view of the aborted pipeline with a different color? Not sure if that "fits" with blue ocean paradigms....just a suggestion to consider since I am not a UX person.

          Thanks for taking the time to look at this issue!

          Alejandro del Castillo added a comment - I think there is value in keeping the pipelines that were aborted. From a user's point of view, his submission creates a pipeline instance and that's all he cares. The tricky part is how to convey visually that a pipeline was aborted/replaced by another one. A link (like the one you proposed) works, but maybe it's possible to show that information on the pipeline visual itself instead of a link. Maybe we can show the running stages on the pipeline view of the aborted pipeline with a different color? Not sure if that "fits" with blue ocean paradigms....just a suggestion to consider since I am not a UX person. Thanks for taking the time to look at this issue!

          James Dumay added a comment -

          Thanks adelcast this certainly gives us more to work with. Thanks for being quick to reply!

          James Dumay added a comment - Thanks adelcast this certainly gives us more to work with. Thanks for being quick to reply!

          At Jenkins World, amuniz, kzantow and me discussed this issue for a little while. Sounds like a "collapse" button could provide an effective way to collapse pipelines that were superseeded by others. To exemplify what I mean, in a pipeline that has 3 stages, such as:

           

          lock(resource: "L1", inversePrecedence: true) {
              milestone label: "L1"

              stage("L1") {
                  node() {
                     echo "Stage 1"
                     sleep 1
                  }
              }
          }

          lock(resource: "L2", inversePrecedence: true) {
              milestone label: "L2"

              stage("L2") {
                  node() {
                      echo "Stage 2"
                     sleep 5
                 }
              }
          }

          lock(resource: "L3", inversePrecedence: true) {
              milestone label: "L3"

              stage("L3") {
                  node() {
                      echo "Stage 3"
                      sleep 10
                  }
              }
          }

           

           

          If you run several builds, one after the other (for example, just waiting for a second between builds), you end up with something like this:

           

          really there are only 2 pipeline instances (I define an instance as a pipeline that may have superseeded N other pipelines), but the UI shows 5. This problem is aggravated if you have a bunch of stages. If there is a way to collapse the pipelines, I could just email the link to the collapsed pipeline to my developers, then have them watch only that one link as their change progresses through the pipeline (even if their pipeline is superseeded)

           

          From the Jenkins World discussion, sounded like it was not a whole lot of effort to implement the ticket since all the superseed information is already available. 

           

          Alejandro del Castillo added a comment - At Jenkins World, amuniz , kzantow and me discussed this issue for a little while. Sounds like a "collapse" button could provide an effective way to collapse pipelines that were superseeded by others. To exemplify what I mean, in a pipeline that has 3 stages, such as:   lock(resource: "L1", inversePrecedence: true) {     milestone label: "L1"     stage("L1") {         node() {            echo "Stage 1"            sleep 1         }     } } lock(resource: "L2", inversePrecedence: true) {     milestone label: "L2"     stage("L2") {         node() {             echo "Stage 2"            sleep 5        }     } } lock(resource: "L3", inversePrecedence: true) {     milestone label: "L3"     stage("L3") {         node() {             echo "Stage 3"             sleep 10         }     } }     If you run several builds, one after the other (for example, just waiting for a second between builds), you end up with something like this:   really there are only 2 pipeline instances (I define an instance as a pipeline that may have superseeded N other pipelines), but the UI shows 5. This problem is aggravated if you have a bunch of stages. If there is a way to collapse the pipelines, I could just email the link to the collapsed pipeline to my developers, then have them watch only that one link as their change progresses through the pipeline (even if their pipeline is superseeded)   From the Jenkins World discussion, sounded like it was not a whole lot of effort to implement the ticket since all the superseed information is already available.   

          jamesdumay, there is an open PR [1], which seems to be needed to continue work on this issue. Any chance we can get that PR in? anything I can do on my side to help?

          I am no UI expert, but with some guidance I could take a stab at getting this fix, as this is something that is hindering our ability to use Jenkins BO as the main UI for project managers, developers, etc.

           

          [1] https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/7

          Alejandro del Castillo added a comment - jamesdumay , there is an open PR [1] , which seems to be needed to continue work on this issue. Any chance we can get that PR in? anything I can do on my side to help? I am no UI expert, but with some guidance I could take a stab at getting this fix, as this is something that is hindering our ability to use Jenkins BO as the main UI for project managers, developers, etc.   [1]   https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/7

          I ended up re-submitting the reference PR, which just got merged [1], which means that the work on this feature request should be unblocked.

           

          [1] https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/15

          Alejandro del Castillo added a comment - I ended up re-submitting the reference PR, which just got merged [1] , which means that the work on this feature request should be unblocked.   [1]   https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/15

          I think the Blue Ocean UI support for visualizing active/locked/waiting locks does not work (anymore?): see https://issues.jenkins-ci.org/browse/JENKINS-44274?focusedCommentId=339196&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-339196

          Reinhold Füreder added a comment - I think the Blue Ocean UI support for visualizing active/locked/waiting locks does not work (anymore?): see https://issues.jenkins-ci.org/browse/JENKINS-44274?focusedCommentId=339196&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-339196

            Unassigned Unassigned
            adelcast Alejandro del Castillo
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: