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

Custom title for build steps

    XMLWordPrintable

Details

    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

            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.

            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.

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

            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.

            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.

            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.
            jamesdumay James Dumay added a comment - - edited

            ssbarnea 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.

            jamesdumay James Dumay added a comment - - edited ssbarnea 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.
            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.

            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

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

              Dates

                Created:
                Updated: