Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
    • Similar Issues:

      Description

      Creating a pipeline script with a parameters declaration that declares copies of an exact same parameter seem to work. The code block below in a jenkins pipeline would update the job with three parameters all of the name TAG. This seems like unexpected behavior. I would have expected Jenkins to error with an exception?

      properties([
          parameters([
              string(name: 'TAG', description: 'git tag to merge to master'),
              string(name: 'TAG', description: 'git tag to merge to master'),
              string(name: 'TAG', description: 'git tag to merge to master')
          ])
      ])
      
      stage('TEST') {
          if (params.TAG == null || params.TAG.trim().isEmpty()) {
              error('TAG must be specified')
          }
      }

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Not sure how to fix that. Likely it's reproducible in Freestyle as well.
          Maybe just needs validation and warnings

          Show
          oleg_nenashev Oleg Nenashev added a comment - Not sure how to fix that. Likely it's reproducible in Freestyle as well. Maybe just needs validation and warnings
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Same happens with Freestyle as well, no warnings or whatever.
          The last value is used, see the screenshots.

          Seems like a newbie-friendly issue for extra validation

          Show
          oleg_nenashev Oleg Nenashev added a comment - Same happens with Freestyle as well, no warnings or whatever. The last value is used, see the screenshots. Seems like a newbie-friendly issue for extra validation
          Hide
          surenpi Rick added a comment - - edited

          Param define duplicates is allowed in many program language, I think it's ok.

          Show
          surenpi Rick added a comment - - edited Param define duplicates is allowed in many program language, I think it's ok.

            People

            • Assignee:
              Unassigned
              Reporter:
              yanger312 Andrew Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: