[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-24 Thread r.fuere...@xortex.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhold Füreder commented on  JENKINS-50736  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
 Thanks for your feedback. One of the main reasons – why I was nonetheless filing this issue after some initial hesitation – was the error message, which somehow reads as if it did not find the required method, but one of the possible solutions actually is the right one  as it has the right signature (and should be just taken): 

 
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: static acme.skipableStage() is applicable for argument types: (java.lang.String, org.jenkinsci.plugins.workflow.cps.CpsClosure2) values: [checkout, org.jenkinsci.plugins.workflow.cps.CpsClosure2@4faabfc3]
Possible solutions: skipableStage(java.lang.String, groovy.lang.Closure), skipableStage(java.lang.String, groovy.lang.Closure, groovy.lang.Closure), skipableStage(java.lang.String, java.lang.Object, groovy.lang.Closure), skipableStage(java.lang.String, java.lang.Object, groovy.lang.Closure, groovy.lang.Closure)
 

 And based on Jesse Glick's comment I must admit that my issue description was too confusing or badly updated, because SpecialBuild is NOT a top-level class in the failure scenario; unfortunately I just started the issue description with the old workaround code that worked where SpecialBuild was a top-level class and I did not use inheritance. Therefore I nonetheless made a proper re-producer for you: 
 
slightly simpler as in the original description above 
and really tested 
but not using any tricks (that I may not understand) to "maybe" recreate it in a single file 
 So here it is: 
 
Pipeline library: 
 
"vars/acme.groovy" 

 

#!/usr/bin/env groovy

import com.acme.Build
import com.acme.SpecialBuild

void doSomething() {
  echo 'doSomething...'
}

void build(Closure body) {
  def build = new Build(this)
  build.build(body)
}

void specialBuild() {
  def acmeSpecialBuild = new SpecialBuild(this)
  acmeSpecialBuild.build()
}
 

 
com.acme.Build in "src/com/acme/Build.groovy" 

 

package com.acme

class Build implements Serializable {

  def script
  def acme

  

[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-24 Thread r.fuere...@xortex.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhold Füreder updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50736  
 
 
  Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
Change By: 
 Reinhold Füreder  
 
 
Attachment: 
 screenshot-blue-ocean-failure.png  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-20 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick commented on  JENKINS-50736  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
 acme is an attribute of WorkflowScript. SpecialBuild is a top-level class. Therefore unqualified acme is not resolvable. That is not a bug. If unqualified acme does work inside Build, that would be a bug. Unless it were a field. Which it does not look like, since you are using def, which is used for defining local variables. I was not aware that is even syntactically legal in Groovy. Declare a type, or use @Field, or do not declare it at all and just refer to it with @acme notation. I am pretty confident this is all just a user error.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-20 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-50736  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
 Throwing some notes here - first, this is impossible to recreate directly in a single source file, even with multiple classes in it. I believe this is because the CPS transformation here in the subclass happens before the autogenerated getter method is added to the superclass when they're all in the same source file. You can recreate it in a single file by either adding a getter method to the superclass directly. You can create by referencing the field in the subclasses with the this.@someField attribute syntax, but I believe that fails in vanilla Groovy too, so eh. What's actually happening is that we're actually calling (via some layers of abstraction) InvokerHelper.getAttribute(object, name), which ends up getting the MetaBeanProperty for that object/name combo. And the field field of that MetaBeanProperty is null. This is the same behavior you get in vanilla Groovy if you do this.@someField in the subclass. So the problem seems to be that you can't actually call InvokerHelper.getAttribute(object, name) for a field on a superclass, and our hacks to avoid recursion hell with getter methods (which I think was intended primarily to deal with explicit getters, not autogenerated getters, but don't quote me on that) will end up doing that.  How to fix this? Well, I've got a couple hacks I've tried that seem to "fix" this for some value of "fixed" - most notably changing DefaultInvoker#getAttribute(lhs, name) to catch MissingFieldException when it shows up and try forcing a MetaClass#getAttribute call with InvokerHelper.getMetaClass(lhs.getClass().getSuperclass()), recursing on until we get to Object.class. But that feels really really dirty, so I'm trying to think of something better.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-20 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-50736  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
 You can also try an explicit public - if I’m right, this is due to weirdness around how Groovy treats a field with no modifier and how CPS tries to avoid stack overflows...  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-19 Thread r.fuere...@xortex.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhold Füreder commented on  JENKINS-50736  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
 Frankly, I don't think so: as def acme is already public, changing it to protected def acme should not help. Sorry for the very lengthy and potentially confusing issue description; maybe due to getting doubts whether or not this is a bug, I made some re-writes and adaptions later on, which may not made the issue description clearer... => I'll try to properly re-produce it and then I'll try your protected guess as well...  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-19 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-50736  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
 So I've been looking at something similar to this - it seems that this is due to JENKINS-31484. It looks like if you switch to protected def acme, it may work?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-12 Thread r.fuere...@xortex.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhold Füreder updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50736  
 
 
  Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
Change By: 
 Reinhold Füreder  
 

  
 
 
 
 

 
 Like in JENKINS-50731:{quote}Thanks to the fix of JENKINS-45982 I dared to continue with one of my original approaches using inheritance in shared Jenkins pipeline library classes, but stumbled over this problem.{quote}I am not sure anymore (*updated*) whether or not this is really a bug: because I had already "qualifiyied" calls to 'acme.' with the script context (or so) also before switching back to using inheritance (thanks to the fix of JENKINS-45982) {{SpecialBuild}} below was basically duplicating things of {{Build}} like this:{code:java}class SpecialBuild {  def script  def acme  SpecialBuild(def script) {this.script = scriptthis.acme = script.acme  }  void build() {acme.build() { // ! Using the 'acme.build' step from 'vars/acme.groovy'  script.node {acme.skipableStage("init") { // Direct usage of 'acme.skipableStage' step worked  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // Direct usage of 'acme.skipableStage' step worked  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h4. How to reproduce?(I tried to include only minimal things and have not tested it after this "thinning out", so maybe there are small mistakes...)h5. "Jenkinsfile"{code:java}#!/usr/bin/env groovyecho 'Sandbox pipeline'@Library('acme-shared-library') _acme.specialBuild() {}{code}h5. Classes in shared pipeline library ('src' section)* 'src/Build.groovy'{code:java}#!/usr/bin/env groovyclass Build implements Serializable {  def script   def acme     Build(def script) {this.script = Objects.requireNonNull(script, 'script must not be null') this.acme = script.acme   }  void build(Closure body) {try {  body()} catch (e) {  acme.notifyFailing(...)  //  send email notification  Direct access/usage of 'acme' works here  // While there would be no need to re-throw the exception to propagate the error (because the build result must be set // to failure for email-ext anyhow before), re-throw it for e.g. script approval requests: throw e}  }}{code}* 'src/SpecialBuild.groovy'{code:java}#!/usr/bin/env groovyclass SpecialBuild extends Build {  SpecialBuild(def script) {super(script)  }  void build() {super.build() { // Mind this instead of 'acme.build()' like before using inheritance  script.node {script.acme.skipableStage("init") { // This works  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // ! This does NOT work  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h5. Corresponding steps in shared pipeline library ('vars' section)* 'vars/acme.groovy'{code:java}#!/usr/bin/env groovyvoid svnCheckout(String workspaceUpdater = 'UpdateUpdater') {  // ...}void build(Map args, 

[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-11 Thread r.fuere...@xortex.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhold Füreder updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50736  
 
 
  Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
Change By: 
 Reinhold Füreder  
 

  
 
 
 
 

 
 Like in JENKINS-50731:{quote}Thanks to the fix of JENKINS-45982 I dared to continue with one of my original approaches using inheritance in shared Jenkins pipeline library classes, but stumbled over this problem.{quote}I am  pretty  not  sure  anymore (*updated*) whether or not  this is  really  a bug , but : because  I  might be wrong and would then have to live with the workaround of  had already  " qualifiying qualifiyied " calls to 'acme.' with the script context (or so) .Before  also before  switching back to using inheritance (thanks to the fix of JENKINS-45982) {{SpecialBuild}} below was basically duplicating things of {{Build}} like this:{code:java}class SpecialBuild {  def script   def acme     SpecialBuild(def script) {this.script = script this.acme = script.acme   }  void build() {acme.build() { // ! Using the 'acme.build' step from 'vars/acme.groovy'  script.node {acme.skipableStage("init") { // Direct usage of 'acme.skipableStage' step worked  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // Direct usage of 'acme.skipableStage' step worked  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h4. How to reproduce?(I tried to include only minimal things and have not tested it after this "thinning out", so maybe there are small mistakes...)h5. "Jenkinsfile"{code:java}#!/usr/bin/env groovyecho 'Sandbox pipeline'@Library('acme-shared-library') _acme.specialBuild() {}{code}h5. Classes in shared pipeline library ('src' section)* 'src/Build.groovy'{code:java}#!/usr/bin/env groovyclass Build implements Serializable {  def script  Build(def script) {this.script = Objects.requireNonNull(script, 'script must not be null')  }  void build(Closure body) {try {  body()} catch (e) { // send email notification // While there would be no need to re-throw the exception to propagate the error (because the build result must be set // to failure for email-ext anyhow before), re-throw it for e.g. script approval requests: throw e}  }}{code}* 'src/SpecialBuild.groovy'{code:java}#!/usr/bin/env groovyclass SpecialBuild extends Build {  SpecialBuild(def script) {super(script)  }  void build() {super.build() { // Mind this instead of 'acme.build()' like before using inheritance  script.node {script.acme.skipableStage("init") { // This works  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // ! This does NOT work  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h5. Corresponding steps in shared pipeline library ('vars' section)* 'vars/acme.groovy'{code:java}#!/usr/bin/env groovyvoid svnCheckout(String workspaceUpdater = 'UpdateUpdater') {  // ...}void build(Map args, 

[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-11 Thread r.fuere...@xortex.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhold Füreder updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50736  
 
 
  Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
Change By: 
 Reinhold Füreder  
 

  
 
 
 
 

 
 Like in JENKINS-50731:{quote}Thanks to the fix of JENKINS-45982 I dared to continue with one of my original approaches using inheritance in shared Jenkins pipeline library classes, but stumbled over this problem.{quote}I am pretty sure this is a bug, but I might be wrong and would then have to live with the workaround of "qualifiying" calls to 'acme.' with the script context (or so).Before switching back to using inheritance (thanks to the fix of JENKINS-45982) {{SpecialBuild}} below was basically duplicating things of {{Build}} like this:{code:java}class SpecialBuild {  def script  SpecialBuild(def script) {this.script = script  }  void build() {acme.build() { // ! Using the 'acme.build' step from 'vars/acme.groovy'  script.node {acme.skipableStage("init") { // Direct usage of 'acme.skipableStage' step worked  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // Direct usage of 'acme.skipableStage' step worked  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h4. How to reproduce?(I tried to include only minimal things and have not tested it after this "thinning out", so maybe there are small mistakes...)h5. "Jenkinsfile"{code:java}#!/usr/bin/env groovyecho 'Sandbox pipeline'@Library('acme-shared-library') _acme.specialBuild() {}{code}h5. Classes in shared pipeline library ('src' section)* 'src/Build.groovy'{code:java}#!/usr/bin/env groovyclass Build implements Serializable {  def script  Build(def script) {this.script = Objects.requireNonNull(script, 'script must not be null')  }  void build(Closure body) {try {  body()} catch (e) { // send email notification // While there would be no need to re-throw the exception to propagate the error (because the build result must be set // to failure for email-ext anyhow before), re-throw it for e.g. script approval requests: throw e}  }}{code}* 'src/SpecialBuild.groovy'{code:java}#!/usr/bin/env groovyclass SpecialBuild extends Build {  SpecialBuild(def script) {super(script)  }  void build() {super.build() { // Mind this instead of 'acme.build()' like before using inheritance  script.node {script.acme.skipableStage("init") { // This works  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // ! This does NOT work  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h5. Corresponding steps in shared pipeline library ('vars' section)* 'vars/acme.groovy'{code:java}#!/usr/bin/env groovyvoid svnCheckout(String workspaceUpdater = 'UpdateUpdater') {  // ...}void build(Map args, Closure body) {  // ...  def build = new Build(this)  build.build(body)}void skipableStage(String stageName, Closure body) {  skipableStage(stageName, 

[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-11 Thread r.fuere...@xortex.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhold Füreder updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50736  
 
 
  Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
Change By: 
 Reinhold Füreder  
 

  
 
 
 
 

 
 Like in JENKINS-50731:{quote}Thanks to the fix of JENKINS-45982 I dared to continue with one of my original approaches using inheritance in shared Jenkins pipeline library classes, but stumbled over this problem.{quote}I am pretty sure this is a bug, but I might be wrong and would then have to live with the workaround of "qualifiying" calls to 'acme.' with the script context (or so).Before switching back to using inheritance (thanks to the fix of JENKINS-45982) {{SpecialBuild}} below was basically duplicating things of {{Build}} like this:{code:java}class SpecialBuild {  def script  SpecialBuild(def script) {this.script = script  }  void build() {acme.build() { // ! Using the 'acme.build' step from 'vars/acme.groovy'  script.node {acme.skipableStage("init") { // Direct usage of 'acme.skipableStage' step worked  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // Direct usage of 'acme.skipableStage' step worked  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h4. How to reproduce?(I tried to include only minimal things and have not tested it after this "thinning out", so maybe there are small mistakes...)h5. "Jenkinsfile"{code:java}#!/usr/bin/env groovyecho 'Sandbox pipeline'@Library('acme-shared-library') _acme.specialBuild() {}{code}h5. Classes in shared pipeline library ('src' section)* 'src/Build.groovy'{code:java}#!/usr/bin/env groovyclass Build implements Serializable {  def script  Build(def script) {this.script = Objects.requireNonNull(script, 'script must not be null')  }  void build(Closure body) {try {  body()} catch (e) { // send email notification // While there would be no need to re-throw the exception to propagate the error (because the build result must be set // to failure for email-ext anyhow before), re-throw it for e.g. script approval requests: throw e}  }}{code}* 'src/SpecialBuild.groovy'{code:java}#!/usr/bin/env groovyclass SpecialBuild extends Build {  SpecialBuild(def script) {super(script)  }  void build() {super.build() {  // Mind this instead of 'acme.build()' like before using inheritance   script.node {script.acme.skipableStage("init") { // This works  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // ! This does NOT work  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h5. Corresponding steps in shared pipeline library ('vars' section)* 'vars/acme.groovy'{code:java}#!/usr/bin/env groovyvoid svnCheckout(String workspaceUpdater = 'UpdateUpdater') {  // ...}void build(Map args, Closure body) {  // ...  def build = new Build(this)  build.build(body)}void skipableStage(String stageName, Closure body) {  skipableStage(stageName, 

[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-11 Thread r.fuere...@xortex.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhold Füreder updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50736  
 
 
  Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
Change By: 
 Reinhold Füreder  
 

  
 
 
 
 

 
 Like in JENKINS-50731:{quote}Thanks to the fix of JENKINS-45982 I dared to continue with one of my original approaches using inheritance in shared Jenkins pipeline library classes, but stumbled over this problem.{quote}I am pretty sure this is a bug, but I might be wrong and  I  would then  have to live with the workaround of "qualifiying" calls to 'acme.' with the script context  (  or so ) .Before switching back to using inheritance (thanks to the fix of JENKINS-45982) {{SpecialBuild}} below was basically duplicating things of {{Build}} like this:{code:java}class SpecialBuild {  def script  SpecialBuild(def script) {this.script = script  }  void build() {acme.build() { // ! Using the 'acme.build' step from 'vars/acme.groovy'  script.node {acme.skipableStage("init") { // Direct usage of 'acme.skipableStage' step worked  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // Direct usage of 'acme.skipableStage' step worked  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h4. How to reproduce?(I tried to include only minimal things and have not tested it after this "thinning out", so maybe there are small mistakes...)h5. "Jenkinsfile"{code:java}#!/usr/bin/env groovyecho 'Sandbox pipeline'@Library('acme-shared-library') _acme.specialBuild() {}{code}h5. Classes in shared pipeline library ('src' section)* 'src/Build.groovy'{code:java}#!/usr/bin/env groovyclass Build implements Serializable {  def script  Build(def script) {this.script = Objects.requireNonNull(script, 'script must not be null')  }  void build(Closure body) {try {  body()} catch (e) { // send email notification // While there would be no need to re-throw the exception to propagate the error (because the build result must be set // to failure for email-ext anyhow before), re-throw it for e.g. script approval requests: throw e}  }}{code}* 'src/SpecialBuild.groovy'{code:java}#!/usr/bin/env groovyclass SpecialBuild extends Build {  SpecialBuild(def script) {super(script)  }  void build() {super.build() {  script.node {script.acme.skipableStage("init") { // This works  script.echo "acme 'Pipeline from SCM Script'"}acme.skipableStage('checkout') { // ! This does NOT work  acme.svnCheckout('UpdateWithCleanUpdater')}  }}  }  }{code}h5. Corresponding steps in shared pipeline library ('vars' section)* 'vars/acme.groovy'{code:java}#!/usr/bin/env groovyvoid svnCheckout(String workspaceUpdater = 'UpdateUpdater') {  // ...}void build(Map args, Closure body) {  // ...  def build = new Build(this)  build.build(body)}void skipableStage(String stageName, Closure body) {  skipableStage(stageName, false, body)}void skipableStage(String stageName, def 

[JIRA] (JENKINS-50736) Calling another vars step in inheritance context fails with MissingMethodException

2018-04-11 Thread r.fuere...@xortex.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhold Füreder updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-50736  
 
 
  Calling another vars step in inheritance context fails with MissingMethodException   
 

  
 
 
 
 

 
Change By: 
 Reinhold Füreder  
 
 
Summary: 
 Calling another vars step in inheritance context fails withMissingMethodException  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.