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

            jamesdumay James Dumay added a comment -

            zeenlym we are going to automatically generate more meaningful descriptions for the steps in the Blue Ocean UI as part of JENKINS-37324. I think this might solve the problem you are having. If not, please reopen this ticket.

            jamesdumay James Dumay added a comment - zeenlym we are going to automatically generate more meaningful descriptions for the steps in the Blue Ocean UI as part of JENKINS-37324 . I think this might solve the problem you are having. If not, please reopen this ticket.
            zeenlym Yanis LISIMA added a comment - - edited

            The solution for JENKINS-37324-- is to show description based on parameter.

            But i would like to let developer give a human readable description of what they're doing in steps if needed

            Also i was thinking about using annotation in order to give this behaviour to all steps without necessary development.

            If it is complicated issue --JENKINS-37324 is enough for now.

            zeenlym Yanis LISIMA added a comment - - edited The solution for JENKINS-37324 -- is to show description based on parameter. But i would like to let developer give a human readable description of what they're doing in steps if needed Also i was thinking about using annotation in order to give this behaviour to all steps without necessary development. If it is complicated issue -- JENKINS-37324 is enough for now.
            jamesdumay James Dumay added a comment -

            zeenlym I'd prefer to see if JENKINS-37324 resolves most peoples problems before we allow this level of customisability for individual steps. I can see how this could be useful but I think the demands on the syntax make it somewhat of a advanced feature.

            I will re-evaluate this when we've had JENKINS-37324 out in a release for a few months.

            jamesdumay James Dumay added a comment - zeenlym I'd prefer to see if JENKINS-37324 resolves most peoples problems before we allow this level of customisability for individual steps. I can see how this could be useful but I think the demands on the syntax make it somewhat of a advanced feature. I will re-evaluate this when we've had JENKINS-37324 out in a release for a few months.
            zeenlym Yanis LISIMA added a comment -

            I am ok with that.

            See you

            zeenlym Yanis LISIMA added a comment - I am ok with that. See you
            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.
            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.

            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.

            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.

            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.

            People

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

              Dates

                Created:
                Updated: