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

Git Parameter Plugin not expose type to API anymore

XMLWordPrintable

      I have a pipeline job as follows:

      // Using git without checkout
      pipeline {
        agent any
        parameters {
          gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'JOB_TAG', type: 'PT_TAG'
          gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'JOB_BRANCH', type: 'PT_BRANCH'
          gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'JOB_BRANCH_TAG', type: 'PT_BRANCH_TAG'
          gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'JOB_REVISION', type: 'PT_REVISION'
          gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'JOB_PULL_REQUEST', type: 'PT_PULL_REQUEST'
        }
        stages {
          stage('Example') {
            steps {
              echo "PT_TAG: ${params.JOB_TAG}"
              echo "PT_BRANCH: ${params.JOB_BRANCH}"
              echo "PT_BRANCH_TAG: ${params.JOB_BRANCH_TAG}"
              echo "PT_REVISION: ${params.JOB_REVISION}"
              echo "PT_PULL_REQUEST: ${params.JOB_PULL_REQUEST}"
            }
          }
        }
      }
      

      The API Results in following:

      {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowJob","property":[{"_class":"hudson.model.ParametersDefinitionProperty","parameterDefinitions":[{"_class":"net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition","name":"JOB_TAG","type":"GitParameterDefinition"},{"_class":"net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition","name":"JOB_BRANCH","type":"GitParameterDefinition"},{"_class":"net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition","name":"JOB_BRANCH_TAG","type":"GitParameterDefinition"},{"_class":"net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition","name":"JOB_REVISION","type":"GitParameterDefinition"},{"_class":"net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition","name":"JOB_PULL_REQUEST","type":"GitParameterDefinition"}]}]}
      

      The type is always 'GitParameterDefinition'. Before it was set to the selected Type (PT_TAG, PT_BRANCH, PT_BRANCH_TAG, PT_REVISION, PT_PULL_REQUEST)

      I check the type for my plugin and there you see old and current API value: https://github.com/MCMicS/jenkins-control-plugin/issues/366#issuecomment-1084101319

            klimas7 Boguslaw Klimas
            mcmics Michael Suhr
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: