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

No obvious way to launch editor against repo with no preexisting Jenkinsfile

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • Blue Ocean 1.3

      Summary:
      When moving through the Create Pipeline flow, it's possible for a user to specify a repo with no Jenkinsfile present. If the user happens to click out of this flow, or otherwise exit the editor before creating and committing a new Jenkinsfile, no branches will be shown, and there is thus no obvious way to get back to the editor.

      Prerequisites

      • A repository which does not already have a Jenkinsfile. In this case I was testing with a Bitbucket Server, but my guess is this problem is the same regardless of SCM

      Steps to recreate:
      1. Click "New Pipeline" to begin the process:

      2. Pick where you store your code, the location of the server (if applicable), and in this example, the Project it belongs to, since we're using a Bitbucket repo:

      3. Click "Create Pipeline." Usually, you'll very quickly see a message stating that there were no Jenkinsfiles found. I have occasionally seen the UI appear to hang at this step, but couldn't recreate that part while writing this up:

      4. Click the second "Create Pipeline" button which has now appeared at the bottom of the workflow:

      5. You'll be taken to the editor, as expected:

      6. Take any action that leaves the editor. In this case, I clicked on "Jenkins" up at the top left, to go to the top level BO page:

      7. Click on the project you just created, which in this case is the one called `wacky-branchnames-no-jenkinsfile`.

      8. Now you'll be taken into the project, and there's a pop up message stating "You don't have any branches that contain a Jenkinsfile." Which is true. But there's no obvious way to re-invoke the editor so that you can create one.

      9. As a workaround, it's possible to puzzle together a URL that lets you invoke the editor. The URL shown in my address bar at this point is:

      http://my-jenkins:8080/blue/organizations/jenkins/wacky-branchnames-no-jenkinsfile/activity
      

      You can edit that URL, to look like this:

      http://my-jenkins:8080/blue/organizations/jenkins/pipeline-editor/wacky-branchnames-no-jenkinsfile/master
      

      And get to the editor. This is problematic though, for a few reasons:

      • Users have to know that this is a thing they can do, and how to do it. It's mistake prone.
      • Since there aren't any branches on the screen, the user has to guess at the last element of that URL. If there's no master branch in my example above, the user gets an error message. Granted, master is a pretty safe guess, but isn't guaranteed.

      Entering it incorrectly results in the following:

      There was an error loading the pipeline from the Jenkinsfile in this repository. Correct the error by editing the Jenkinsfile using the declarative syntax then commit it back to the repository.

      branch: new-branch-nam not found

      This message is also misleading, because its first half implies that there's something wrong with "the Jenkinsfile." But there's no Jenkinsfile at all.

            kzantow Keith Zantow
            kshultz Karl Shultz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: