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

We would like a more meaningful description of a step

    • frank, tethys, christmas, pannonian, iapetus, 1.0, Blue Ocean 1.0-rc3, Blue Ocean 1.0-rc4, Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2, Blue Ocean 1.1-beta4, Blue Ocean 1.1, Blue Ocean 1.1

      Note: This has been implemented, but what is missing is some UI work to follow the design/limit wrapping on narrow screens (backend and pipeline components are completed, including api usage). 

       

      Scope

      • Pipeline API exposes step descriptions
      • Descriptions for steps reflected from the pipeline API
      • Update the UI of Blue Ocean to display the steps

      Design

      • Has Description
        • Description on left, black @ 100% opacity
          **Type to the right, with em dash, black @ 50% opacity (or grey color)
      • Has no Description
        • Type on left, black @ 100% opacity
      • Use Zeplin for extact metrics https://zpl.io/1MtiWN

      Mockup

      Notes
      We want to provide the developer a more meaningful description of the steps in Blue Ocean.

      For example, if we have a shell script being executed we'd like to provide the command as the description of that step. If we don't have that information, we'd like to fall back to a description of the step otherwise fall back to the step name.

        1.  #2 2017-06-05 10-50-45.png
          #2 2017-06-05 10-50-45.png
          87 kB
        2. changes.png
          changes.png
          52 kB
        3. mockup.png
          mockup.png
          71 kB

          [JENKINS-37324] We would like a more meaningful description of a step

          Vicky Chijwani added a comment - - edited

          thclpr - I was thinking maybe we could add label support for other common steps as well. That's why I named the plugin labelled-steps instead of labelled-shell-step

          I don't know if it's going to be feasible / easy to support other steps, but it's worth a shot (sh step was thankfully trivial to modify). Hopefully at some point Jenkins core will support custom labels for any step.

          Vicky Chijwani added a comment - - edited thclpr - I was thinking maybe we could add label support for other common steps as well. That's why I named the plugin labelled-steps instead of labelled-shell-step I don't know if it's going to be feasible / easy to support other steps, but it's worth a shot (sh step was thankfully trivial to modify). Hopefully at some point Jenkins core will support custom labels for any step.

          Jesse Glick added a comment -

          This is Pipeline, not Jenkins core BTW.

          I still advocate maintaining a separation of duties, so that stage is used for adding a human-readable label to a step or sequence of steps. If Blue Ocean fails to display nested stages well, then improve Blue Ocean.

          Jesse Glick added a comment - This is Pipeline, not Jenkins core BTW. I still advocate maintaining a separation of duties, so that stage is used for adding a human-readable label to a step or sequence of steps. If Blue Ocean fails to display nested stages well, then improve Blue Ocean.

          jglick - you're right. I loosely said "Jenkins core" as a way to say "officially supported by CloudBees". If nested stages can support the use-case of labelling a group of steps (especially shell steps) without creating a new node in the pipeline visualization, that would also perfectly solve the issue.

          Come to think of it, there's a very similar proposal at JENKINS-44094, about grouping a set of steps with a custom label. That would solve multiple problems.

          Vicky Chijwani added a comment - jglick - you're right. I loosely said "Jenkins core" as a way to say "officially supported by CloudBees". If nested stages can support the use-case of labelling a group of steps (especially shell steps) without creating a new node in the pipeline visualization, that would also perfectly solve the issue. Come to think of it, there's a very similar proposal at JENKINS-44094 , about grouping a set of steps with a custom label. That would solve multiple problems.

          Still not sure that wrapping each and every "sh" step into a stage block is a good idea for providing a description for sh step.

          There should be a possibility to label sh step (and probably other steps) and it was mentioned here

          I had a plan to enhance "sh" step API and add "label" parameter (as discussed with svanoort). Just need to find time for that.

          Veaceslav Gaidarji added a comment - Still not sure that wrapping each and every "sh" step into a stage block is a good idea for providing a description for sh step. There should be a possibility to label sh step (and probably other steps) and it was mentioned here .  I had a plan to enhance "sh" step API and add "label" parameter (as discussed with svanoort ). Just need to find time for that.

          Dana Goyette added a comment - - edited

          As it is now, the sh script is quite unreliable about ever saying anything more than just "Shell Script". 
          Shouldn't single-line commands show the command being executed? For me, they almost never do.

          These steps show the command:
          sh(script: "/usr/bin/env python ./install_manager.py --jenkins --uninstall-all")
          sh(script: "/usr/bin/env python ./install_manager.py --jenkins --fail-if-leftovers --uninstall-all")

          These steps show just "Shell Script", rendering the summary useless:
          sh(script: "/usr/bin/env python ./install_manager.py --jenkins --build-id 123456 --install")
          sh(script: "/usr/bin/env python ./install_manager.py --jenkins --build-id 123456 --uninstall")
          Adding or removing the /usr/bin/env didn't change anything, either.

          Note that my actual script is actually calling sh with a Map as a parameter, rather than passing named parameters.
          If I use the labelledShell step, even that description sometimes gets ignored.

           

          Dana Goyette added a comment - - edited As it is now, the sh script is quite unreliable about ever saying anything more than just "Shell Script".  Shouldn't single-line commands show the command being executed? For me, they almost never do. These steps show the command: sh(script: "/usr/bin/env python ./install_manager.py --jenkins --uninstall-all") sh(script: "/usr/bin/env python ./install_manager.py --jenkins --fail-if-leftovers --uninstall-all") These steps show just "Shell Script", rendering the summary useless: sh(script: "/usr/bin/env python ./install_manager.py --jenkins --build-id 123456 --install") sh(script: "/usr/bin/env python ./install_manager.py --jenkins --build-id 123456 --uninstall") Adding or removing the /usr/bin/env didn't change anything, either. Note that my actual script is actually calling sh with a Map as a parameter, rather than passing named parameters. If I use the labelledShell step, even that description sometimes gets ignored.  

          Phil McArdle added a comment -

          danagoyette, I haven't tested this in a while, but I believe your issue there is using variables like the build id, assuming you used the actual number of the current build. In my experience, Jenkins goes to lengths to identify and mask data like that.

          Phil McArdle added a comment - danagoyette , I haven't tested this in a while, but I believe your issue there is using variables like the build id, assuming you used the actual number of the current build. In my experience, Jenkins goes to lengths to identify and mask data like that.

          Dana Goyette added a comment -

          Thanks for the hint about the issue being variables. That seems to be it: if I use any variables (in the stock sh step's command or the labelledShell step's label), then the label is just silently ignored! Should I file a separate ticket for that brokenness?

          Dana Goyette added a comment - Thanks for the hint about the issue being variables. That seems to be it: if I use any variables (in the stock sh step's command or the labelledShell step's label), then the label is just silently ignored! Should I file a separate ticket for that brokenness?

          Phil McArdle added a comment -

          If you wanted something like that changed, that'd be a separate issue, yep

          I think that's running at a much lower level than the step labelling.

          Phil McArdle added a comment - If you wanted something like that changed, that'd be a separate issue, yep I think that's running at a much lower level than the step labelling.

          Jesse Glick added a comment -

          if I use any variables (in the stock sh step's command or the labelledShell step's label), then the label is just silently ignored

          See JENKINS-47101.

          Jesse Glick added a comment - if I use any variables (in the stock sh step's command or the labelledShell step's label), then the label is just silently ignored See JENKINS-47101 .

          boris avney added a comment -

          Hi,

          Where can I find which BO version has this functionality?
          (couldn't find the PR in change log: https://wiki.jenkins.io/display/JENKINS/Blue+Ocean+Plugin)

           

          boris avney added a comment - Hi, Where can I find which BO version has this functionality? (couldn't find the PR in change log:  https://wiki.jenkins.io/display/JENKINS/Blue+Ocean+Plugin)  

            cliffmeyers Cliff Meyers
            jamesdumay James Dumay
            Votes:
            24 Vote for this issue
            Watchers:
            52 Start watching this issue

              Created:
              Updated:
              Resolved: