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

Adding a parallel branch with no name results in a slightly bad Jenkinsfile

    Details

    • Similar Issues:
    • Sprint:
      Blue Ocean 1.0-rc3

      Description

      If you add a parallel branch of execution in the editor, add some steps, and save - it will save correctly, however it isn't a very good Jenkinsfile. 

       

      Loading it up once it has completed a run will result in an error to visualise. The Jenkinsfile will end up looking like: 

       

      Note that the branch name is empty string - this seems to upset declarative. I am not sure it executes that branch. 

      stage('Static Analysis') {
      steps {
      parallel(
      "Static Analysis": {
      sh 'mvn findbugs:findbugs'
      },
      "": {
      echo 'rewrewqrewq'
      }
      )
      }
      }
      }

      In any case, a branch should be required to be named, so I think this should be a validation error right? OR the editor should name that branch it creates. 

       

      To reproduce: take an existing stage with at least one step, add a parallel branch, add steps to it (but do not name it) 

        Attachments

          Issue Links

            Activity

            Hide
            michaelneale Michael Neale added a comment -

            Related to a visualisation issue, but ideally with the editor they shouldn't get in this state. 

            Show
            michaelneale Michael Neale added a comment - Related to a visualisation issue, but ideally with the editor they shouldn't get in this state. 
            Hide
            kzantow Keith Zantow added a comment -

            Yes, we should add a validation error for this at the service layer WDYT Andrew Bayer ?

            Show
            kzantow Keith Zantow added a comment - Yes, we should add a validation error for this at the service layer WDYT Andrew Bayer ?
            Hide
            kzantow Keith Zantow added a comment -

            Further research, declarative is seemingly fine with a branch with no name, there's a bug in the visualization that's throwing an error if the name is empty.

            Show
            kzantow Keith Zantow added a comment - Further research, declarative is seemingly fine with a branch with no name, there's a bug in the visualization that's throwing an error if the name is empty.
            Hide
            kzantow Keith Zantow added a comment -

            Michael Neale since this can be fixed and isn't actually a problem with the editor or declarative, should we close this or add something to require a name?

            Show
            kzantow Keith Zantow added a comment - Michael Neale since this can be fixed and isn't actually a problem with the editor or declarative, should we close this or add something to require a name?
            Hide
            kzantow Keith Zantow added a comment -

            Michael Neale please reopen this if you think we should do it, I think it would be best to just add to declarative validation instead of doing something custom with the editor, though,

            Show
            kzantow Keith Zantow added a comment - Michael Neale please reopen this if you think we should do it, I think it would be best to just add to declarative validation instead of doing something custom with the editor, though,

              People

              • Assignee:
                kzantow Keith Zantow
                Reporter:
                michaelneale Michael Neale
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: