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

Add trim option to String Parameter

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins ver. 2.73.1
      job-dsl-plugin 1.65
    • Similar Issues:

      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

            Hide
            daspilker Daniel Spilker added a comment -

            The string parameter in Jenkins has no trim option. Job DSL only provides syntax for options that are available in Jenkins core or plugins.

            Show
            daspilker Daniel Spilker added a comment - The string parameter in Jenkins has no trim option. Job DSL only provides syntax for options that are available in Jenkins core or plugins.
            Hide
            vorobievalex Alexander Vorobiev added a comment -

            Comment above does not resolve the problem described.

            Moving to core.

            Show
            vorobievalex Alexander Vorobiev added a comment - Comment above does not resolve the problem described. Moving to core.
            Hide
            ctadeu Carlos Tadeu Panato added a comment -

            Will try this one

            Show
            ctadeu Carlos Tadeu Panato added a comment - Will try this one
            Hide
            ks_nenasheva Kseniia Nenasheva added a comment -

            PR #3106

            Show
            ks_nenasheva Kseniia Nenasheva added a comment - PR  #3106
            Hide
            ctadeu Carlos Tadeu Panato added a comment -

            aborting this since Kseniia Nenasheva already did

            Show
            ctadeu Carlos Tadeu Panato added a comment - aborting this since Kseniia Nenasheva already did
            Hide
            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)

            • Add help information
            • Address comments
            • Address comments
            • Address comments
            • Address comments
            Show
            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
            Hide
            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?

            Show
            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?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            The improvement has been integrated towards 2.90

            Show
            oleg_nenashev Oleg Nenashev added a comment - The improvement has been integrated towards 2.90

              People

              • Assignee:
                ks_nenasheva Kseniia Nenasheva
                Reporter:
                vorobievalex Alexander Vorobiev
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: