Re: Warnings Plugin and Mail-ext Integration

2012-04-12 Thread Slide
I'm having a few difficulties on this. The GroovyShell is initialized
with a ClassLoader like this:

private static final class Script implements
DelegatingCallable {
private final String script;
private transient ClassLoader cl;

private Script(String script) {
this.script = script;
cl = getClassLoader();
}

public ClassLoader getClassLoader() {
return Jenkins.getInstance().getPluginManager().uberClassLoader;
}

public String call() throws RuntimeException {
// if we run locally, cl!=null. Otherwise the delegating
classloader will be available as context classloader.
if (cl==null)   cl =
Thread.currentThread().getContextClassLoader();
GroovyShell shell = new GroovyShell(cl);

StringWriter out = new StringWriter();
PrintWriter pw = new PrintWriter(out);
shell.setVariable("out", pw);
try {
Object output = shell.evaluate(script);
if(output!=null)
pw.println("Result: "+output);
} catch (Throwable t) {
t.printStackTrace(pw);
}
return out.toString();
}
}

The part I am interested in is when it uses the uberClassLoader vs
using the getContextClassLoader. How is cl set to null for executing
remotely? I am trying to replicate this setup for the groovy
templating in the email-ext plugin so it can load other plugins and
such.

Thanks,

slide

On Wed, Apr 11, 2012 at 3:05 PM, Darren Syzling  wrote:
> Thanks for looking into this - replying late but yes I tried explicit
> imports to no avail. Makes sense that a different class loader was
> being used.
>
> Look forward to testing an updated version when available.
>
>
> Darren
>
> On 11 April 2012 21:06, Slide  wrote:
>> Ok, it looks like the groovy script console sets the classloader for
>> the context to Jenkins.getInstance().getPluginManager().uberClassLoader,
>> which the email-ext plugin does NOT do. I will look at updating this
>> and trying it out and if it works, I'll release a new version of
>> email-ext.
>>
>> slide
>>
>> On Wed, Apr 11, 2012 at 8:51 AM, Slide  wrote:
>>> I also can't seem to get the groovy template to load the
>>> WarningsResultAction class. I tried similar things to what you did
>>> below. I will see if I can figure out what this is the case.
>>>
>>> Thanks,
>>>
>>> slide
>>>
>>> On Wed, Apr 11, 2012 at 5:57 AM, Darren Syzling  wrote:
 Ulli,

 I'd be happy to work on something together. I did however try a few
 variants but the hudson.plugins.warnings.WarningsResultAction class
 could not be found, I tried variants of this:

 warningsResultAction =
 build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
 warningsResultAction =
 build.getAction(hudson.plugins.warnings.WarningsResultAction.class)

 and using the class loader:
 ClassLoader cl = it.class.getClassLoader()
 def warningsClass =
 cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)

 Is there something different about the groovy parser engine loaded by
 email-ext which would mean other plugin classes were not available.

 Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
 Static analysis utilities 1.38
 Warnings 3.28
 Static analysis collector  1.24
 Email-ext  2.18

 This has broken my ability to build and configure the project, when I 
 build:
 11-Apr-2012 13:55:43 hudson.model.Executor run
 SEVERE: Executor threw an exception
 java.lang.AssertionError: class
 hudson.plugins.warnings.WarningsPublisher is missing its descriptor
        at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
        at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
        at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
        at 
 hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
        at 
 hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
        at hudson.model.Descriptor.toMap(Descriptor.java:873)
        at hudson.util.DescribableList.toMap(DescribableList.java:128)
        at hudson.model.Project.getPublishers(Project.java:109)
        at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
        at hudson.model.Run.run(Run.java:1457)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at 
 hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:238)


 and when I try and configure the project I can't access email-ext or
 warnings configuration information:
 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
 WARNING: Caught exception evalua

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Darren Syzling
Thanks for looking into this - replying late but yes I tried explicit
imports to no avail. Makes sense that a different class loader was
being used.

Look forward to testing an updated version when available.


Darren

On 11 April 2012 21:06, Slide  wrote:
> Ok, it looks like the groovy script console sets the classloader for
> the context to Jenkins.getInstance().getPluginManager().uberClassLoader,
> which the email-ext plugin does NOT do. I will look at updating this
> and trying it out and if it works, I'll release a new version of
> email-ext.
>
> slide
>
> On Wed, Apr 11, 2012 at 8:51 AM, Slide  wrote:
>> I also can't seem to get the groovy template to load the
>> WarningsResultAction class. I tried similar things to what you did
>> below. I will see if I can figure out what this is the case.
>>
>> Thanks,
>>
>> slide
>>
>> On Wed, Apr 11, 2012 at 5:57 AM, Darren Syzling  wrote:
>>> Ulli,
>>>
>>> I'd be happy to work on something together. I did however try a few
>>> variants but the hudson.plugins.warnings.WarningsResultAction class
>>> could not be found, I tried variants of this:
>>>
>>> warningsResultAction =
>>> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
>>> warningsResultAction =
>>> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>>>
>>> and using the class loader:
>>> ClassLoader cl = it.class.getClassLoader()
>>> def warningsClass =
>>> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>>>
>>> Is there something different about the groovy parser engine loaded by
>>> email-ext which would mean other plugin classes were not available.
>>>
>>> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
>>> Static analysis utilities 1.38
>>> Warnings 3.28
>>> Static analysis collector  1.24
>>> Email-ext  2.18
>>>
>>> This has broken my ability to build and configure the project, when I build:
>>> 11-Apr-2012 13:55:43 hudson.model.Executor run
>>> SEVERE: Executor threw an exception
>>> java.lang.AssertionError: class
>>> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
>>>        at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
>>>        at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
>>>        at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
>>>        at 
>>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
>>>        at 
>>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
>>>        at hudson.model.Descriptor.toMap(Descriptor.java:873)
>>>        at hudson.util.DescribableList.toMap(DescribableList.java:128)
>>>        at hudson.model.Project.getPublishers(Project.java:109)
>>>        at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
>>>        at hudson.model.Run.run(Run.java:1457)
>>>        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>>>        at 
>>> hudson.model.ResourceController.execute(ResourceController.java:88)
>>>        at hudson.model.Executor.run(Executor.java:238)
>>>
>>>
>>> and when I try and configure the project I can't access email-ext or
>>> warnings configuration information:
>>> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
>>> WARNING: Caught exception evaluating: i.descriptor. Reason:
>>> java.lang.reflect.InvocationTargetExcept
>>> ion
>>> java.lang.reflect.InvocationTargetException
>>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>        at java.lang.reflect.Method.invoke(Unknown Source)
>>>        at 
>>> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
>>>        at 
>>> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
>>> pl.java:314)
>>>        at 
>>> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
>>>        at 
>>> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
>>>        at 
>>> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
>>>        at 
>>> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
>>>        at 
>>> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
>>> 1)
>>>        at 
>>> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
>>>        at 
>>> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
>>>        at 
>>> org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
>>>
>>>
>>>
>>> On 11 April 2012 10:53, Ullrich Hafner  wrote:
 I haven't yet done that but it should be possible to access the objects
 using this method from your script:

 WarningsResultAction action =
 getAction("hudson.plugins.warnings.War

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Slide
Ok, it looks like the groovy script console sets the classloader for
the context to Jenkins.getInstance().getPluginManager().uberClassLoader,
which the email-ext plugin does NOT do. I will look at updating this
and trying it out and if it works, I'll release a new version of
email-ext.

slide

On Wed, Apr 11, 2012 at 8:51 AM, Slide  wrote:
> I also can't seem to get the groovy template to load the
> WarningsResultAction class. I tried similar things to what you did
> below. I will see if I can figure out what this is the case.
>
> Thanks,
>
> slide
>
> On Wed, Apr 11, 2012 at 5:57 AM, Darren Syzling  wrote:
>> Ulli,
>>
>> I'd be happy to work on something together. I did however try a few
>> variants but the hudson.plugins.warnings.WarningsResultAction class
>> could not be found, I tried variants of this:
>>
>> warningsResultAction =
>> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
>> warningsResultAction =
>> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>>
>> and using the class loader:
>> ClassLoader cl = it.class.getClassLoader()
>> def warningsClass =
>> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>>
>> Is there something different about the groovy parser engine loaded by
>> email-ext which would mean other plugin classes were not available.
>>
>> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
>> Static analysis utilities 1.38
>> Warnings 3.28
>> Static analysis collector  1.24
>> Email-ext  2.18
>>
>> This has broken my ability to build and configure the project, when I build:
>> 11-Apr-2012 13:55:43 hudson.model.Executor run
>> SEVERE: Executor threw an exception
>> java.lang.AssertionError: class
>> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
>>        at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
>>        at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
>>        at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
>>        at 
>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
>>        at 
>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
>>        at hudson.model.Descriptor.toMap(Descriptor.java:873)
>>        at hudson.util.DescribableList.toMap(DescribableList.java:128)
>>        at hudson.model.Project.getPublishers(Project.java:109)
>>        at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
>>        at hudson.model.Run.run(Run.java:1457)
>>        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>>        at hudson.model.ResourceController.execute(ResourceController.java:88)
>>        at hudson.model.Executor.run(Executor.java:238)
>>
>>
>> and when I try and configure the project I can't access email-ext or
>> warnings configuration information:
>> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
>> WARNING: Caught exception evaluating: i.descriptor. Reason:
>> java.lang.reflect.InvocationTargetExcept
>> ion
>> java.lang.reflect.InvocationTargetException
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>        at java.lang.reflect.Method.invoke(Unknown Source)
>>        at 
>> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
>>        at 
>> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
>> pl.java:314)
>>        at 
>> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
>>        at 
>> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
>>        at 
>> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
>>        at 
>> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
>>        at 
>> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
>> 1)
>>        at 
>> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
>>        at 
>> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
>>        at 
>> org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
>>
>>
>>
>> On 11 April 2012 10:53, Ullrich Hafner  wrote:
>>> I haven't yet done that but it should be possible to access the objects
>>> using this method from your script:
>>>
>>> WarningsResultAction action =
>>> getAction("hudson.plugins.warnings.WarningsResultAction")
>>> From this object you get the result using action.getResult()
>>>
>>> Maybe we can work together on making an example for the warnings plug-in
>>> so that I can include it on the wiki page?
>>>
>>> Ulli
>>>
>>>
>>>
>>> On 04/11/2012 11:25 AM, Darren Syzling wrote:
 Regarding the Warnings plugin - is there anyway I can access warning
 informati

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Slide
I also can't seem to get the groovy template to load the
WarningsResultAction class. I tried similar things to what you did
below. I will see if I can figure out what this is the case.

Thanks,

slide

On Wed, Apr 11, 2012 at 5:57 AM, Darren Syzling  wrote:
> Ulli,
>
> I'd be happy to work on something together. I did however try a few
> variants but the hudson.plugins.warnings.WarningsResultAction class
> could not be found, I tried variants of this:
>
> warningsResultAction =
> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
> warningsResultAction =
> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>
> and using the class loader:
> ClassLoader cl = it.class.getClassLoader()
> def warningsClass =
> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>
> Is there something different about the groovy parser engine loaded by
> email-ext which would mean other plugin classes were not available.
>
> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
> Static analysis utilities 1.38
> Warnings 3.28
> Static analysis collector  1.24
> Email-ext  2.18
>
> This has broken my ability to build and configure the project, when I build:
> 11-Apr-2012 13:55:43 hudson.model.Executor run
> SEVERE: Executor threw an exception
> java.lang.AssertionError: class
> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
>        at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
>        at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
>        at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
>        at 
> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
>        at 
> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
>        at hudson.model.Descriptor.toMap(Descriptor.java:873)
>        at hudson.util.DescribableList.toMap(DescribableList.java:128)
>        at hudson.model.Project.getPublishers(Project.java:109)
>        at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
>        at hudson.model.Run.run(Run.java:1457)
>        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>        at hudson.model.ResourceController.execute(ResourceController.java:88)
>        at hudson.model.Executor.run(Executor.java:238)
>
>
> and when I try and configure the project I can't access email-ext or
> warnings configuration information:
> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
> WARNING: Caught exception evaluating: i.descriptor. Reason:
> java.lang.reflect.InvocationTargetExcept
> ion
> java.lang.reflect.InvocationTargetException
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>        at java.lang.reflect.Method.invoke(Unknown Source)
>        at 
> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
>        at 
> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
> pl.java:314)
>        at 
> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
>        at 
> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
>        at 
> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
>        at 
> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
>        at 
> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
> 1)
>        at 
> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
>        at 
> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
>        at 
> org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
>
>
>
> On 11 April 2012 10:53, Ullrich Hafner  wrote:
>> I haven't yet done that but it should be possible to access the objects
>> using this method from your script:
>>
>> WarningsResultAction action =
>> getAction("hudson.plugins.warnings.WarningsResultAction")
>> From this object you get the result using action.getResult()
>>
>> Maybe we can work together on making an example for the warnings plug-in
>> so that I can include it on the wiki page?
>>
>> Ulli
>>
>>
>>
>> On 04/11/2012 11:25 AM, Darren Syzling wrote:
>>> Regarding the Warnings plugin - is there anyway I can access warning
>>> information for the current build from a mail-ext groovy template by
>>> using the hudson/jenkins model API? Or would I use the token macro
>>> expansion plugin in some way? I was wondering if there was a
>>> documented way of gaining access to the WarningsResult and
>>> WarningsResultAction so I could access the getSummary method from
>>> within the mail template (or iterate over other information if
>>> necessary) in a similar way to accessing JUnit test result

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Slide
Do you get an exception when you do that in the email template? Also,
are you importing the necessary items? I'm thinking that the script
console may add some imports by default that the email-ext plugin does
not.

On Wed, Apr 11, 2012 at 8:02 AM, Darren Syzling  wrote:
> Ulli,
>
> Thanks - at the moment this is a background task and I have a few
> other pressing things to attend to so can't hookup via IRC today. But
> yes the warnings are appearing on the build info. And the following
> works from the script console:
>
> cl = getClass().getClassLoader()
> def warningsClass =
> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>
> But doesn't from within the mail template.
>
> Regards
> Darren
>
>
> On 11 April 2012 15:34, Ullrich Hafner  wrote:
>> When I execute the following in Jenkins script console I correctly find
>> the action of a build:
>>
>> println(hudson.model.Hudson.instance.getItem("Your Job
>> Name").getLastBuild().getAction(hudson.plugins.warnings.WarningsResultAction.class))
>>
>> BTW: Maybe we can discuss this topic in our IRC channel then we will
>> have faster feedback than via mail?
>> https://wiki.jenkins-ci.org/display/JENKINS/IRC+Channel
>>
>> Ulli
>>
>> On 04/11/2012 02:57 PM, Darren Syzling wrote:
>>> Ulli,
>>>
>>> I'd be happy to work on something together. I did however try a few
>>> variants but the hudson.plugins.warnings.WarningsResultAction class
>>> could not be found, I tried variants of this:
>>>
>>> warningsResultAction =
>>> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
>>> warningsResultAction =
>>> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>>>
>>> and using the class loader:
>>> ClassLoader cl = it.class.getClassLoader()
>>> def warningsClass =
>>> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>>>
>>> Is there something different about the groovy parser engine loaded by
>>> email-ext which would mean other plugin classes were not available.
>>>
>>> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
>>> Static analysis utilities 1.38
>>> Warnings 3.28
>>> Static analysis collector  1.24
>>> Email-ext  2.18
>>>
>>> This has broken my ability to build and configure the project, when I build:
>>> 11-Apr-2012 13:55:43 hudson.model.Executor run
>>> SEVERE: Executor threw an exception
>>> java.lang.AssertionError: class
>>> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
>>>         at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
>>>         at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
>>>         at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
>>>         at 
>>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
>>>         at 
>>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
>>>         at hudson.model.Descriptor.toMap(Descriptor.java:873)
>>>         at hudson.util.DescribableList.toMap(DescribableList.java:128)
>>>         at hudson.model.Project.getPublishers(Project.java:109)
>>>         at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
>>>         at hudson.model.Run.run(Run.java:1457)
>>>         at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>>>         at 
>>> hudson.model.ResourceController.execute(ResourceController.java:88)
>>>         at hudson.model.Executor.run(Executor.java:238)
>>>
>>>
>>> and when I try and configure the project I can't access email-ext or
>>> warnings configuration information:
>>> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
>>> WARNING: Caught exception evaluating: i.descriptor. Reason:
>>> java.lang.reflect.InvocationTargetExcept
>>> ion
>>> java.lang.reflect.InvocationTargetException
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>         at java.lang.reflect.Method.invoke(Unknown Source)
>>>         at 
>>> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
>>>         at 
>>> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
>>> pl.java:314)
>>>         at 
>>> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
>>>         at 
>>> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
>>>         at 
>>> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
>>>         at 
>>> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
>>>         at 
>>> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
>>> 1)
>>>         at 
>>> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
>>>         at 
>>> hudson.ExpressionFactory2$JexlExpression.evaluate(Expr

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Darren Syzling
Ulli,

Thanks - at the moment this is a background task and I have a few
other pressing things to attend to so can't hookup via IRC today. But
yes the warnings are appearing on the build info. And the following
works from the script console:

cl = getClass().getClassLoader()
def warningsClass =
cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)

But doesn't from within the mail template.

Regards
Darren


On 11 April 2012 15:34, Ullrich Hafner  wrote:
> When I execute the following in Jenkins script console I correctly find
> the action of a build:
>
> println(hudson.model.Hudson.instance.getItem("Your Job
> Name").getLastBuild().getAction(hudson.plugins.warnings.WarningsResultAction.class))
>
> BTW: Maybe we can discuss this topic in our IRC channel then we will
> have faster feedback than via mail?
> https://wiki.jenkins-ci.org/display/JENKINS/IRC+Channel
>
> Ulli
>
> On 04/11/2012 02:57 PM, Darren Syzling wrote:
>> Ulli,
>>
>> I'd be happy to work on something together. I did however try a few
>> variants but the hudson.plugins.warnings.WarningsResultAction class
>> could not be found, I tried variants of this:
>>
>> warningsResultAction =
>> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
>> warningsResultAction =
>> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>>
>> and using the class loader:
>> ClassLoader cl = it.class.getClassLoader()
>> def warningsClass =
>> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>>
>> Is there something different about the groovy parser engine loaded by
>> email-ext which would mean other plugin classes were not available.
>>
>> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
>> Static analysis utilities 1.38
>> Warnings 3.28
>> Static analysis collector  1.24
>> Email-ext  2.18
>>
>> This has broken my ability to build and configure the project, when I build:
>> 11-Apr-2012 13:55:43 hudson.model.Executor run
>> SEVERE: Executor threw an exception
>> java.lang.AssertionError: class
>> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
>>         at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
>>         at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
>>         at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
>>         at 
>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
>>         at 
>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
>>         at hudson.model.Descriptor.toMap(Descriptor.java:873)
>>         at hudson.util.DescribableList.toMap(DescribableList.java:128)
>>         at hudson.model.Project.getPublishers(Project.java:109)
>>         at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
>>         at hudson.model.Run.run(Run.java:1457)
>>         at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>>         at 
>> hudson.model.ResourceController.execute(ResourceController.java:88)
>>         at hudson.model.Executor.run(Executor.java:238)
>>
>>
>> and when I try and configure the project I can't access email-ext or
>> warnings configuration information:
>> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
>> WARNING: Caught exception evaluating: i.descriptor. Reason:
>> java.lang.reflect.InvocationTargetExcept
>> ion
>> java.lang.reflect.InvocationTargetException
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>         at java.lang.reflect.Method.invoke(Unknown Source)
>>         at 
>> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
>>         at 
>> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
>> pl.java:314)
>>         at 
>> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
>>         at 
>> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
>>         at 
>> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
>>         at 
>> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
>>         at 
>> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
>> 1)
>>         at 
>> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
>>         at 
>> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
>>         at 
>> org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
>>
>>
>>
>> On 11 April 2012 10:53, Ullrich Hafner  wrote:
>>> I haven't yet done that but it should be possible to access the objects
>>> using this method from your script:
>>>
>>> WarningsResultAction action =
>>> getAction("hudson.plugins.warnings.WarningsResultActi

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Ullrich Hafner
When I execute the following in Jenkins script console I correctly find
the action of a build:

println(hudson.model.Hudson.instance.getItem("Your Job
Name").getLastBuild().getAction(hudson.plugins.warnings.WarningsResultAction.class))

BTW: Maybe we can discuss this topic in our IRC channel then we will
have faster feedback than via mail?
https://wiki.jenkins-ci.org/display/JENKINS/IRC+Channel
 
Ulli

On 04/11/2012 02:57 PM, Darren Syzling wrote:
> Ulli,
>
> I'd be happy to work on something together. I did however try a few
> variants but the hudson.plugins.warnings.WarningsResultAction class
> could not be found, I tried variants of this:
>
> warningsResultAction =
> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
> warningsResultAction =
> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>
> and using the class loader:
> ClassLoader cl = it.class.getClassLoader()
> def warningsClass =
> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>
> Is there something different about the groovy parser engine loaded by
> email-ext which would mean other plugin classes were not available.
>
> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
> Static analysis utilities 1.38
> Warnings 3.28
> Static analysis collector  1.24
> Email-ext  2.18
>
> This has broken my ability to build and configure the project, when I build:
> 11-Apr-2012 13:55:43 hudson.model.Executor run
> SEVERE: Executor threw an exception
> java.lang.AssertionError: class
> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
> at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
> at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
> at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
> at 
> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
> at 
> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
> at hudson.model.Descriptor.toMap(Descriptor.java:873)
> at hudson.util.DescribableList.toMap(DescribableList.java:128)
> at hudson.model.Project.getPublishers(Project.java:109)
> at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
> at hudson.model.Run.run(Run.java:1457)
> at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
> at hudson.model.ResourceController.execute(ResourceController.java:88)
> at hudson.model.Executor.run(Executor.java:238)
>
>
> and when I try and configure the project I can't access email-ext or
> warnings configuration information:
> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
> WARNING: Caught exception evaluating: i.descriptor. Reason:
> java.lang.reflect.InvocationTargetExcept
> ion
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at 
> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
> at 
> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
> pl.java:314)
> at 
> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
> at 
> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
> at 
> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
> at 
> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
> at 
> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
> 1)
> at 
> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
> at 
> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
> at 
> org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
>
>
>
> On 11 April 2012 10:53, Ullrich Hafner  wrote:
>> I haven't yet done that but it should be possible to access the objects
>> using this method from your script:
>>
>> WarningsResultAction action =
>> getAction("hudson.plugins.warnings.WarningsResultAction")
>> From this object you get the result using action.getResult()
>>
>> Maybe we can work together on making an example for the warnings plug-in
>> so that I can include it on the wiki page?
>>
>> Ulli
>>
>>
>>
>> On 04/11/2012 11:25 AM, Darren Syzling wrote:
>>> Regarding the Warnings plugin - is there anyway I can access warning
>>> information for the current build from a mail-ext groovy template by
>>> using the hudson/jenkins model API? Or would I use the token macro
>>> expansion plugin in some way? I was wondering if there was a
>>> documented way of gaining access to t

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Ullrich Hafner
Hmm, that is strange. Classloading should be straight forward. Seems
that the installation is corrupt. Is the warnings plug-in showing up in
Jenkins?

Ulli

On 04/11/2012 02:57 PM, Darren Syzling wrote:
> Ulli,
>
> I'd be happy to work on something together. I did however try a few
> variants but the hudson.plugins.warnings.WarningsResultAction class
> could not be found, I tried variants of this:
>
> warningsResultAction =
> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
> warningsResultAction =
> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>
> and using the class loader:
> ClassLoader cl = it.class.getClassLoader()
> def warningsClass =
> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>
> Is there something different about the groovy parser engine loaded by
> email-ext which would mean other plugin classes were not available.
>
> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
> Static analysis utilities 1.38
> Warnings 3.28
> Static analysis collector  1.24
> Email-ext  2.18
>
> This has broken my ability to build and configure the project, when I build:
> 11-Apr-2012 13:55:43 hudson.model.Executor run
> SEVERE: Executor threw an exception
> java.lang.AssertionError: class
> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
> at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
> at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
> at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
> at 
> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
> at 
> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
> at hudson.model.Descriptor.toMap(Descriptor.java:873)
> at hudson.util.DescribableList.toMap(DescribableList.java:128)
> at hudson.model.Project.getPublishers(Project.java:109)
> at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
> at hudson.model.Run.run(Run.java:1457)
> at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
> at hudson.model.ResourceController.execute(ResourceController.java:88)
> at hudson.model.Executor.run(Executor.java:238)
>
>
> and when I try and configure the project I can't access email-ext or
> warnings configuration information:
> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
> WARNING: Caught exception evaluating: i.descriptor. Reason:
> java.lang.reflect.InvocationTargetExcept
> ion
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at 
> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
> at 
> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
> pl.java:314)
> at 
> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
> at 
> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
> at 
> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
> at 
> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
> at 
> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
> 1)
> at 
> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
> at 
> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
> at 
> org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
>
>
>
> On 11 April 2012 10:53, Ullrich Hafner  wrote:
>> I haven't yet done that but it should be possible to access the objects
>> using this method from your script:
>>
>> WarningsResultAction action =
>> getAction("hudson.plugins.warnings.WarningsResultAction")
>> From this object you get the result using action.getResult()
>>
>> Maybe we can work together on making an example for the warnings plug-in
>> so that I can include it on the wiki page?
>>
>> Ulli
>>
>>
>>
>> On 04/11/2012 11:25 AM, Darren Syzling wrote:
>>> Regarding the Warnings plugin - is there anyway I can access warning
>>> information for the current build from a mail-ext groovy template by
>>> using the hudson/jenkins model API? Or would I use the token macro
>>> expansion plugin in some way? I was wondering if there was a
>>> documented way of gaining access to the WarningsResult and
>>> WarningsResultAction so I could access the getSummary method from
>>> within the mail template (or iterate over other information if
>>> necessary) in a similar way to accessing JUnit test results?  I
>>> wondered if there 

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Darren Syzling
In the meantime I've reverted back to Analysis Collector 1.19.


-- 
Regards
Darren


On 11 April 2012 14:10, Darren Syzling  wrote:
> Yes sorry email-ext 2.19 installed.
>
>
> On 11 April 2012 14:05, Slide  wrote:
>> I hope you mean email-ext 2.19. There is nothing different about the groovy
>> implementation in email-ext, it uses the same one as the rest of Jenkins.
>>
>> On Apr 11, 2012 5:57 AM, "Darren Syzling"  wrote:
>>>
>>> Ulli,
>>>
>>> I'd be happy to work on something together. I did however try a few
>>> variants but the hudson.plugins.warnings.WarningsResultAction class
>>> could not be found, I tried variants of this:
>>>
>>> warningsResultAction =
>>>
>>> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
>>> warningsResultAction =
>>> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>>>
>>> and using the class loader:
>>> ClassLoader cl = it.class.getClassLoader()
>>> def warningsClass =
>>> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>>>
>>> Is there something different about the groovy parser engine loaded by
>>> email-ext which would mean other plugin classes were not available.
>>>
>>> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
>>> Static analysis utilities 1.38
>>> Warnings 3.28
>>> Static analysis collector  1.24
>>> Email-ext  2.18
>>>
>>> This has broken my ability to build and configure the project, when I
>>> build:
>>> 11-Apr-2012 13:55:43 hudson.model.Executor run
>>> SEVERE: Executor threw an exception
>>> java.lang.AssertionError: class
>>> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
>>>        at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
>>>        at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
>>>        at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
>>>        at
>>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
>>>        at
>>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
>>>        at hudson.model.Descriptor.toMap(Descriptor.java:873)
>>>        at hudson.util.DescribableList.toMap(DescribableList.java:128)
>>>        at hudson.model.Project.getPublishers(Project.java:109)
>>>        at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
>>>        at hudson.model.Run.run(Run.java:1457)
>>>        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>>>        at
>>> hudson.model.ResourceController.execute(ResourceController.java:88)
>>>        at hudson.model.Executor.run(Executor.java:238)
>>>
>>>
>>> and when I try and configure the project I can't access email-ext or
>>> warnings configuration information:
>>> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
>>> WARNING: Caught exception evaluating: i.descriptor. Reason:
>>> java.lang.reflect.InvocationTargetExcept
>>> ion
>>> java.lang.reflect.InvocationTargetException
>>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>        at java.lang.reflect.Method.invoke(Unknown Source)
>>>        at
>>> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
>>>        at
>>> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
>>> pl.java:314)
>>>        at
>>> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
>>>        at
>>> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
>>>        at
>>> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
>>>        at
>>> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
>>>        at
>>> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
>>> 1)
>>>        at
>>> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
>>>        at
>>> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
>>>        at
>>> org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
>>>
>>>
>>>
>>> On 11 April 2012 10:53, Ullrich Hafner  wrote:
>>> > I haven't yet done that but it should be possible to access the objects
>>> > using this method from your script:
>>> >
>>> > WarningsResultAction action =
>>> > getAction("hudson.plugins.warnings.WarningsResultAction")
>>> > From this object you get the result using action.getResult()
>>> >
>>> > Maybe we can work together on making an example for the warnings plug-in
>>> > so that I can include it on the wiki page?
>>> >
>>> > Ulli
>>> >
>>> >
>>> >
>>> > On 04/11/2012 11:25 AM, Darren Syzling wrote:
>>> >> Regarding the Warnings plugin - is there anyway I can access warning
>>> >> information for the current build from a mail-ext groovy template by
>>> >>

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Darren Syzling
Yes sorry email-ext 2.19 installed.


On 11 April 2012 14:05, Slide  wrote:
> I hope you mean email-ext 2.19. There is nothing different about the groovy
> implementation in email-ext, it uses the same one as the rest of Jenkins.
>
> On Apr 11, 2012 5:57 AM, "Darren Syzling"  wrote:
>>
>> Ulli,
>>
>> I'd be happy to work on something together. I did however try a few
>> variants but the hudson.plugins.warnings.WarningsResultAction class
>> could not be found, I tried variants of this:
>>
>> warningsResultAction =
>>
>> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
>> warningsResultAction =
>> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>>
>> and using the class loader:
>> ClassLoader cl = it.class.getClassLoader()
>> def warningsClass =
>> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>>
>> Is there something different about the groovy parser engine loaded by
>> email-ext which would mean other plugin classes were not available.
>>
>> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
>> Static analysis utilities 1.38
>> Warnings 3.28
>> Static analysis collector  1.24
>> Email-ext  2.18
>>
>> This has broken my ability to build and configure the project, when I
>> build:
>> 11-Apr-2012 13:55:43 hudson.model.Executor run
>> SEVERE: Executor threw an exception
>> java.lang.AssertionError: class
>> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
>>        at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
>>        at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
>>        at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
>>        at
>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
>>        at
>> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
>>        at hudson.model.Descriptor.toMap(Descriptor.java:873)
>>        at hudson.util.DescribableList.toMap(DescribableList.java:128)
>>        at hudson.model.Project.getPublishers(Project.java:109)
>>        at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
>>        at hudson.model.Run.run(Run.java:1457)
>>        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>>        at
>> hudson.model.ResourceController.execute(ResourceController.java:88)
>>        at hudson.model.Executor.run(Executor.java:238)
>>
>>
>> and when I try and configure the project I can't access email-ext or
>> warnings configuration information:
>> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
>> WARNING: Caught exception evaluating: i.descriptor. Reason:
>> java.lang.reflect.InvocationTargetExcept
>> ion
>> java.lang.reflect.InvocationTargetException
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>        at java.lang.reflect.Method.invoke(Unknown Source)
>>        at
>> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
>>        at
>> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
>> pl.java:314)
>>        at
>> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
>>        at
>> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
>>        at
>> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
>>        at
>> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
>>        at
>> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
>> 1)
>>        at
>> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
>>        at
>> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
>>        at
>> org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
>>
>>
>>
>> On 11 April 2012 10:53, Ullrich Hafner  wrote:
>> > I haven't yet done that but it should be possible to access the objects
>> > using this method from your script:
>> >
>> > WarningsResultAction action =
>> > getAction("hudson.plugins.warnings.WarningsResultAction")
>> > From this object you get the result using action.getResult()
>> >
>> > Maybe we can work together on making an example for the warnings plug-in
>> > so that I can include it on the wiki page?
>> >
>> > Ulli
>> >
>> >
>> >
>> > On 04/11/2012 11:25 AM, Darren Syzling wrote:
>> >> Regarding the Warnings plugin - is there anyway I can access warning
>> >> information for the current build from a mail-ext groovy template by
>> >> using the hudson/jenkins model API? Or would I use the token macro
>> >> expansion plugin in some way? I was wondering if there was a
>> >> documented way of gaining access to the WarningsResult and
>> >> WarningsResultAction so I could access the 

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Slide
I hope you mean email-ext 2.19. There is nothing different about the groovy
implementation in email-ext, it uses the same one as the rest of Jenkins.
On Apr 11, 2012 5:57 AM, "Darren Syzling"  wrote:

> Ulli,
>
> I'd be happy to work on something together. I did however try a few
> variants but the hudson.plugins.warnings.WarningsResultAction class
> could not be found, I tried variants of this:
>
> warningsResultAction =
>
> build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
> warningsResultAction =
> build.getAction(hudson.plugins.warnings.WarningsResultAction.class)
>
> and using the class loader:
> ClassLoader cl = it.class.getClassLoader()
> def warningsClass =
> cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)
>
> Is there something different about the groovy parser engine loaded by
> email-ext which would mean other plugin classes were not available.
>
> Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
> Static analysis utilities 1.38
> Warnings 3.28
> Static analysis collector  1.24
> Email-ext  2.18
>
> This has broken my ability to build and configure the project, when I
> build:
> 11-Apr-2012 13:55:43 hudson.model.Executor run
> SEVERE: Executor threw an exception
> java.lang.AssertionError: class
> hudson.plugins.warnings.WarningsPublisher is missing its descriptor
>at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
>at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
>at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
>at
> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
>at
> hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
>at hudson.model.Descriptor.toMap(Descriptor.java:873)
>at hudson.util.DescribableList.toMap(DescribableList.java:128)
>at hudson.model.Project.getPublishers(Project.java:109)
>at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
>at hudson.model.Run.run(Run.java:1457)
>at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>at
> hudson.model.ResourceController.execute(ResourceController.java:88)
>at hudson.model.Executor.run(Executor.java:238)
>
>
> and when I try and configure the project I can't access email-ext or
> warnings configuration information:
> 11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
> WARNING: Caught exception evaluating: i.descriptor. Reason:
> java.lang.reflect.InvocationTargetExcept
> ion
> java.lang.reflect.InvocationTargetException
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>at java.lang.reflect.Method.invoke(Unknown Source)
>at
> org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
>at
> org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
> pl.java:314)
>at
> org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
>at
> org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
>at
> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
>at
> org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
>at
> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
> 1)
>at
> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
>at
> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
>at
> org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
>
>
>
> On 11 April 2012 10:53, Ullrich Hafner  wrote:
> > I haven't yet done that but it should be possible to access the objects
> > using this method from your script:
> >
> > WarningsResultAction action =
> > getAction("hudson.plugins.warnings.WarningsResultAction")
> > From this object you get the result using action.getResult()
> >
> > Maybe we can work together on making an example for the warnings plug-in
> > so that I can include it on the wiki page?
> >
> > Ulli
> >
> >
> >
> > On 04/11/2012 11:25 AM, Darren Syzling wrote:
> >> Regarding the Warnings plugin - is there anyway I can access warning
> >> information for the current build from a mail-ext groovy template by
> >> using the hudson/jenkins model API? Or would I use the token macro
> >> expansion plugin in some way? I was wondering if there was a
> >> documented way of gaining access to the WarningsResult and
> >> WarningsResultAction so I could access the getSummary method from
> >> within the mail template (or iterate over other information if
> >> necessary) in a similar way to accessing JUnit test results?  I
> >> wondered if there was a stand

Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Darren Syzling
Ulli,

I'd be happy to work on something together. I did however try a few
variants but the hudson.plugins.warnings.WarningsResultAction class
could not be found, I tried variants of this:

warningsResultAction =
build.getAction(Class.forName("hudson.plugins.warnings.WarningsResultAction"))
warningsResultAction =
build.getAction(hudson.plugins.warnings.WarningsResultAction.class)

and using the class loader:
ClassLoader cl = it.class.getClassLoader()
def warningsClass =
cl.loadClass("hudson.plugins.warnings.WarningsResultAction", true)

Is there something different about the groovy parser engine loaded by
email-ext which would mean other plugin classes were not available.

Unfortunately I then decided to upgrade to Jenkins 1.459 along with:
Static analysis utilities 1.38
Warnings 3.28
Static analysis collector  1.24
Email-ext  2.18

This has broken my ability to build and configure the project, when I build:
11-Apr-2012 13:55:43 hudson.model.Executor run
SEVERE: Executor threw an exception
java.lang.AssertionError: class
hudson.plugins.warnings.WarningsPublisher is missing its descriptor
at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1076)
at hudson.tasks.Publisher.getDescriptor(Publisher.java:123)
at hudson.tasks.Recorder.getDescriptor(Recorder.java:51)
at 
hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:323)
at 
hudson.plugins.warnings.WarningsPublisher.getDescriptor(WarningsPublisher.java:41)
at hudson.model.Descriptor.toMap(Descriptor.java:873)
at hudson.util.DescribableList.toMap(DescribableList.java:128)
at hudson.model.Project.getPublishers(Project.java:109)
at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
at hudson.model.Run.run(Run.java:1457)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)


and when I try and configure the project I can't access email-ext or
warnings configuration information:
11-Apr-2012 13:46:50 hudson.ExpressionFactory2$JexlExpression evaluate
WARNING: Caught exception evaluating: i.descriptor. Reason:
java.lang.reflect.InvocationTargetExcept
ion
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at 
org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
at 
org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectIm
pl.java:314)
at 
org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
at 
org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
at 
org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
at 
org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
at 
org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:5
1)
at 
org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
at 
hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
at 
org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)



On 11 April 2012 10:53, Ullrich Hafner  wrote:
> I haven't yet done that but it should be possible to access the objects
> using this method from your script:
>
> WarningsResultAction action =
> getAction("hudson.plugins.warnings.WarningsResultAction")
> From this object you get the result using action.getResult()
>
> Maybe we can work together on making an example for the warnings plug-in
> so that I can include it on the wiki page?
>
> Ulli
>
>
>
> On 04/11/2012 11:25 AM, Darren Syzling wrote:
>> Regarding the Warnings plugin - is there anyway I can access warning
>> information for the current build from a mail-ext groovy template by
>> using the hudson/jenkins model API? Or would I use the token macro
>> expansion plugin in some way? I was wondering if there was a
>> documented way of gaining access to the WarningsResult and
>> WarningsResultAction so I could access the getSummary method from
>> within the mail template (or iterate over other information if
>> necessary) in a similar way to accessing JUnit test results?  I
>> wondered if there was a standard way for plugins to publish their
>> action results into the Hudson model so that post build actions could
>> retrieve and process them,
>>
>>
>



-- 
Regards
Darren


Re: Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Ullrich Hafner
I haven't yet done that but it should be possible to access the objects
using this method from your script:

WarningsResultAction action =
getAction("hudson.plugins.warnings.WarningsResultAction")
>From this object you get the result using action.getResult()

Maybe we can work together on making an example for the warnings plug-in
so that I can include it on the wiki page?

Ulli



On 04/11/2012 11:25 AM, Darren Syzling wrote:
> Regarding the Warnings plugin - is there anyway I can access warning
> information for the current build from a mail-ext groovy template by
> using the hudson/jenkins model API? Or would I use the token macro
> expansion plugin in some way? I was wondering if there was a
> documented way of gaining access to the WarningsResult and
> WarningsResultAction so I could access the getSummary method from
> within the mail template (or iterate over other information if
> necessary) in a similar way to accessing JUnit test results?  I
> wondered if there was a standard way for plugins to publish their
> action results into the Hudson model so that post build actions could
> retrieve and process them,
>
>



Warnings Plugin and Mail-ext Integration

2012-04-11 Thread Darren Syzling
Regarding the Warnings plugin - is there anyway I can access warning
information for the current build from a mail-ext groovy template by
using the hudson/jenkins model API? Or would I use the token macro
expansion plugin in some way? I was wondering if there was a
documented way of gaining access to the WarningsResult and
WarningsResultAction so I could access the getSummary method from
within the mail template (or iterate over other information if
necessary) in a similar way to accessing JUnit test results?  I
wondered if there was a standard way for plugins to publish their
action results into the Hudson model so that post build actions could
retrieve and process them,


-- 
Regards
Darren