continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r326234 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/ continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuum-core/src/main/java/org/apache/maven/continuum/scm/ ...
Date Tue, 18 Oct 2005 20:55:19 GMT
Author: evenisse
Date: Tue Oct 18 13:55:07 2005
New Revision: 326234

URL: http://svn.apache.org/viewcvs?rev=326234&view=rev
Log:
[CONTINUUM-357] Fix "ERROR: Unknown build state 0" message

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=326234&r1=326233&r2=326234&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Tue Oct 18 13:55:07 2005
@@ -142,15 +142,17 @@
 
                 if ( scmResult == null || !scmResult.isSuccess() )
                 {
-                    build = makeBuildResult( scmResult, startTime, trigger );
+                    build = makeAndStoreBuildResult( project, scmResult, startTime, trigger
);
 
                     String error = convertScmResultToError( scmResult );
 
                     build.setError( error );
 
-                    store.addBuildResult( project, build );
+                    store.updateBuildResult( build );
+
+                    build = store.getBuildResult( build.getId() );
 
-                    project.setState( ContinuumProjectState.ERROR );
+                    project.setState( build.getState() );
 
                     store.updateProject( project );
 
@@ -166,6 +168,7 @@
                 actionManager.lookup( "execute-builder" ).execute( actionContext );
 
                 String s = (String) actionContext.get( AbstractContinuumAction.KEY_BUILD_ID
);
+
                 if ( s != null )
                 {
                     build = store.getBuildResult( Integer.valueOf( s ).intValue() );
@@ -176,13 +179,14 @@
                 getLogger().error( "Error while building project.", e );
 
                 String s = (String) actionContext.get( AbstractContinuumAction.KEY_BUILD_ID
);
+
                 if ( s != null )
                 {
                     build = store.getBuildResult( Integer.valueOf( s ).intValue() );
                 }
                 else
                 {
-                    build = makeBuildResult( scmResult, startTime, trigger );
+                    build = makeAndStoreBuildResult( project, scmResult, startTime, trigger
);
                 }
 
                 // This can happen if the "update project from scm" action fails
@@ -208,16 +212,11 @@
 
                 build.setError( error );
 
-                if ( s != null )
-                {
-                    store.updateBuildResult( build );
-                }
-                else
-                {
-                    store.addBuildResult( project, build );
-                }
+                store.updateBuildResult( build );
+
+                build = store.getBuildResult( build.getId() );
 
-                project.setState( ContinuumProjectState.ERROR );
+                project.setState( build.getState() );
 
                 store.updateProject( project );
             }
@@ -281,7 +280,8 @@
     //
     // ----------------------------------------------------------------------
 
-    private BuildResult makeBuildResult( ScmResult scmResult, long startTime, int trigger
)
+    private BuildResult makeAndStoreBuildResult( Project project, ScmResult scmResult, long
startTime, int trigger )
+        throws ContinuumStoreException
     {
         BuildResult build = new BuildResult();
 
@@ -295,6 +295,8 @@
 
         build.setScmResult( scmResult );
 
-        return build;
+        store.addBuildResult( project, build );
+
+        return store.getBuildResult( build.getId() );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=326234&r1=326233&r2=326234&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
Tue Oct 18 13:55:07 2005
@@ -157,6 +157,8 @@
 
             store.updateBuildResult( build );
 
+            build = store.getBuildResult( build.getId() );
+
             store.updateProject( project );
 
             notifier.goalsCompleted( project, build );

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java?rev=326234&r1=326233&r2=326234&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
Tue Oct 18 13:55:07 2005
@@ -111,8 +111,6 @@
                 getLogger().warn( "Command output: " + result.getCommandOutput() );
 
                 getLogger().warn( "Provider message: " + result.getProviderMessage() );
-
-                throw new ContinuumScmException( "Error while checking out the project.",
result );
             }
 
             ChangeSet changeSet = (ChangeSet) result.getChanges().get( 0 );
@@ -187,8 +185,6 @@
                 getLogger().warn( "Command output: " + result.getCommandOutput() );
 
                 getLogger().warn( "Provider message: " + result.getProviderMessage() );
-
-                throw new ContinuumScmException( "Error while updating the project.", result
);
             }
 
             // TODO: total the number of files in the changesets

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java?rev=326234&r1=326233&r2=326234&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
Tue Oct 18 13:55:07 2005
@@ -40,8 +40,11 @@
         Project project = addProject( store, "Notification Dispatcher Test Project" );
 
         BuildResult build = new BuildResult();
+
         build.setStartTime( System.currentTimeMillis() );
+ 
         build.setState( ContinuumProjectState.BUILDING );
+ 
         build.setTrigger( ContinuumProjectState.TRIGGER_UNKNOWN );
 
         store.addBuildResult( project, build );

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm?rev=326234&r1=326233&r2=326234&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm Tue
Oct 18 13:55:07 2005
@@ -86,6 +86,8 @@
 
         #if ( $item.state == 1 || $item.state == 2 || $item.state == 3 || $item.state ==
4 || $item.state == 6 )
         <td><a href="$link.setPage('WorkingCopy.vm').addPathInfo('view', "WorkingCopy").addPathInfo('id',
$item.id)">Working&nbsp;Copy</a></td>
+        #else
+        <td>Working&nbsp;Copy</td>
         #end
 
         #if ( $continuum.security.isAuthorized( $c1user, "deleteProject" ) )



Mime
View raw message