[JIRA] (JENKINS-43035) expression does not see imported classes

2017-03-27 Thread gastersta...@ehealthexperts.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Stefan Gasterstädt edited a comment on  JENKINS-43035  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: _expression_ does not see imported classes   
 

  
 
 
 
 

 
 As far as I understand, scripting is a valid option for declarative Jenkinsfiles. That is what{code}steps {  script { ... }}{code}is made for. Similar, the {{_expression_}} block of {{when}} is made for script blocks.Don't you think, that if scripting a when- conditionif condition  is not a suitable option, a declarative Jenkinsfile should not offer {code}when {  _expression_ { ... }}{code}at all?  
 

  
 
 
 
 

 
 
 

 
 
 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-43035) expression does not see imported classes

2017-03-27 Thread gastersta...@ehealthexperts.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Stefan Gasterstädt edited a comment on  JENKINS-43035  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: _expression_ does not see imported classes   
 

  
 
 
 
 

 
 As far as I understand, scripting is a valid option for declarative Jenkinsfiles. That is what{code :groovy }steps {  script { ... }}{code}is made for. Similar, the {{_expression_}} block of {{when}} is made for script blocks.Don't you think, that if scripting a when-conditionif is not a suitable option, a declarative Jenkinsfile should not offer {code :groovy }when {  _expression_ { ... }}{code}at all?  
 

  
 
 
 
 

 
 
 

 
 
 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-43035) expression does not see imported classes

2017-03-27 Thread gastersta...@ehealthexperts.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Stefan Gasterstädt commented on  JENKINS-43035  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: _expression_ does not see imported classes   
 

  
 
 
 
 

 
 As far as I understand, scripting is a valid option for declarative Jenkinsfiles. That is what 

 

Unable to find source-code formatter for language: groovy. Available languages are: actionscript, html, java, _javascript_, none, sql, xhtml, xml


steps {
  script { ... }
}
 

 is made for. Similar, the _expression_ block of when is made for script blocks. Don't you think, that if scripting a when-conditionif is not a suitable option, a declarative Jenkinsfile should not offer  

 

Unable to find source-code formatter for language: groovy. Available languages are: actionscript, html, java, _javascript_, none, sql, xhtml, xml


when {
  _expression_ { ... }
}
 

 at all?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

[JIRA] (JENKINS-43035) expression does not see imported classes

2017-03-23 Thread gastersta...@ehealthexperts.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Stefan Gasterstädt edited a comment on  JENKINS-43035  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: _expression_ does not see imported classes   
 

  
 
 
 
 

 
 According to your groovy-unit-test [libraryObjectInWhenExpression.groovy ]( | https://github.com/abayer/pipeline-model-definition-plugin/blob/12a0443c5cece4a4a3b04f16d51a4f3f0bd3b2ca/pipeline-model-definition/src/test/resources/libraryObjectInWhenExpression.groovy ) ] , this looks exactly similar to my situation.Thank you, that was a fast reaction.  
 

  
 
 
 
 

 
 
 

 
 
 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-43035) expression does not see imported classes

2017-03-23 Thread gastersta...@ehealthexperts.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Stefan Gasterstädt commented on  JENKINS-43035  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: _expression_ does not see imported classes   
 

  
 
 
 
 

 
 According to your groovy-unit-test [libraryObjectInWhenExpression.groovy](https://github.com/abayer/pipeline-model-definition-plugin/blob/12a0443c5cece4a4a3b04f16d51a4f3f0bd3b2ca/pipeline-model-definition/src/test/resources/libraryObjectInWhenExpression.groovy), this looks exactly similar to my situation. Thank you, that was a fast reaction.  
 

  
 
 
 
 

 
 
 

 
 
 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-43035) expression does not see imported classes

2017-03-22 Thread gastersta...@ehealthexperts.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Stefan Gasterstädt created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-43035  
 
 
  _expression_ does not see imported classes   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Andrew Bayer  
 
 
Components: 
 pipeline-model-definition-plugin  
 
 
Created: 
 2017/Mar/22 3:22 PM  
 
 
Environment: 
 Jenkins 2.50  Pipeline Model Definition PlugIn 1.1.1  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Stefan Gasterstädt  
 

  
 
 
 
 

 
 The following Jenkinsfile snippet shows the fully quallified usage of an imported Type within an `_expression_` block. The whole Jenkinsfile can be executed without a failure. ```groovy @Library('SomeManagedLibID') _ import some.package.MyType [...] stages {   stage('Foobar') {     when {   _expression_ {     def xyz = new some.package.MyType()         [...]   } ``` Whereas the second snippet uses the short name (because it is imported) ... ```groovy @Library('SomeManagedLibID') _ import some.package.MyType [...] stages {   stage('Foobar') {     when {   _expression_ {     def xyz = new MyType()         [...]   } ``` ... but in this case, the execution fails with a ProxyException: ``` Bitbucket] Build result notified hudson.remoting.ProxyException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script2.groovy: 2: unable to resolve class MyType  @ line 2, column 10. def cg = new MyType() ^ 1 error  at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:958) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:554) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at