continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1675842 - in /continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/ continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ continuum-we...
Date Fri, 24 Apr 2015 13:24:34 GMT
Author: batkinson
Date: Fri Apr 24 13:24:34 2015
New Revision: 1675842

URL: http://svn.apache.org/r1675842
Log:
[CONTINUUM-2433] Add feedback indicating whether a manually queued build succeeds or not

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/struts.xml
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupBuildDefinition.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Fri Apr 24 13:24:34 2015
@@ -51,6 +51,7 @@ import org.apache.continuum.taskqueue.ma
 import org.apache.continuum.utils.ProjectSorter;
 import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.continuum.utils.file.FileSystemManager;
+import org.apache.maven.continuum.build.BuildException;
 import org.apache.maven.continuum.build.settings.SchedulesActivationException;
 import org.apache.maven.continuum.build.settings.SchedulesActivator;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
@@ -877,6 +878,8 @@ public class DefaultContinuum
         Map<ProjectScmRoot, Map<Integer, Integer>> map = new HashMap<ProjectScmRoot,
Map<Integer, Integer>>();
         List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
 
+        boolean signalIgnored = false;
+
         for ( Project project : projectsList )
         {
             List<Integer> buildDefIds = (List<Integer>) projectsMap.get( project.getId()
);
@@ -886,31 +889,33 @@ public class DefaultContinuum
             {
                 for ( Integer buildDefId : buildDefIds )
                 {
-                    if ( isProjectOkToBuild( project.getId(), buildDefId ) )
+                    try
+                    {
+                        assertBuildable( project.getId(), buildDefId );
+                    }
+                    catch ( BuildException be )
                     {
-                        ProjectScmRoot scmRoot = getProjectScmRootByProject( project.getId()
);
+                        log.info( "project not queued for build preparation: {}", be.getLocalizedMessage()
);
+                        signalIgnored = true;
+                        continue;
+                    }
+
+                    ProjectScmRoot scmRoot = getProjectScmRootByProject( project.getId()
);
 
-                        Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get(
scmRoot );
+                    Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get(
scmRoot );
 
-                        if ( projectsAndBuildDefinitionsMap == null )
-                        {
-                            projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
-                        }
+                    if ( projectsAndBuildDefinitionsMap == null )
+                    {
+                        projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
+                    }
 
-                        projectsAndBuildDefinitionsMap.put( projectId, buildDefId );
+                    projectsAndBuildDefinitionsMap.put( projectId, buildDefId );
 
-                        map.put( scmRoot, projectsAndBuildDefinitionsMap );
+                    map.put( scmRoot, projectsAndBuildDefinitionsMap );
 
-                        if ( !sortedScmRoot.contains( scmRoot ) )
-                        {
-                            sortedScmRoot.add( scmRoot );
-                        }
-                    }
-                    else
+                    if ( !sortedScmRoot.contains( scmRoot ) )
                     {
-                        log.info(
-                            "Not queueing the build with projectId={} and buildDefinitionId={}
because it is already building",
-                            projectId, buildDefId );
+                        sortedScmRoot.add( scmRoot );
                     }
                 }
             }
@@ -936,6 +941,12 @@ public class DefaultContinuum
                                " because there is no build agent configured in build agent
group" );
             }
         }
+
+        if ( signalIgnored )
+        {
+            throw new BuildException( "some projects were not queued due to their current
build state",
+                                      "build.projects.someNotQueued" );
+        }
     }
 
     public void buildProject( int projectId, String username )
@@ -967,13 +978,7 @@ public class DefaultContinuum
             throw new ContinuumException( "Project (id=" + projectId + ") doesn't have a
default build definition." );
         }
 
-        if ( !isProjectOkToBuild( projectId, buildDef.getId() ) )
-        {
-            log.info(
-                "Not queueing the build with projectId={} and buildDefinitionId={} because
it is already building",
-                projectId, buildDef.getId() );
-            return;
-        }
+        assertBuildable( projectId, buildDef.getId() );
 
         Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer,
Integer>();
         projectsBuildDefinitionsMap.put( projectId, buildDef.getId() );
@@ -995,13 +1000,7 @@ public class DefaultContinuum
             throw new ContinuumException( "Project (id=" + projectId + ") is currently in
release stage." );
         }
 
-        if ( !isProjectOkToBuild( projectId, buildDefinitionId ) )
-        {
-            log.info(
-                "Not queueing the build with projectId={} and buildDefinitionId={} because
it is already building",
-                projectId, buildDefinitionId );
-            return;
-        }
+        assertBuildable( projectId, buildDefinitionId );
 
         Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer,
Integer>();
         projectsBuildDefinitionsMap.put( projectId, buildDefinitionId );
@@ -3539,6 +3538,8 @@ public class DefaultContinuum
         Map<ProjectScmRoot, Map<Integer, Integer>> map = new HashMap<ProjectScmRoot,
Map<Integer, Integer>>();
         List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
 
+        boolean signalIgnored = false;
+
         for ( Project project : projects )
         {
             int projectId = project.getId();
@@ -3589,12 +3590,14 @@ public class DefaultContinuum
                 continue;
             }
 
-            // check if project already in queue
-            if ( !isProjectOkToBuild( projectId, buildDefId ) )
+            try
             {
-                log.info(
-                    "Not queueing the build with projectId={} and buildDefinitionId={} because
it is already building",
-                    projectId, buildDefId );
+                assertBuildable( project.getId(), buildDefId );
+            }
+            catch ( BuildException be )
+            {
+                log.info( "project not queued for build preparation: {}", be.getLocalizedMessage()
);
+                signalIgnored = true;
                 continue;
             }
 
@@ -3618,6 +3621,12 @@ public class DefaultContinuum
         }
 
         prepareBuildProjects( map, buildTrigger, sortedScmRoot );
+
+        if ( signalIgnored )
+        {
+            throw new BuildException( "some projects were not queued due to their current
build state",
+                                      "build.projects.someNotQueued" );
+        }
     }
 
     private void prepareBuildProjects( Collection<Project> projects, int buildDefinitionId,
BuildTrigger buildTrigger )
@@ -3626,16 +3635,21 @@ public class DefaultContinuum
         Map<ProjectScmRoot, Map<Integer, Integer>> map = new HashMap<ProjectScmRoot,
Map<Integer, Integer>>();
         List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
 
+        boolean signalIgnored = false;
+
         for ( Project project : projects )
         {
             int projectId = project.getId();
 
             // check if project already in queue
-            if ( !isProjectOkToBuild( projectId, buildDefinitionId ) )
+            try
+            {
+                assertBuildable( projectId, buildDefinitionId );
+            }
+            catch ( BuildException be )
             {
-                log.info(
-                    "Not queueing the build with projectId={} and buildDefinitionId={} because
it is already building",
-                    projectId, buildDefinitionId );
+                log.info( "project not queued for build preparation: {}", be.getLocalizedMessage()
);
+                signalIgnored = true;
                 continue;
             }
 
@@ -3659,6 +3673,12 @@ public class DefaultContinuum
         }
 
         prepareBuildProjects( map, buildTrigger, sortedScmRoot );
+
+        if ( signalIgnored )
+        {
+            throw new BuildException( "some projects were not queued due to their current
build state",
+                                      "build.projects.someNotQueued" );
+        }
     }
 
     private void prepareBuildProjects( Map<ProjectScmRoot, Map<Integer, Integer>>
map, BuildTrigger buildTrigger,
@@ -3884,34 +3904,38 @@ public class DefaultContinuum
         }
     }
 
-    private boolean isProjectOkToBuild( int projectId, int buildDefinitionId )
+    private void assertBuildable( int projectId, int buildDefinitionId )
         throws ContinuumException
     {
         if ( configurationService.isDistributedBuildEnabled() )
         {
-            if ( !distributedBuildManager.isProjectInAnyPrepareBuildQueue( projectId, buildDefinitionId
) &&
-                !distributedBuildManager.isProjectInAnyBuildQueue( projectId, buildDefinitionId
) &&
-                !distributedBuildManager.isProjectCurrentlyPreparingBuild( projectId, buildDefinitionId
) &&
-                !distributedBuildManager.isProjectCurrentlyBuilding( projectId, buildDefinitionId
) )
+            if ( distributedBuildManager.isProjectInAnyPrepareBuildQueue( projectId, buildDefinitionId
)
+                || distributedBuildManager.isProjectInAnyBuildQueue( projectId, buildDefinitionId
) )
             {
-                return true;
+                throw new BuildException( "project is already queued", "build.project.alreadyQueued"
);
+            }
+
+            if ( distributedBuildManager.isProjectCurrentlyPreparingBuild( projectId, buildDefinitionId
)
+                || distributedBuildManager.isProjectCurrentlyBuilding( projectId, buildDefinitionId
) )
+            {
+                throw new BuildException( "project is already building", "build.project.alreadyBuilding"
);
             }
         }
         else
         {
             try
             {
-                if ( !parallelBuildsManager.isInAnyBuildQueue( projectId, buildDefinitionId
) &&
-                    !parallelBuildsManager.isInAnyCheckoutQueue( projectId ) &&
-                    !parallelBuildsManager.isInPrepareBuildQueue( projectId ) &&
-                    !parallelBuildsManager.isProjectCurrentlyPreparingBuild( projectId )
)
+                if ( parallelBuildsManager.isInAnyBuildQueue( projectId, buildDefinitionId
)
+                    || parallelBuildsManager.isInAnyCheckoutQueue( projectId )
+                    || parallelBuildsManager.isInPrepareBuildQueue( projectId ) )
                 {
-                    if ( parallelBuildsManager.isInAnyCheckoutQueue( projectId ) )
-                    {
-                        parallelBuildsManager.removeProjectFromCheckoutQueue( projectId );
-                    }
+                    throw new BuildException( "project is already queued", "build.project.alreadyQueued"
);
+                }
 
-                    return true;
+                if ( parallelBuildsManager.isProjectCurrentlyPreparingBuild( projectId )
+                    || parallelBuildsManager.isProjectInAnyCurrentBuild( projectId ) )
+                {
+                    throw new BuildException( "project is already building", "build.project.alreadyBuilding"
);
                 }
             }
             catch ( BuildManagerException e )
@@ -3919,8 +3943,6 @@ public class DefaultContinuum
                 throw new ContinuumException( e.getMessage(), e );
             }
         }
-
-        return false;
     }
 
     void setTaskQueueManager( TaskQueueManager taskQueueManager )

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
Fri Apr 24 13:24:34 2015
@@ -171,7 +171,8 @@ public class BuildDefinitionTest
     {
         goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription
);
         clickImgWithAlt( "Build" );
-        assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription
);
+        assertGroupBuildDefinitionPage( projectGroupName );
+        assertTextPresent( "successfully queued builds" );
     }
 
     public void testAddDefaultGroupBuildDefinition()

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
Fri Apr 24 13:24:34 2015
@@ -25,6 +25,7 @@ import org.apache.continuum.utils.build.
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.build.BuildException;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
@@ -34,7 +35,7 @@ import org.codehaus.plexus.util.StringUt
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  */
-@Component( role = com.opensymphony.xwork2.Action.class, hint = "buildProject", instantiationStrategy
= "per-lookup"  )
+@Component( role = com.opensymphony.xwork2.Action.class, hint = "buildProject", instantiationStrategy
= "per-lookup" )
 public class BuildProjectAction
     extends ContinuumActionSupport
 {
@@ -44,10 +45,6 @@ public class BuildProjectAction
 
     private int projectGroupId;
 
-    private boolean fromGroupPage = false;
-
-    private boolean fromProjectPage = false;
-
     private String projectGroupName = "";
 
     public String execute()
@@ -71,10 +68,12 @@ public class BuildProjectAction
                 if ( buildDefinitionId > 0 )
                 {
                     getContinuum().buildProjectWithBuildDefinition( projectId, buildDefinitionId,
buildTrigger );
+                    addActionMessage( getText( "build.project.success" ) );
                 }
                 else
                 {
                     getContinuum().buildProject( projectId, buildTrigger.getTriggeredBy()
);
+                    addActionMessage( getText( "build.project.success" ) );
                 }
             }
             else
@@ -83,15 +82,21 @@ public class BuildProjectAction
                 {
                     getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId,
buildDefinitionId,
                                                                          buildTrigger );
+                    addActionMessage( getText( "build.projects.success" ) );
                 }
                 else
                 {
                     //TODO: Check if this code is called, I don't think
                     //If it is, it should used the projectId
                     getContinuum().buildProjects( buildTrigger.getTriggeredBy() );
+                    addActionMessage( getText( "build.projects.success" ) );
                 }
             }
         }
+        catch ( BuildException be )
+        {
+            addActionError( be.getLocalizedMessage() );
+        }
         catch ( NoBuildAgentException e )
         {
             addActionError( getText( "projectGroup.build.error.noBuildAgent" ) );
@@ -103,32 +108,17 @@ public class BuildProjectAction
 
         AuditLog event = new AuditLog( AuditLogConstants.FORCE_BUILD );
         event.setCurrentUser( getPrincipal() );
-
         if ( projectId > 0 )
         {
             event.setResource( "Project id=" + projectId );
             event.setCategory( AuditLogConstants.PROJECT );
-            event.log();
-
-            if ( fromGroupPage || hasActionErrors() )
-            {
-                return "to_group_page";
-            }
-            if ( fromProjectPage )
-            {
-                return "to_project_page";
-            }
         }
         else
         {
             event.setResource( "Project Group id=" + projectGroupId );
             event.setCategory( AuditLogConstants.PROJECT_GROUP );
-            event.log();
-            if ( fromGroupPage )
-            {
-                return "to_group_page";
-            }
         }
+        event.log();
 
         return SUCCESS;
     }
@@ -163,26 +153,6 @@ public class BuildProjectAction
         this.projectGroupId = projectGroupId;
     }
 
-    public boolean isFromGroupPage()
-    {
-        return fromGroupPage;
-    }
-
-    public void setFromGroupPage( boolean fromGroupPage )
-    {
-        this.fromGroupPage = fromGroupPage;
-    }
-
-    public boolean isFromProjectPage()
-    {
-        return fromProjectPage;
-    }
-
-    public void setFromProjectPage( boolean fromProjectPage )
-    {
-        this.fromProjectPage = fromProjectPage;
-    }
-
     public String getProjectGroupName()
         throws ContinuumException
     {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
Fri Apr 24 13:24:34 2015
@@ -46,7 +46,7 @@ public class GroupSummaryAction
 
     private List<GroupSummary> groups;
 
-    public String execute()
+    public String browse()
         throws ContinuumException
     {
         groups = new ArrayList<GroupSummary>();

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Fri Apr 24 13:24:34 2015
@@ -32,6 +32,7 @@ import org.apache.continuum.utils.build.
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.build.BuildException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
@@ -68,7 +69,7 @@ import java.util.Map;
  *
  * @author Jesse McConnell <jmcconnell@apache.org>
  */
-@Component( role = com.opensymphony.xwork2.Action.class, hint = "projectGroup", instantiationStrategy
= "per-lookup"  )
+@Component( role = com.opensymphony.xwork2.Action.class, hint = "projectGroup", instantiationStrategy
= "per-lookup" )
 public class ProjectGroupAction
     extends ContinuumConfirmAction
 {
@@ -571,6 +572,11 @@ public class ProjectGroupAction
             {
                 getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId,
buildTrigger );
             }
+            addActionMessage( getText( "build.projects.success" ) );
+        }
+        catch ( BuildException be )
+        {
+            addActionError( be.getLocalizedMessage() );
         }
         catch ( NoBuildAgentException e )
         {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
Fri Apr 24 13:24:34 2015
@@ -24,6 +24,7 @@ import org.apache.continuum.buildagent.N
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.build.BuildException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
@@ -38,7 +39,7 @@ import java.util.List;
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  */
-@Component( role = com.opensymphony.xwork2.Action.class, hint = "projects", instantiationStrategy
= "per-lookup"  )
+@Component( role = com.opensymphony.xwork2.Action.class, hint = "projects", instantiationStrategy
= "per-lookup" )
 public class ProjectsListAction
     extends ContinuumActionSupport
 {
@@ -175,6 +176,11 @@ public class ProjectsListAction
                 {
                     getContinuum().buildProjectsWithBuildDefinition( sortedProjects, buildDefinitionId
);
                 }
+                addActionMessage( getText( "build.projects.success" ) );
+            }
+            catch ( BuildException be )
+            {
+                addActionError( be.getLocalizedMessage() );
             }
             catch ( NoBuildAgentException e )
             {

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Fri Apr 24 13:24:34 2015
@@ -1324,3 +1324,8 @@ projectBuilds.report.project=Project Nam
 projectBuilds.report.buildDate=Build Date
 projectBuilds.report.noResult=No Results Found
 
+build.project.success=successfully queued build
+build.projects.success=successfully queued builds
+build.project.alreadyQueued=project is already queued
+build.project.alreadyBuilding=project is already building
+build.projects.someNotQueued=some projects were not queued due to their current build state

Modified: continuum/trunk/continuum-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/struts.xml?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/struts.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/struts.xml Fri Apr 24 13:24:34 2015
@@ -35,6 +35,7 @@
   <package name="default" extends="json-default">
 
     <interceptors>
+
       <interceptor-stack name="defaultStack">
         <interceptor-ref name="exception"/>
         <interceptor-ref name="alias"/>
@@ -53,10 +54,10 @@
         <interceptor-ref name="params" />
         <interceptor-ref name="conversionError"/>
         <interceptor-ref name="validation">
-          <param name="excludeMethods">input,back,cancel,browse</param>
+          <param name="excludeMethods">input,back,cancel,browse,edit</param>
         </interceptor-ref>
         <interceptor-ref name="workflow">
-          <param name="excludeMethods">input,back,cancel,browse</param>
+          <param name="excludeMethods">input,back,cancel,browse,edit</param>
         </interceptor-ref>
       </interceptor-stack>
 
@@ -91,12 +92,6 @@
         <interceptor-ref name="tokenSession">
           <param name="excludeMethods">*</param>
         </interceptor-ref>
-        <interceptor-ref name="validation">
-          <param name="excludeMethods">input,back,cancel,browse,edit</param>
-        </interceptor-ref>
-        <interceptor-ref name="workflow">
-          <param name="excludeMethods">input,back,cancel,browse,edit</param>
-        </interceptor-ref>
       </interceptor-stack>
 
       <interceptor-stack name="unconfiguredContinuumStack">
@@ -108,12 +103,6 @@
         <interceptor-ref name="redbackSecureActions">
           <param name="enableReferrerCheck">false</param>
         </interceptor-ref>
-        <interceptor-ref name="validation">
-          <param name="excludeMethods">input,back,cancel,browse,edit</param>
-        </interceptor-ref>
-        <interceptor-ref name="workflow">
-          <param name="excludeMethods">input,back,cancel,browse,edit</param>
-        </interceptor-ref>
       </interceptor-stack>
 
       <interceptor-stack name="storeStack">
@@ -129,6 +118,7 @@
           <param name="operationMode">RETRIEVE</param>
         </interceptor-ref>
       </interceptor-stack>
+
     </interceptors>
 
     <default-interceptor-ref name="configuredContinuumStack"/>
@@ -241,7 +231,7 @@
     </action>
 
 
-    <action name="groupSummary" class="groupSummary">
+    <action name="groupSummary" class="groupSummary" method="browse">
       <interceptor-ref name="retrieveStack"/>
       <result name="success">/WEB-INF/jsp/groupSummary.jsp</result>
     </action>
@@ -327,17 +317,32 @@
       </result>
     </action>
 
-    <action name="buildProject" class="buildProject">
+    <action name="buildProjectViaGroup" class="buildProject">
       <interceptor-ref name="storeStack"/>
-      <result name="success" type="chain">groupSummary</result>
-      <result name="to_group_page" type="redirectAction">
+      <result name="success" type="redirectAction">
         <param name="actionName">projectGroupSummary</param>
-        <param name="projectGroupId">${projectGroupId}</param>
+        <param name="projectGroupId">%{projectGroupId}</param>
+      </result>
+    </action>
+
+    <action name="buildProjectViaGroupBuildDefinition" class="buildProject">
+      <interceptor-ref name="storeStack"/>
+      <result name="success" type="redirectAction">
+        <param name="actionName">projectGroupBuildDefinition</param>
+        <param name="projectGroupId">%{projectGroupId}</param>
+      </result>
+    </action>
+
+    <action name="buildProjectViaProject" class="buildProject">
+      <interceptor-ref name="storeStack"/>
+      <result name="success" type="redirectAction">
+        <param name="actionName">projectView</param>
+        <param name="projectId">%{projectId}</param>
       </result>
-      <result name="to_project_page" type="chain">projectView</result>
     </action>
 
     <action name="projectView" class="projectView">
+      <interceptor-ref name="retrieveStack"/>
       <result name="success">/WEB-INF/jsp/projectView.jsp</result>
     </action>
 
@@ -391,7 +396,6 @@
       </interceptor-ref>
     </action>
 
-
     <!--
     * project group actions
     -->
@@ -408,6 +412,7 @@
     </action>
 
     <action name="projectGroupBuildDefinition" class="projectGroup" method="buildDefinitions">
+      <interceptor-ref name="retrieveStack"/>
       <result name="success">/WEB-INF/jsp/projectGroupBuildDefinition.jsp</result>
     </action>
 
@@ -419,9 +424,11 @@
       <interceptor-ref name="storeStack"/>
       <result name="success" type="redirectAction">
         <param name="actionName">projectGroupSummary</param>
-        <param name="projectGroupId">${projectGroupId}</param>
+        <param name="projectGroupId">%{projectGroupId}</param>
+      </result>
+      <result name="to_summary_page" type="redirectAction">
+        <param name="actionName">groupSummary</param>
       </result>
-      <result name="to_summary_page" type="chain">groupSummary</result>
     </action>
 
     <action name="confirmRemoveProjectGroup" class="projectGroup" method="confirmRemove">
@@ -1264,9 +1271,33 @@
   </package>
 
   <package name="component" extends="default">
+
     <!--
     * component actions
     -->
+
+    <interceptors>
+      <interceptor-stack name="componentStack">
+        <interceptor-ref name="redbackEnvironmentChecker"/>
+        <interceptor-ref name="redbackForceAdminUser"/>
+        <interceptor-ref name="redbackAutoLogin"/>
+        <interceptor-ref name="defaultStack">
+          <param name="validation.excludeMethods">execute,browse,summarizeForProject,summarizeForGroup</param>
+          <param name="workflow.excludeMethods">execute,browse,summarizeForProject,summarizeForGroup</param>
+        </interceptor-ref>
+        <interceptor-ref name="redbackSecureActions">
+          <param name="enableReferrerCheck">false</param>
+        </interceptor-ref>
+        <interceptor-ref name="redbackPolicyEnforcement"/>
+        <interceptor-ref name="continuumConfigurationCheck"/>
+        <interceptor-ref name="tokenSession">
+          <param name="excludeMethods">*</param>
+        </interceptor-ref>
+      </interceptor-stack>
+    </interceptors>
+
+    <default-interceptor-ref name="componentStack"/>
+
     <action name="buildDefinitionSummary" class="buildDefinitionSummary" method="summarizeForProject">
       <result name="success">/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp</result>
       <result name="error">/WEB-INF/jsp/components/failureComponent.jsp</result>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
Fri Apr 24 13:24:34 2015
@@ -63,7 +63,7 @@
       <ec:column property="alwaysBuild" title="projectView.buildDefinition.alwaysBuild"/>
       <ec:column property="buildAction" title="&nbsp;" width="1%">
         <redback:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
-          <s:url id="buildUrl" action="buildProject" namespace="/">
+          <s:url id="buildUrl" action="buildProjectViaGroupBuildDefinition" namespace="/">
             <s:param name="projectGroupId"><c:out value="${pageScope.buildDefinitionSummary.projectGroupId}"/></s:param>
             <s:param name="buildDefinitionId"><c:out value="${pageScope.buildDefinitionSummary.id}"/></s:param>
             <s:param name="fromGroupPage" value="true"/>
@@ -176,7 +176,7 @@
       <ec:column property="alwaysBuild" title="projectView.buildDefinition.alwaysBuild"/>
       <ec:column property="buildNowAction" title="&nbsp;" width="1%">
         <redback:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
-          <s:url id="buildProjectUrl" action="buildProject" namespace="/" includeParams="none">
+          <s:url id="buildProjectUrl" action="buildProjectViaGroupBuildDefinition" namespace="/"
includeParams="none">
             <s:param name="projectId"><c:out value="${pageScope.buildDefinitionSummary.projectId}"/></s:param>
             <s:param name="buildDefinitionId"><c:out value="${pageScope.buildDefinitionSummary.id}"/></s:param>
           </s:url>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
Fri Apr 24 13:24:34 2015
@@ -53,7 +53,7 @@
       <ec:column property="type" title="projectView.buildDefinition.type"/>      
       <ec:column property="buildAction" title="&nbsp;" width="1%">
         <redback:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
-          <s:url id="buildProjectUrl" action="buildProject" namespace="/">
+          <s:url id="buildProjectUrl" action="buildProjectViaProject" namespace="/">
             <s:param name="projectId" value="#attr['projectId']"/>
             <s:param name="buildDefinitionId" value="#attr['buildDefinitionSummary'].id"/>
             <s:param name="fromProjectPage" value="true"/>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
Fri Apr 24 13:24:34 2015
@@ -103,7 +103,7 @@
           <s:else>
             <redback:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
                 <s:if test="#attr['projectIdle']">
-                  <s:url id="buildProjectUrl" action="buildProject" namespace="/" includeParams="none">
+                  <s:url id="buildProjectUrl" action="buildProjectViaGroup" namespace="/"
includeParams="none">
                     <s:param name="projectId" value="#attr['project'].id"/>
                     <s:param name="projectGroupId" value="#attr['project'].projectGroupId"/>
                     <s:param name="fromGroupPage" value="true"/>
@@ -219,12 +219,26 @@
           <tr>
             <td>
               <redback:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
+                <script>
+                  function handleBuild(projectsForm) {
+                    projectsForm.methodToCall.value = 'build';
+                    projectsForm.submit();
+                  }
+                  function handleCancel(projectsForm) {
+                    projectsForm.action = '<s:url action="cancelBuilds" />';
+                    projectsForm.submit();
+                  }
+                  function handleRemove(projectsForm) {
+                    projectsForm.methodToCall.value = 'confirmRemove';
+                    projectsForm.submit();
+                  }
+                </script>
                 <s:select theme="simple" name="buildDef" list="buildDefinitions"
                            listKey="value" listValue="key" headerKey="-1" headerValue="%{getText('projectGroup.buildDefinition.label')}"
                            onchange="$('projectsForm').buildDefinitionId.value=$('buildDef').value"
/>
-                <input type="button" name="build-projects" value="<s:text name="projectGroup.buildProjects"/>"
onclick="$('projectsForm').methodToCall.value='build';document.forms.projectsForm.submit();"
/>
-                <input type="button" name="cancel-builds" value="<s:text name="projectGroup.cancelBuilds"/>"
onclick="document.forms.projectsForm.action='cancelBuilds.action';document.forms.projectsForm.submit();"
/>
-                <input type="button" name="delete-projects" value="<s:text name="projectGroup.deleteProjects"/>"
onclick="document.forms.projectsForm.methodToCall.value='confirmRemove';document.forms.projectsForm.submit();"
/>
+                <s:submit type="button" value="%{getText('projectGroup.buildProjects')}"
onclick="handleBuild($('projectsForm'))"/>
+                <s:submit type="button" value="%{getText('projectGroup.cancelBuilds')}"
onclick="handleCancel($('projectsForm'))" />
+                <s:submit type="button" value="%{getText('projectGroup.deleteProjects')}"
onclick="handleRemove($('projectsForm'))" />
               </redback:ifAuthorized>
             </td>
           </tr>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp Fri Apr
24 13:24:34 2015
@@ -31,20 +31,23 @@
   <body>
   <div id="h3">
 
+    <s:if test="hasActionErrors()">
+      <div class="errormessage">
+        <s:actionerror/>
+      </div>
+    </s:if>
+    <s:if test="hasActionMessages()">
+      <div class="warningmessage">
+        <s:actionmessage/>
+      </div>
+    </s:if>
+
     <s:if test="infoMessage != null">
        <p><s:property value="infoMessage"/></p>
     </s:if>
     <s:else>
        <h3><s:text name="groups.page.section.title"/></h3>
     </s:else>
-  
-    <s:if test="hasActionErrors()">
-      <div class="errormessage">
-        <s:iterator value="actionErrors">
-          <p><s:property/></p>
-        </s:iterator>
-      </div>
-    </s:if>
 
     <s:if test="groups == null || groups.size() == 0">
       <s:text name="groups.page.list.empty"/>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupBuildDefinition.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupBuildDefinition.jsp?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupBuildDefinition.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupBuildDefinition.jsp
Fri Apr 24 13:24:34 2015
@@ -33,6 +33,17 @@
           <s:param name="tabName" value="'BuildDefinitions'"/>
         </s:action>
 
+        <s:if test="hasActionErrors()">
+          <div class="errormessage">
+            <s:actionerror/>
+          </div>
+        </s:if>
+        <s:if test="hasActionMessages()">
+          <div class="warningmessage">
+            <s:actionmessage/>
+          </div>
+        </s:if>
+
         <s:action name="groupBuildDefinitionSummary" executeResult="true" namespace="component">
           <s:param name="projectGroupId"><c:out value="${projectGroupId}"/></s:param>
           <s:param name="projectGroupName"><c:out value="${projectGroup.name}"/></s:param>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp Fri
Apr 24 13:24:34 2015
@@ -92,6 +92,7 @@
     </s:if>
 
     <h3><s:text name="projectGroup.information.title"><s:param value="projectGroup.name"/></s:text></h3>
+
     <div class="axial">
       <table border="1" cellspacing="2" cellpadding="3" width="100%">
         <tr class="b">

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp?rev=1675842&r1=1675841&r2=1675842&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectView.jsp Fri Apr 24
13:24:34 2015
@@ -36,6 +36,17 @@
 
         <h3><s:text name="projectView.section.title"><s:param><c:out
value="${project.name}"/></s:param></s:text></h3>
 
+        <s:if test="hasActionErrors()">
+          <div class="errormessage">
+            <s:actionerror/>
+          </div>
+        </s:if>
+        <s:if test="hasActionMessages()">
+          <div class="warningmessage">
+            <s:actionmessage/>
+          </div>
+        </s:if>
+
         <div class="axial">
           <table border="1" cellspacing="2" cellpadding="3" width="100%">
             <tr class="b">
@@ -83,9 +94,8 @@
                   </s:form>
                 </td>
                 <td>
-                  <s:form action="buildProject" theme="simple">
+                  <s:form action="buildProjectViaProject" theme="simple">
                     <s:hidden name="projectId" />
-                    <s:hidden name="fromProjectPage" value="true"/>
                     <s:submit name="build-project" value="%{getText('summary.buildNow')}"/>
                   </s:form>
                 </td>



Mime
View raw message