[JIRA] (JENKINS-60910) Change in git plugin causes job-dsl script to break

8 views
Skip to first unread message

jonathan@riv.al (JIRA)

unread,
Jan 29, 2020, 2:53:03 PM1/29/20
to jenkinsc...@googlegroups.com
Jonathan B created an issue
 
Jenkins / Bug JENKINS-60910
Change in git plugin causes job-dsl script to break
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin, job-dsl-plugin
Created: 2020-01-29 19:52
Priority: Minor Minor
Reporter: Jonathan B

After upgrading from git:4.0.0 to git:4.1.1, we started having an issue with this job-dsl script (runs via configuration-as-code, but I don't think that's relevant):

multibranchPipelineJob('...') {
  branchSources {
    branchSource {
      source {
        github {
          id('...')
          repoOwner('...')
          repository('...')
          repositoryUrl('')
          configuredByUrl(false)
          credentialsId('/github-api')

          traits {
            cleanBeforeCheckoutTrait()
          }
        }
      }
    }
  }
}

The script fails to run with

javaposse.jobdsl.dsl.DslScriptException: (script, line 14) the following options are required and must be specified: extension
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
   at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)

The stack trace goes on and on, but it doesn't look very useful.

The problem goes away if we comment out `cleanBeforeCheckoutTrait()`. Trying to pass a `null` value for `extension` fails with

groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.plugin.structs.DescribableListContext.cleanBeforeCheckoutTrait() is applicable for argument types: (null) values: [null]

I have to wonder if it was caused by this update to the comment (:scream: https://github.com/jenkinsci/git-plugin/commit/a63cbf70fb9b0808e832f0f87224e717525b43cc#diff-3fea5cf802f684679c8bf220b9946f58

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jonathan@riv.al (JIRA)

unread,
Jan 29, 2020, 2:54:03 PM1/29/20
to jenkinsc...@googlegroups.com
Jonathan B updated an issue
Change By: Jonathan B
After upgrading from git:4.0.0 to git:4.1.1, we started having an issue with this job-dsl script (runs via configuration-as-code, but I don't think that's relevant):

{code}

multibranchPipelineJob('...') {
  branchSources {
    branchSource {
      source {
        github {
          id('...')
          repoOwner('...')
          repository('...')
          repositoryUrl('')
          configuredByUrl(false)
          credentialsId('/github-api')

          traits {
            cleanBeforeCheckoutTrait()
          }
        }
      }
    }
  }
}
{code}


The script fails to run with

{code}

javaposse.jobdsl.dsl.DslScriptException: (script, line 14) the following options are required and must be specified: extension
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
   at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
{code}


The stack trace goes on and on, but it doesn't look very useful.

The problem goes away if we comment out `cleanBeforeCheckoutTrait()`. Trying to pass a `null` value for `extension` fails with

{code}

groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.plugin.structs.DescribableListContext.cleanBeforeCheckoutTrait() is applicable for argument types: (null) values: [null]
{code}

I have to wonder if it was caused by this update to the comment (:
the scream: ): https://github.com/jenkinsci/git-plugin/commit/a63cbf70fb9b0808e832f0f87224e717525b43cc#diff-3fea5cf802f684679c8bf220b9946f58

jonathan@riv.al (JIRA)

unread,
Jan 29, 2020, 2:54:03 PM1/29/20
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 29, 2020, 4:48:04 PM1/29/20
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-60910
 
Re: Change in git plugin causes job-dsl script to break

Refer to this entry in the release notes for the incompatibility and the solution.

jonathan@riv.al (JIRA)

unread,
Jan 29, 2020, 5:25:02 PM1/29/20
to jenkinsc...@googlegroups.com

jonathan@riv.al (JIRA)

unread,
Jan 29, 2020, 5:25:02 PM1/29/20
to jenkinsc...@googlegroups.com
Jonathan B closed an issue as Not A Defect
 
Change By: Jonathan B
Status: Open Closed
Resolution: Not A Defect
Reply all
Reply to author
Forward
0 new messages