continuum-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Nichele <stefano.nich...@gmail.com>
Subject Re: Notification emails always sent and not just in failure case
Date Fri, 15 Aug 2008 09:04:27 GMT
Done:
http://jira.codehaus.org/browse/CONTINUUM-1845

Cheers,
ste

Brett Porter wrote:
> Thanks for this! Can you create a JIRA issue to attach it to, so it
> can be included in the next release?
>
> Cheers,
> Brett
>
> 2008/8/15 Stefano Nichele <stefano.nichele@gmail.com>:
>   
>> I did a path for that (in attachment with also the final jar file) using
>> "continuum-1.1" tag as code base.
>> In any case, this was the expected behavior so maybe a configuration
>> property to choice the preferred behavior could be useful.
>>
>> The jar, for who is interested, should the replace the original one in
>> ./apps/continuum/webapp/WEB-INF/lib/
>>
>> Cheers
>> ste
>>
>> Stefano Nichele wrote:
>>     
>>> (....sorry, I sent  an incomplete message...doing other tests....)
>>>
>>> Indeed if the build fails the notification is always sent. But trying with
>>>  "Success" the notification is not sent and in the log I see:
>>>
>>> 20037612 [pool-1-thread-1] INFO
>>>  org.codehaus.plexus.notification.notifier.Notifier:mail  - Same state, not
>>> sending mess age.
>>>
>>> I agree that is a bug.
>>>
>>> ste
>>>
>>> Marose, Justin (GE EntSol, Security) wrote:
>>>       
>>>> I am  having the same issue.  Notifications are sent for every build for
>>>> every state (successful, failure, etc.), even if they aren't configured
>>>> that way in continuum.
>>>> I also have <alwaysSend> set to true.  I have set this because I want
>>>> Continuum to send notifications for the selected states to the
>>>> configured notifiers every time the project is built and that state is
>>>> the outcome.  As you probably know, by default, notifications are only
>>>> sent when a state changes.
>>>>
>>>> This is really not desired behavior.  What I want is simple: send
>>>> notifications when the configured state (successful, failure, etc.) is
>>>> met for the configured notifiers, and every time that state is met.
>>>>
>>>> This seems like a bug to me.  Any thoughts?
>>>>
>>>> -----Original Message-----
>>>> From: Stefano Nichele [mailto:stefano.nichele@gmail.com] Sent: Thursday,
>>>> August 14, 2008 5:11 AM
>>>> To: users@continuum.apache.org
>>>> Subject: Re: Notification emails always sent and not just in failure
>>>> case
>>>>
>>>> Yeap !
>>>> Thanks a lot for your help !
>>>>
>>>> ste
>>>>
>>>> Brett Porter wrote:
>>>>
>>>>         
>>>>> Do you happen to have <alwaysSend> set to true in
>>>>> apps/continuum/webapp/WEB-INF/classes/META-INF/plexus/application.xml
>>>>> ?
>>>>>
>>>>> - Brett
>>>>>
>>>>> 2008/8/14 Stefano Nichele <stefano.nichele@gmail.com>:
>>>>>
>>>>>           
>>>>>> It's sent to the configured address.
>>>>>>
>>>>>> ste
>>>>>>
>>>>>> Brett Porter wrote:
>>>>>>
>>>>>>             
>>>>>>> is it being sent to the address you configured, or yourself as
the
>>>>>>> committer that made the change?
>>>>>>>
>>>>>>> 2008/8/14 Stefano Nichele <stefano.nichele@gmail.com>:
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> No, there is a notifier only on the group.
>>>>>>>> I tried deleting the notifier on the group and adding a notifier
on
>>>>>>>>
>>>>>>>>                 
>>>>         
>>>>>>>> the project, but I still have the same issue.
>>>>>>>>
>>>>>>>> ste
>>>>>>>>
>>>>>>>> Brett Porter wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>>>>> Is there a notifier on the project as well as the group
perhaps?
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> Brett
>>>>>>>>>
>>>>>>>>> 2008/8/13 Stefano Nichele <nichele@funambol.com>:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                   
>>>>>>>>>> Hi All,
>>>>>>>>>> I have a strange behavior with the notification emails.
>>>>>>>>>> I have a project group and for  this groups I set
a Notifier of
>>>>>>>>>> type 'Mail"
>>>>>>>>>> selecting just 'Send on Failure'. My issue is that
I receive an
>>>>>>>>>> email always also in case of success.
>>>>>>>>>>
>>>>>>>>>> Any suggestion ? I have missed some configuration
?
>>>>>>>>>>
>>>>>>>>>> Thanks in advance.
>>>>>>>>>> ste
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                     
>>>>>>>>>                   
>>>>>>>>                 
>>>>>>>               
>>>>>> --
>>>>>> Stefano Nichele
>>>>>>
>>>>>> Funambol Servers Tech Lead
>>>>>> funambol :: mobile open source :: http://www.funambol.com
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>           
>>>> --
>>>> Stefano Nichele
>>>>
>>>> Funambol Servers Tech Lead
>>>> funambol :: mobile open source :: http://www.funambol.com
>>>>
>>>>
>>>>
>>>>         
>>>       
>> --
>> Stefano Nichele
>>
>> Funambol Servers Tech Lead
>> funambol :: mobile open source :: http://www.funambol.com
>>
>>
>> Index:
>> src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
>> ===================================================================
>> ---
>> src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
>>        (revisione 685931)
>> +++
>> src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
>>        (copia locale)
>> @@ -112,74 +112,31 @@
>>             return true;
>>         }
>>
>> -        if ( build.getState() == ContinuumProjectState.FAILED &&
>> projectNotifier.isSendOnFailure() )
>> +        if ( build.getState() == ContinuumProjectState.ERROR )
>>         {
>> -            return true;
>> +            return projectNotifier.isSendOnError();
>>         }
>>
>> -        if ( build.getState() == ContinuumProjectState.ERROR &&
>> projectNotifier.isSendOnError() )
>> +        if ( build.getState() == ContinuumProjectState.FAILED )
>>         {
>> -            return true;
>> +            return projectNotifier.isSendOnFailure();
>>         }
>>
>> -        // Send if this is the first build
>> -        if ( previousBuild == null )
>> +        if ( build.getState() == ContinuumProjectState.OK )
>>         {
>> -            if ( build.getState() == ContinuumProjectState.ERROR )
>> -            {
>> -                return projectNotifier.isSendOnError();
>> -            }
>> -
>> -            if ( build.getState() == ContinuumProjectState.FAILED )
>> -            {
>> -                return projectNotifier.isSendOnFailure();
>> -            }
>> -
>> -            if ( build.getState() == ContinuumProjectState.OK )
>> -            {
>> -                return projectNotifier.isSendOnSuccess();
>> -            }
>> -
>> -            if ( build.getState() == ContinuumProjectState.WARNING )
>> -            {
>> -                return projectNotifier.isSendOnWarning();
>> -            }
>> -
>> -            return true;
>> +            return projectNotifier.isSendOnSuccess();
>>         }
>>
>> -        // Send if the state has changed
>> -        getLogger().debug(
>> -            "Current build state: " + build.getState() + ", previous build
>> state: " + previousBuild.getState() );
>> -
>> -        if ( build.getState() != previousBuild.getState() )
>> +        if ( build.getState() == ContinuumProjectState.WARNING )
>>         {
>> -            if ( build.getState() == ContinuumProjectState.ERROR )
>> -            {
>> -                return projectNotifier.isSendOnError();
>> -            }
>> -
>> -            if ( build.getState() == ContinuumProjectState.FAILED )
>> -            {
>> -                return projectNotifier.isSendOnFailure();
>> -            }
>> -
>> -            if ( build.getState() == ContinuumProjectState.OK )
>> -            {
>> -                return projectNotifier.isSendOnSuccess();
>> -            }
>> -
>> -            if ( build.getState() == ContinuumProjectState.WARNING )
>> -            {
>> -                return projectNotifier.isSendOnWarning();
>> -            }
>> -
>> -            return true;
>> +            return projectNotifier.isSendOnWarning();
>>         }
>>
>> -        getLogger().info( "Same state, not sending message." );
>> -
>> +        getLogger().info( "Not sending message (current state: "  +
>> build.getState() + ")" );
>> +
>>         return false;
>> +
>> +
>>     }
>>
>>     protected BuildResult getPreviousBuild( Project project, BuildDefinition
>> buildDef, BuildResult currentBuild )
>>
>>
>>     
>
>
>
>   


-- 
Stefano Nichele

Funambol Servers Tech Lead
funambol :: mobile open source :: http://www.funambol.com


Mime
View raw message