-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Blocker
-
Component/s: git-parameter-plugin
-
None
-
Environment:Jenkins 2.70, Jenkins Job DSL 1.64, Git Parameter Plug-In 0.8.0, Git plugin 3.5.0, GitLab
I'm using Jenkins Job DSL.
I found 'TAG' does not fetch any tag soon after building seed job, although it does after I move to job configuration and pushing Save button.
Here is minimal code to reproduce the issue:
job('gitParam-doesnt-fetch-tags') {
 scm {
  git {
   remote {
    branch('**')
    url('git@gitlab.our-company.com:organization/repo.git')
    credentials('our-gitlab-user-pass')
   }
  }
 }
 parameters {
  gitParam('GIT_TAG') {
   type('TAG')
  }
 }
}
Workaround
Use GitParameterDefinition() instead of gitParam().
job('gitParam-doesnt-fetch-tags') {
 scm {
  git {
   remote {
    branch('**')
    url('git@gitlab.our-company.com:organization/repo.git')
    credentials('our-gitlab-user-pass')
   }
  }
 }
 parameters {
  buildParameterNodes['GIT_TAG'] = NodeBuilder.newInstance().'net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition' {
   name('GIT_TAG')
   type('PT_TAG')
   sortMode('DESCENDING_SMART') // this seems required
  }
 }
}
Detailed explanation of the issue
After building seed job, I get this job to reproduce the issue.

When I move to "Parameterized build", no git tags are displayed.

After moving to configuration, changing nothing, and pushing Save button,

then parameterized build screen shows tags as I expected.
