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

Jenkins Declarative Pipeline does not Support tags or filtering + other errors

XMLWordPrintable

      When testing out the pipeline/blueocean setup, it appears that it is very geared towards branches in git, rather than tags.  Most git processes I know of, such as git flow, utilise tags for version numbering.

      I'm using the blueocean docker to do the evaluation.

      There are a couple of issues I have seen that I don't see any documentation to address:

      Branches only

      Blueocean is geared towards branches instead of tags. I'm not sure what the workflow/process this was based on is, I couldn't really find out from the documentation. Git flow uses tags to build out releases, but does use branches for features, so it would only half work with blueocean. I would prefer it if tags were supported.

      Build filtering

      There is no way that I have found to use the declarative pipeline and only execute a build when a new tag is pushed.  Contrasted with gitlab-ci, where you can easily filter out to only build on tags. In fact, with the declarative pipeline, there doesn't appear to be any way to skip builds based on any set criteria

      No tags in General SCM stage by default

      For some reason, tags are stripped out of the SCM build step. Most CI tools I have used/tested do a full clone of the git repo down. I also make the assumption when writing build scripts that I will be in an environment as close as just being within the git repo itself. As this is not the case, I have to worry about 2 environments instead of one.

      While I support having tags stripped out for users that don't want it, I don't believe this is a sensible default.

      Pipeline editing broken in blueocean

      Probably an existing ticket, but you can't edit pipelines in blueocean, just adding a default style git repo, you get a nice error:

      Error loading Pipeline
      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.
       
      Cannot read property 'indexOf' of undefined
      

      Which is caused by an error on the url: http://blueocean:8080/blue/rest/organizations/jenkins/pipelines/myrepo/scm/content?path=Jenkinsfile&branch=master

      java.lang.NullPointerException
      	at io.jenkins.blueocean.commons.stapler.Export.writeOne(Export.java:147)
      	at io.jenkins.blueocean.commons.stapler.Export.serveExposedBean(Export.java:139)
      	at io.jenkins.blueocean.commons.stapler.Export.doJson(Export.java:79)
      	at io.jenkins.blueocean.commons.stapler.TreeResponse$Processor$1.generateResponse(TreeResponse.java:48)
      	at org.kohsuke.stapler.HttpResponseRenderer$Default.handleHttpResponse(HttpResponseRenderer.java:124)
      	at org.kohsuke.stapler.HttpResponseRenderer$Default.generateResponse(HttpResponseRenderer.java:69)
      

            Unassigned Unassigned
            cetra3 Cetra Free
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: