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

Custom title for build steps

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi,

      Is it possible to add custom title for steps in Jenkinsfile. Theses titles would improve readability in build steps logs and blue ocean plugins.

      I was thinkings of something like this :

      node {
          stage('aStage'){
              checkout scm
      
              @Step(title='List files')
              sh 'ls -l'
      
              @Step(title='Do something')
              aStep 'do something'
          }
      }
      

      See images for visualisations

      Add titles to steps make it easy to understand what is done in each step in a team.

       

        Attachments

          Issue Links

            Activity

            Hide
            dindurthy Dharma Indurthy added a comment -

            Incidentally, I'm really struggling to find the docs for `sh` parameters. I'm sure I'm being dumb, but I can't find `label` documentation for sh outside of Jira issues and stackoverflow.

            Show
            dindurthy Dharma Indurthy added a comment - Incidentally, I'm really struggling to find the docs for `sh` parameters. I'm sure I'm being dumb, but I can't find `label` documentation for sh outside of Jira issues and stackoverflow.
            Hide
            dindurthy Dharma Indurthy added a comment -

            Re-opening in lieu of creating the same feature request. Label descriptions are much less desirable for us than custom titles.

            Show
            dindurthy Dharma Indurthy added a comment - Re-opening in lieu of creating the same feature request. Label descriptions are much less desirable for us than custom titles.
            Hide
            lucasocio Leandro Lucarella added a comment -

            That's not enough. Plug-in writers won't be able to know users needs.

            For example, I have a case where I use the `checkout` step to get code from more than one repo, I would like to be able to describe what each checkout is about.

            How could the plug-in writer know how this is best represented. Should they use the URL? The branch? Maybe some directory if the sparse checkout plug-in is used?

            It makes no sense to put this on the side of the plug-in writer. The user knows best. Also effort wise, for me is trivial to add some `@Step(title='Checkout main component')` while implementing all sort of heuristics to try to guess what the user wants for a plug-in writer would be madness.

            Please reopen. This Issue makes a lot of sense.

            Show
            lucasocio Leandro Lucarella added a comment - That's not enough. Plug-in writers won't be able to know users needs. For example, I have a case where I use the `checkout` step to get code from more than one repo, I would like to be able to describe what each checkout is about. How could the plug-in writer know how this is best represented. Should they use the URL? The branch? Maybe some directory if the sparse checkout plug-in is used? It makes no sense to put this on the side of the plug-in writer. The user knows best. Also effort wise, for me is trivial to add some `@Step(title='Checkout main component')` while implementing all sort of heuristics to try to guess what the user wants for a plug-in writer would be madness. Please reopen. This Issue makes a lot of sense.
            Hide
            jamesdumay James Dumay added a comment - - edited

            Sorin Sbarnea there is a way for individual steps to display their own description via the plugin API. I would suggest raising a ticket against the plugins which provide steps where the names don't fit your needs instead of reopening this one.

            Show
            jamesdumay James Dumay added a comment - - edited Sorin Sbarnea there is a way for individual steps to display their own description via the plugin API. I would suggest raising a ticket against the plugins which provide steps where the names don't fit your needs instead of reopening this one.
            Hide
            ssbarnea Sorin Sbarnea added a comment -

            Time to reopen it? Having it as closed prevents people from voting it.

            I find that really useful but I suggest a different implementation that does not add so much verbosity to pipeline scripts. Just add a "title" or "name" parameter to the the "step" class and that's all.

            Show
            ssbarnea Sorin Sbarnea added a comment - Time to reopen it? Having it as closed prevents people from voting it. I find that really useful but I suggest a different implementation that does not add so much verbosity to pipeline scripts. Just add a "title" or "name" parameter to the the "step" class and that's all.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              zeenlym Yanis LISIMA
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: