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

Invalid parameter "removeLastBuild", did you mean "numToKeepStr"?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • pipeline
    • None

      LogRotator.setRemoveLastBuild(boolean) method is annotated with DataBoundSetter, but it can't be set from a pipeline (neither declarative, nor scripted):

      options {
             buildDiscarder(logRotator(numToKeepStr: '2', daysToKeepStr: '7', removeLastBuild: true))
      }
      WorkflowScript: 30: Invalid parameter "removeLastBuild", did you mean "numToKeepStr"? @ line 30, column 73.
         Str: '2', daysToKeepStr: '7', removeLast 

      This makes multibranch pipelines unusable, as builds for stale branches are never discarded.

      Discovered in JENKINS-36364

      Environment

      Jenkins 4.462

      Pipeline: Multibranch Version 795.ve0cb_1f45ca_9a_

      GitLab Branch Source Version 704.vc7f1202d7e14

            Unassigned Unassigned
            basilevs Vasili Gulevich
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: