continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1159490 - in /continuum/branches/continuum-1.3.x: continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ continuum-core/src/main/java/org/apache/continuum/builder/distributed/
Date Fri, 19 Aug 2011 03:14:22 GMT
Author: ctan
Date: Fri Aug 19 03:14:22 2011
New Revision: 1159490

URL: http://svn.apache.org/viewvc?rev=1159490&view=rev
Log:
[CONTINUUM-2626] do not override the notifiers created by the users from UI and return the
project notifiers when updating project after checkout with distributed builds

Submitted By: Bodhayan Chakraborty
with modifications


Modified:
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java?rev=1159490&r1=1159489&r2=1159490&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/AbstractBuildExecutor.java
Fri Aug 19 03:14:22 2011
@@ -494,7 +494,6 @@ public abstract class AbstractBuildExecu
         return pDependencies;
     }
 
-    //TODO: Check the content of this method, it always return an empty list
     protected List<Map<String, Object>> getProjectNotifiers( List<ProjectNotifier>
notifiers )
     {
         List<Map<String, Object>> pNotifiers = new ArrayList<Map<String,
Object>>();
@@ -529,6 +528,7 @@ public abstract class AbstractBuildExecu
                 map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_FAILURE, notifier.isSendOnFailure()
);
                 map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_SCMFAILURE, notifier.isSendOnScmFailure()
);
                 map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_WARNING, notifier.isSendOnWarning()
);
+                pNotifiers.add(map);
             }
         }
         return pNotifiers;

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java?rev=1159490&r1=1159489&r2=1159490&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java
Fri Aug 19 03:14:22 2011
@@ -291,7 +291,7 @@ public class DefaultDistributedBuildServ
     {
         try
         {
-            Project project = projectDao.getProject( ContinuumBuildConstant.getProjectId(
context ) );
+            Project project = projectDao.getProjectWithAllDetails( ContinuumBuildConstant.getProjectId(
context ) );
     
             if ( StringUtils.isNotBlank( ContinuumBuildConstant.getGroupId( context ) ) )
             {
@@ -328,7 +328,48 @@ public class DefaultDistributedBuildServ
             project.setParent( getProjectParent( context ) );
             project.setDependencies( getProjectDependencies( context ) );
             project.setDevelopers( getProjectDevelopers( context ) );
+
+            List<ProjectNotifier> userNotifiers = new ArrayList<ProjectNotifier>();
+
+            if ( project.getNotifiers() != null )
+            {
+                for ( ProjectNotifier notifier : project.getNotifiers() )
+                {
+                    if ( notifier.isFromUser() )
+                    {
+                        ProjectNotifier userNotifier = new ProjectNotifier();
+
+                        userNotifier.setType( notifier.getType() );
+
+                        userNotifier.setEnabled( notifier.isEnabled() );
+
+                        userNotifier.setConfiguration( notifier.getConfiguration() );
+
+                        userNotifier.setFrom( notifier.getFrom() );
+
+                        userNotifier.setRecipientType( notifier.getRecipientType() );
+
+                        userNotifier.setSendOnError( notifier.isSendOnError() );
+
+                        userNotifier.setSendOnFailure( notifier.isSendOnFailure() );
+
+                        userNotifier.setSendOnSuccess( notifier.isSendOnSuccess() );
+
+                        userNotifier.setSendOnWarning( notifier.isSendOnWarning() );
+
+                        userNotifier.setSendOnScmFailure( notifier.isSendOnScmFailure() );
+
+                        userNotifiers.add( userNotifier );
+                    }
+                }
+            }
+
             project.setNotifiers( getProjectNotifiers( context ) );
+
+            for ( ProjectNotifier userNotifier : userNotifiers )
+            {
+                project.addNotifier( userNotifier );
+            }
     
             projectDao.updateProject( project );
         }



Mime
View raw message