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

Add trim option to String Parameter

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • core
    • Jenkins ver. 2.73.1
      job-dsl-plugin 1.65

    Description

      There are often failures when users input string parameter with an extra space.
      This leads to build failures in many cases.

      It would be great to be able to trim string parameter from the beginning. So it can be safely used everywhere down in the pipeline:

      parameters {
              string(defaultValue: "", description: '', name: 'tag or commit', trim: true)
      }
      

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Kseniia Nenasheva
            Path:
            core/src/main/java/hudson/model/StringParameterDefinition.java
            core/src/main/java/hudson/model/StringParameterValue.java
            core/src/main/resources/hudson/model/StringParameterDefinition/config.jelly
            core/src/main/resources/hudson/model/StringParameterDefinition/index.jelly
            war/src/main/webapp/help/parameter/trim.html
            http://jenkins-ci.org/commit/jenkins/95db56e850f13650d3b16bec7a07f0abe20a931a
            Log:
            JENKINS-47115 - Add trim option to String Parameter (#3106)

            • Add help information
            • Address comments
            • Address comments
            • Address comments
            • Address comments
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kseniia Nenasheva Path: core/src/main/java/hudson/model/StringParameterDefinition.java core/src/main/java/hudson/model/StringParameterValue.java core/src/main/resources/hudson/model/StringParameterDefinition/config.jelly core/src/main/resources/hudson/model/StringParameterDefinition/index.jelly war/src/main/webapp/help/parameter/trim.html http://jenkins-ci.org/commit/jenkins/95db56e850f13650d3b16bec7a07f0abe20a931a Log: JENKINS-47115 - Add trim option to String Parameter (#3106) JENKINS-47115 - Add trim option to String Parameter Add help information Address comments Address comments Address comments Address comments

            Thanks a lot, Kseniia.

            Will trim be available in pipeline after the change above of does pipeline support need another Jira issue?

            vorobievalex Alexander Vorobiev added a comment - Thanks a lot, Kseniia. Will trim be available in pipeline after the change above of does pipeline support need another Jira issue?
            oleg_nenashev Oleg Nenashev added a comment -

            The improvement has been integrated towards 2.90

            oleg_nenashev Oleg Nenashev added a comment - The improvement has been integrated towards 2.90
            felipecassiors Felipe Santos added a comment - Documentation is not updated so.  https://www.jenkins.io/doc/book/pipeline/syntax/#parameters
            zdtsw Wen Zhou added a comment - - edited

            Good to have document updated https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.BuildParametersContext.stringParam


            Never mind, I understand it now, this is a dynamic DSL, therefore not showing in the dsl API or links above.

            zdtsw Wen Zhou added a comment - - edited Good to have document updated  https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.BuildParametersContext.stringParam Never mind, I understand it now, this is a dynamic DSL, therefore not showing in the dsl API or links above.

            People

              ks_nenasheva Kseniia Nenasheva
              vorobievalex Alexander Vorobiev
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: