continuum-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Venisse <emmanuel.veni...@gmail.com>
Subject Re: svn commit: r787953 - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/ continuum-api/src/main/java/org/apache/maven/continuum/release/ continuum-buildagent/continuum-buildagent-api/src/main/java/o
Date Wed, 24 Jun 2009 10:00:32 GMT
Wouldn't it be better to use a aspect and/or a ThreadLocal/slf4j MDC to
get/set the username instead of adding the username param on all methods?
I'll find it more elegant/intrusive.

Emmanuel

On Wed, Jun 24, 2009 at 11:20 AM, <jzurbano@apache.org> wrote:

> Author: jzurbano
> Date: Wed Jun 24 09:20:10 2009
> New Revision: 787953
>
> URL: http://svn.apache.org/viewvc?rev=787953&view=rev
> Log:
> [CONTINUUM-2265] - Need information on who executed a release
>
> Modified:
>
>  continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
>
>  continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
>
>  continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
>
>  continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
>
>  continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
>
>  continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java
>
>  continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
>
>  continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/DistributedReleaseUtil.java
>
>  continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
>
>  continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
>
>  continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
>
>  continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
>    continuum/trunk/continuum-model/src/main/mdo/continuum.xml
>
>  continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
>
>  continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
>
>  continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
>
>  continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
>
>  continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
>
>  continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
>
>  continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
>
>  continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp
>
> Modified:
> continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
> (original)
> +++
> continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
> Wed Jun 24 09:20:10 2009
> @@ -38,7 +38,7 @@
>         throws ContinuumReleaseException, BuildAgentConfigurationException;
>
>     String releasePrepare( Project project, Properties releaseProperties,
> Map<String, String> releaseVersion,
> -                           Map<String, String> developmentVersion,
> Map<String, String> environments )
> +                           Map<String, String> developmentVersion,
> Map<String, String> environments, String username )
>         throws ContinuumReleaseException, BuildAgentConfigurationException;
>
>     ReleaseResult getReleaseResult( String releaseId )
> @@ -53,11 +53,11 @@
>     String getPreparedReleaseName( String releaseId )
>         throws ContinuumReleaseException;
>
> -    void releasePerform( int projectId, String releaseId, String goals,
> String arguments, boolean useReleaseProfile, LocalRepository repository )
> +    void releasePerform( int projectId, String releaseId, String goals,
> String arguments, boolean useReleaseProfile, LocalRepository repository,
> String username )
>         throws ContinuumReleaseException, BuildAgentConfigurationException;
>
>     void releasePerformFromScm( int projectId, String goals, String
> arguments, boolean useReleaseProfile, LocalRepository repository,
> -                                String scmUrl, String scmUsername, String
> scmPassword, String scmTag, String scmTagBase, Map environments )
> +                                String scmUrl, String scmUsername, String
> scmPassword, String scmTag, String scmTagBase, Map environments, String
> username )
>         throws ContinuumReleaseException, BuildAgentConfigurationException;
>
>     void releaseRollback( String releaseId, int projectId )
>
> Modified:
> continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
> (original)
> +++
> continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
> Wed Jun 24 09:20:10 2009
> @@ -81,6 +81,7 @@
>      * @param buildDirectory
>      * @param goals
>      * @param useReleaseProfile
> +     * @param listener
>      * @throws ContinuumReleaseException
>      */
>     void perform( String releaseId, File buildDirectory, String goals,
> String arguments, boolean useReleaseProfile,
>
> Modified:
> continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
> (original)
> +++
> continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
> Wed Jun 24 09:20:10 2009
> @@ -40,4 +40,8 @@
>     String getError();
>
>     int getState();
> +
> +    String getUsername();
> +
> +    void setUsername( String username );
>  }
>
> Modified:
> continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
> (original)
> +++
> continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
> Wed Jun 24 09:20:10 2009
> @@ -52,7 +52,7 @@
>         throws ContinuumBuildAgentException;
>
>     String releasePrepare( Map project, Map properties, Map releaseVersion,
> Map developmentVersion,
> -                           Map<String, String> environments )
> +                           Map<String, String> environments, String
> username )
>         throws ContinuumBuildAgentException;
>
>     Map<String, Object> getReleaseResult( String releaseId )
> @@ -67,12 +67,12 @@
>     String getPreparedReleaseName( String releaseId )
>         throws ContinuumBuildAgentException;
>
> -    void releasePerform( String releaseId, String goals, String arguments,
> boolean useReleaseProfile, Map repository )
> +    void releasePerform( String releaseId, String goals, String arguments,
> boolean useReleaseProfile, Map repository, String username )
>         throws ContinuumBuildAgentException;
>
>     String releasePerformFromScm( String goals, String arguments, boolean
> useReleaseProfile, Map repository,
>                                   String scmUrl, String scmUsername, String
> scmPassword, String scmTag,
> -                                  String scmTagBase, Map<String, String>
> environments )
> +                                  String scmTagBase, Map<String, String>
> environments, String username )
>         throws ContinuumBuildAgentException;
>
>     String releaseCleanup( String releaseId )
>
> Modified:
> continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
> (original)
> +++
> continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
> Wed Jun 24 09:20:10 2009
> @@ -478,13 +478,13 @@
>     }
>
>     public String releasePrepare( Map project, Map properties, Map
> releaseVersion, Map developmentVersion,
> -                                  Map<String, String> environments )
> +                                  Map<String, String> environments, String
> username )
>         throws ContinuumBuildAgentException
>     {
>         try
>         {
>             return buildAgentReleaseManager.releasePrepare( project,
> properties, releaseVersion, developmentVersion,
> -                                                            environments
> );
> +                                                            environments,
> username );
>         }
>         catch ( ContinuumReleaseException e )
>         {
> @@ -523,12 +523,12 @@
>     }
>
>     public void releasePerform( String releaseId, String goals, String
> arguments, boolean useReleaseProfile,
> -                                Map repository )
> +                                Map repository, String username )
>         throws ContinuumBuildAgentException
>     {
>         try
>         {
> -            buildAgentReleaseManager.releasePerform( releaseId, goals,
> arguments, useReleaseProfile, repository );
> +            buildAgentReleaseManager.releasePerform( releaseId, goals,
> arguments, useReleaseProfile, repository, username );
>         }
>         catch ( ContinuumReleaseException e )
>         {
> @@ -538,14 +538,14 @@
>
>     public String releasePerformFromScm( String goals, String arguments,
> boolean useReleaseProfile, Map repository,
>                                          String scmUrl, String scmUsername,
> String scmPassword, String scmTag,
> -                                         String scmTagBase, Map<String,
> String> environments )
> +                                         String scmTagBase, Map<String,
> String> environments, String username )
>         throws ContinuumBuildAgentException
>     {
>         try
>         {
>             return buildAgentReleaseManager.releasePerformFromScm( goals,
> arguments, useReleaseProfile, repository,
>                                                                    scmUrl,
> scmUsername, scmPassword, scmTag, scmTagBase,
> -
> environments );
> +
> environments, username );
>         }
>         catch ( ContinuumReleaseException e )
>         {
>
> Modified:
> continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java
> (original)
> +++
> continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java
> Wed Jun 24 09:20:10 2009
> @@ -30,7 +30,7 @@
>
>     String releasePrepare( Map<String, Object> project, Map<String, Object>
> properties,
>                            Map<String, String> releaseVersion, Map<String,
> String> developmentVersion,
> -                           Map<String, String> environments )
> +                           Map<String, String> environments, String
> username )
>         throws ContinuumReleaseException;
>
>     ReleaseResult getReleaseResult( String releaseId );
> @@ -41,12 +41,12 @@
>
>     String getPreparedReleaseName( String releaseId );
>
> -    void releasePerform( String releaseId, String goals, String arguments,
> boolean useReleaseProfile, Map repository )
> +    void releasePerform( String releaseId, String goals, String arguments,
> boolean useReleaseProfile, Map repository, String username )
>         throws ContinuumReleaseException;
>
>     String releasePerformFromScm( String goals, String arguments, boolean
> useReleaseProfile, Map repository,
>                                   String scmUrl, String scmUsername, String
> scmPassword, String scmTag,
> -                                  String scmTagBase, Map<String, String>
> environments )
> +                                  String scmTagBase, Map<String, String>
> environments, String username )
>         throws ContinuumReleaseException;
>
>     String releaseCleanup( String releaseId );
>
> Modified:
> continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
> (original)
> +++
> continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
> Wed Jun 24 09:20:10 2009
> @@ -66,7 +66,7 @@
>
>     public String releasePrepare( Map<String, Object> projectMap,
> Map<String, Object> properties,
>                                   Map<String, String> releaseVersion,
> Map<String, String> developmentVersion,
> -                                  Map<String, String> environments )
> +                                  Map<String, String> environments, String
> username )
>         throws ContinuumReleaseException
>     {
>         Project project = getProject( projectMap );
> @@ -74,6 +74,8 @@
>         Properties releaseProperties = getReleaseProperties( properties );
>
>         ContinuumReleaseManagerListener listener = new
> DefaultReleaseManagerListener();
> +
> +        listener.setUsername( username );
>
>         String workingDirectory =
> buildAgentConfigurationService.getWorkingDirectory( project.getId()
> ).getPath();
>
> @@ -118,6 +120,9 @@
>         if ( listener != null )
>         {
>             map.put( ContinuumBuildAgentUtil.KEY_RELEASE_STATE,
> listener.getState() );
> +
> +            map.put( ContinuumBuildAgentUtil.KEY_USERNAME,
> listener.getUsername() );
> +
>             if ( listener.getPhases() != null )
>             {
>                 map.put( ContinuumBuildAgentUtil.KEY_RELEASE_PHASES,
> listener.getPhases() );
> @@ -158,10 +163,12 @@
>     }
>
>     public void releasePerform( String releaseId, String goals, String
> arguments, boolean useReleaseProfile,
> -                                Map repository )
> +                                Map repository, String username )
>         throws ContinuumReleaseException
>     {
>         ContinuumReleaseManagerListener listener = new
> DefaultReleaseManagerListener();
> +
> +        listener.setUsername( username );
>
>         LocalRepository repo = null;
>
> @@ -182,7 +189,7 @@
>
>     public String releasePerformFromScm( String goals, String arguments,
> boolean useReleaseProfile, Map repository,
>                                          String scmUrl, String scmUsername,
> String scmPassword, String scmTag,
> -                                         String scmTagBase, Map<String,
> String> environments )
> +                                         String scmTagBase, Map<String,
> String> environments, String username )
>         throws ContinuumReleaseException
>     {
>         ContinuumReleaseDescriptor descriptor = new
> ContinuumReleaseDescriptor();
> @@ -203,7 +210,7 @@
>
>         releaseManager.getPreparedReleases().put( releaseId, descriptor );
>
> -        releasePerform( releaseId, goals, arguments, useReleaseProfile,
> repository );
> +        releasePerform( releaseId, goals, arguments, useReleaseProfile,
> repository, username );
>
>         return releaseId;
>     }
>
> Modified:
> continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/DistributedReleaseUtil.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/DistributedReleaseUtil.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/DistributedReleaseUtil.java
> (original)
> +++
> continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/DistributedReleaseUtil.java
> Wed Jun 24 09:20:10 2009
> @@ -99,6 +99,8 @@
>     public static final String KEY_RELEASE_GOAL = "release-goal";
>
>     public static final String KEY_BUILD_AGENT_URL = "build-agent-url";
> +
> +    public static final String KEY_USERNAME = "username";
>
>     public static String getScmTag( Map<String, Object> context, String
> defaultValue )
>     {
> @@ -209,6 +211,11 @@
>     {
>         return getInteger( context, KEY_PROJECT_ID );
>     }
> +
> +    public static String getUsername( Map<String, Object> context )
> +    {
> +        return getString( context, KEY_USERNAME, "" );
> +    }
>
>     //
> ----------------------------------------------------------------------
>     //
>
> Modified:
> continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
> (original)
> +++
> continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
> Wed Jun 24 09:20:10 2009
> @@ -140,7 +140,7 @@
>     }
>
>     public String releasePrepare( Project project, Properties
> releaseProperties, Map<String, String> releaseVersion,
> -                                  Map<String, String> developmentVersion,
> Map<String, String> environments )
> +                                  Map<String, String> developmentVersion,
> Map<String, String> environments, String username )
>         throws ContinuumReleaseException, BuildAgentConfigurationException
>     {
>         BuildResult buildResult =
> buildResultDao.getLatestBuildResultForProject( project.getId() );
> @@ -157,11 +157,11 @@
>             SlaveBuildAgentTransportClient client = new
> SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
>             String releaseId =
>                 client.releasePrepare( createProjectMap( project ),
> createPropertiesMap( releaseProperties ),
> -                                       releaseVersion, developmentVersion,
> environments );
> +                                       releaseVersion, developmentVersion,
> environments, username );
>
>             addReleasePrepare( releaseId, buildAgentUrl,
> releaseVersion.get( releaseId ) );
>
> -            addReleaseInProgress( releaseId, "prepare", project.getId() );
> +            addReleaseInProgress( releaseId, "prepare", project.getId(),
> username );
>
>             return releaseId;
>         }
> @@ -295,7 +295,7 @@
>     }
>
>     public void releasePerform( int projectId, String releaseId, String
> goals, String arguments,
> -                                boolean useReleaseProfile, LocalRepository
> repository )
> +                                boolean useReleaseProfile, LocalRepository
> repository, String username )
>         throws ContinuumReleaseException, BuildAgentConfigurationException
>     {
>         String buildAgentUrl = getBuildAgentUrl( releaseId );
> @@ -316,6 +316,7 @@
>         }
>
>         Map<String, String> map = new HashMap<String, String>();
> +        map.put( DistributedReleaseUtil.KEY_USERNAME, username );
>
>         if ( repository != null )
>         {
> @@ -327,9 +328,9 @@
>         try
>         {
>             SlaveBuildAgentTransportClient client = new
> SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
> -            client.releasePerform( releaseId, goals, arguments,
> useReleaseProfile, map );
> +            client.releasePerform( releaseId, goals, arguments,
> useReleaseProfile, map, username );
>
> -            addReleaseInProgress( releaseId, "perform", projectId );
> +            addReleaseInProgress( releaseId, "perform", projectId,
> username );
>         }
>         catch ( MalformedURLException e )
>         {
> @@ -345,7 +346,7 @@
>
>     public void releasePerformFromScm( int projectId, String goals, String
> arguments, boolean useReleaseProfile,
>                                        LocalRepository repository, String
> scmUrl, String scmUsername,
> -                                       String scmPassword, String scmTag,
> String scmTagBase, Map environments )
> +                                       String scmPassword, String scmTag,
> String scmTagBase, Map environments, String username )
>         throws ContinuumReleaseException, BuildAgentConfigurationException
>     {
>         BuildResult buildResult =
> buildResultDao.getLatestBuildResultForProject( projectId );
> @@ -368,6 +369,7 @@
>         }
>
>         Map<String, String> map = new HashMap<String, String>();
> +        map.put( DistributedReleaseUtil.KEY_USERNAME, username );
>
>         if ( repository != null )
>         {
> @@ -381,9 +383,9 @@
>             SlaveBuildAgentTransportClient client = new
> SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
>             String releaseId =
>                 client.releasePerformFromScm( goals, arguments,
> useReleaseProfile, map, scmUrl, scmUsername,
> -                                              scmPassword, scmTag,
> scmTagBase, environments );
> +                                              scmPassword, scmTag,
> scmTagBase, environments, username );
>
> -            addReleaseInProgress( releaseId, "perform", projectId );
> +            addReleaseInProgress( releaseId, "perform", projectId,
> username );
>         }
>         catch ( MalformedURLException e )
>         {
> @@ -689,7 +691,7 @@
>         }
>     }
>
> -    private void addReleaseInProgress( String releaseId, String
> releaseType, int projectId )
> +    private void addReleaseInProgress( String releaseId, String
> releaseType, int projectId, String username )
>     {
>         if ( releasesInProgress == null )
>         {
> @@ -699,6 +701,7 @@
>         Map<String, Object> map = new HashMap<String, Object>();
>         map.put( DistributedReleaseUtil.KEY_RELEASE_GOAL, releaseType );
>         map.put( DistributedReleaseUtil.KEY_PROJECT_ID, projectId );
> +        map.put( DistributedReleaseUtil.KEY_USERNAME, username );
>
>         releasesInProgress.put( releaseId, map );
>     }
>
> Modified:
> continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
> (original)
> +++
> continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
> Wed Jun 24 09:20:10 2009
> @@ -61,7 +61,7 @@
>         throws Exception;
>
>     public String releasePrepare( Map project, Map properties, Map
> releaseVersion, Map developmentVersion,
> -                                  Map environments )
> +                                  Map environments, String username )
>         throws Exception;
>
>     public Map<String, Object> getReleaseResult( String releaseId )
> @@ -77,12 +77,12 @@
>         throws Exception;
>
>     public Boolean releasePerform( String releaseId, String goals, String
> arguments, boolean useReleaseProfile,
> -                                   Map repository )
> +                                   Map repository, String username )
>         throws Exception;
>
>     public String releasePerformFromScm( String goals, String arguments,
> boolean useReleaseProfile, Map repository,
>                                          String scmUrl, String scmUsername,
> String scmPassword, String scmTag,
> -                                         String scmTagBase, Map
> environments )
> +                                         String scmTagBase, Map
> environments, String username )
>         throws Exception;
>
>     public String releaseCleanup( String releaseId )
>
> Modified:
> continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
> (original)
> +++
> continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
> Wed Jun 24 09:20:10 2009
> @@ -259,14 +259,14 @@
>     }
>
>     public String releasePrepare( Map project, Map properties, Map
> releaseVersion, Map developmentVersion,
> -                                  Map environments )
> +                                  Map environments, String username )
>         throws Exception
>     {
>         String releaseId;
>
>         try
>         {
> -            releaseId = slave.releasePrepare( project, properties,
> releaseVersion, developmentVersion, environments );
> +            releaseId = slave.releasePrepare( project, properties,
> releaseVersion, developmentVersion, environments, username );
>             log.info( "Preparing release" );
>         }
>         catch ( Exception e )
> @@ -356,14 +356,14 @@
>     }
>
>     public Boolean releasePerform( String releaseId, String goals, String
> arguments, boolean useReleaseProfile,
> -                                   Map repository )
> +                                   Map repository, String username )
>         throws Exception
>     {
>         Boolean result;
>
>         try
>         {
> -            slave.releasePerform( releaseId, goals, arguments,
> useReleaseProfile, repository );
> +            slave.releasePerform( releaseId, goals, arguments,
> useReleaseProfile, repository, username );
>             result = Boolean.FALSE;
>             log.info( "Performing release" );
>         }
> @@ -378,7 +378,7 @@
>
>     public String releasePerformFromScm( String goals, String arguments,
> boolean useReleaseProfile, Map repository,
>                                          String scmUrl, String scmUsername,
> String scmPassword, String scmTag,
> -                                         String scmTagBase, Map
> environments )
> +                                         String scmTagBase, Map
> environments, String username )
>         throws Exception
>     {
>         String result;
> @@ -386,7 +386,7 @@
>         try
>         {
>             result = slave.releasePerformFromScm( goals, arguments,
> useReleaseProfile, repository, scmUrl, scmUsername,
> -                                                  scmPassword, scmTag,
> scmTagBase, environments );
> +                                                  scmPassword, scmTag,
> scmTagBase, environments, username );
>             log.info( "Performing release" );
>         }
>         catch ( Exception e )
>
> Modified:
> continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
> (original)
> +++
> continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
> Wed Jun 24 09:20:10 2009
> @@ -197,13 +197,13 @@
>     }
>
>     public String releasePrepare( Map project, Map properties, Map
> releaseVersion, Map developmentVersion,
> -                                  Map environments )
> +                                  Map environments, String username )
>         throws Exception
>     {
>         try
>         {
>             return continuumBuildAgentService.releasePrepare( project,
> properties, releaseVersion, developmentVersion,
> -                                                              environments
> );
> +
>  environments, username );
>         }
>         catch ( ContinuumBuildAgentException e )
>         {
> @@ -274,14 +274,14 @@
>     }
>
>     public Boolean releasePerform( String releaseId, String goals, String
> arguments, boolean useReleaseProfile,
> -                                   Map repository )
> +                                   Map repository, String username )
>         throws Exception
>     {
>         Boolean result;
>
>         try
>         {
> -            continuumBuildAgentService.releasePerform( releaseId, goals,
> arguments, useReleaseProfile, repository );
> +            continuumBuildAgentService.releasePerform( releaseId, goals,
> arguments, useReleaseProfile, repository, username );
>             result = Boolean.TRUE;
>         }
>         catch ( ContinuumBuildAgentException e )
> @@ -295,14 +295,14 @@
>
>     public String releasePerformFromScm( String goals, String arguments,
> boolean useReleaseProfile, Map repository,
>                                          String scmUrl, String scmUsername,
> String scmPassword, String scmTag,
> -                                         String scmTagBase, Map
> environments )
> +                                         String scmTagBase, Map
> environments, String username )
>         throws Exception
>     {
>         try
>         {
>             return continuumBuildAgentService.releasePerformFromScm( goals,
> arguments, useReleaseProfile, repository,
>
>  scmUrl, scmUsername, scmPassword, scmTag,
> -
> scmTagBase, environments );
> +
> scmTagBase, environments, username );
>         }
>         catch ( ContinuumBuildAgentException e )
>         {
>
> Modified: continuum/trunk/continuum-model/src/main/mdo/continuum.xml
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-model/src/main/mdo/continuum.xml?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> --- continuum/trunk/continuum-model/src/main/mdo/continuum.xml (original)
> +++ continuum/trunk/continuum-model/src/main/mdo/continuum.xml Wed Jun 24
> 09:20:10 2009
> @@ -1651,6 +1651,11 @@
>           <version>1.1.2+</version>
>           <type>String</type>
>         </field>
> +        <field>
> +          <name>username</name>
> +          <version>1.1.2+</version>
> +          <type>String</type>
> +        </field>
>       </fields>
>     </class>
>
>
> Modified:
> continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
> (original)
> +++
> continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
> Wed Jun 24 09:20:10 2009
> @@ -43,6 +43,8 @@
>     private String error;
>
>     private int state;
> +
> +    private String username;
>
>     public void goalStart( String name, List phases )
>     {
> @@ -110,4 +112,14 @@
>     {
>         return state;
>     }
> +
> +    public void setUsername( String username )
> +    {
> +        this.username = username;
> +    }
> +
> +    public String getUsername()
> +    {
> +        return username;
> +    }
>  }
>
> Modified:
> continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
> (original)
> +++
> continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
> Wed Jun 24 09:20:10 2009
> @@ -61,6 +61,8 @@
>     private String projectName;
>
>     private String releaseGoal;
> +
> +    private String username;
>
>     public String list()
>         throws ContinuumException
> @@ -142,6 +144,7 @@
>
>         releaseGoal = releaseResult.getReleaseGoal();
>         projectName = releaseResult.getProject().getName();
> +        username = releaseResult.getUsername();
>
>         try
>         {
> @@ -282,4 +285,14 @@
>     {
>         this.releaseGoal = releaseGoal;
>     }
> +
> +    public void setUsername( String username )
> +    {
> +        this.username = username;
> +    }
> +
> +    public String getUsername()
> +    {
> +        return username;
> +    }
>  }
>
> Modified:
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
> (original)
> +++
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
> Wed Jun 24 09:20:10 2009
> @@ -62,6 +62,8 @@
>     private String projectGroupName = "";
>
>     private ReleaseListenerSummary listenerSummary;
> +
> +    private String username = "";
>
>     public String execute()
>         throws Exception
> @@ -101,6 +103,8 @@
>             if ( map != null && !map.isEmpty() )
>             {
>                 int state = DistributedReleaseUtil.getReleaseState( map );
> +
> +                username = DistributedReleaseUtil.getUsername( map );
>
>                 if ( state == ContinuumReleaseManagerListener.LISTENING )
>                 {
> @@ -144,6 +148,8 @@
>
>             if ( listener != null )
>             {
> +               username = listener.getUsername();
> +
>                 if ( listener.getState() ==
> ContinuumReleaseManagerListener.LISTENING )
>                 {
>                     status = "inProgress";
> @@ -353,6 +359,7 @@
>         releaseResult.setProjectGroup( projectGroup );
>         releaseResult.setProject( project );
>         releaseResult.setReleaseGoal( releaseGoal );
> +        releaseResult.setUsername( username );
>
>         String releaseName = "releases-" + result.getStartTime();
>
>
> Modified:
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
> (original)
> +++
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
> Wed Jun 24 09:20:10 2009
> @@ -234,6 +234,8 @@
>         Project project = getContinuum().getProject( projectId );
>
>         LocalRepository repository =
> project.getProjectGroup().getLocalRepository();
> +
> +        String username = getPrincipal();
>
>         if ( getContinuum().getConfiguration().isDistributedBuildEnabled()
> )
>         {
> @@ -241,7 +243,7 @@
>
>             try
>             {
> -                releaseManager.releasePerform( projectId, releaseId,
> goals, arguments, useReleaseProfile, repository );
> +                releaseManager.releasePerform( projectId, releaseId,
> goals, arguments, useReleaseProfile, repository, username );
>             }
>             catch ( BuildAgentConfigurationException e )
>             {
> @@ -255,6 +257,8 @@
>         else
>         {
>             listener = new DefaultReleaseManagerListener();
> +
> +            listener.setUsername( username );
>
>             ContinuumReleaseManager releaseManager =
> getContinuum().getReleaseManager();
>
> @@ -269,7 +273,7 @@
>
>         AuditLog event = new AuditLog( "ReleaseId=" + releaseId,
> AuditLogConstants.PERFORM_RELEASE );
>         event.setCategory( AuditLogConstants.PROJECT );
> -        event.setCurrentUser( getPrincipal() );
> +        event.setCurrentUser( username );
>         event.log();
>
>         return SUCCESS;
> @@ -296,7 +300,7 @@
>             try
>             {
>                 releaseManager.releasePerformFromScm( projectId, goals,
> arguments, useReleaseProfile, repository, scmUrl,
> -                                                      scmUsername,
> scmPassword, scmTag, scmTagBase, environments );
> +                                                      scmUsername,
> scmPassword, scmTag, scmTagBase, environments, getPrincipal() );
>             }
>             catch ( BuildAgentConfigurationException e )
>             {
>
> Modified:
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
> (original)
> +++
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
> Wed Jun 24 09:20:10 2009
> @@ -304,6 +304,8 @@
>         {
>             profile = getContinuum().getProfileService().getProfile(
> profileId );
>         }
> +
> +        String username = getPrincipal();
>
>         Map<String, String> environments = getEnvironments( profile );
>
> @@ -314,7 +316,7 @@
>             try
>             {
>                 releaseId = distributedReleaseManager.releasePrepare(
> project, getReleaseProperties(), getRelVersionMap(), getDevVersionMap(),
> -
>  environments );
> +
>  environments, username );
>
>                 if ( releaseId == null )
>                 {
> @@ -334,6 +336,8 @@
>         else
>         {
>             listener = new DefaultReleaseManagerListener();
> +
> +            listener.setUsername( username );
>
>             String workingDirectory = getContinuum().getWorkingDirectory(
> projectId ).getPath();
>
> @@ -358,7 +362,7 @@
>
>         AuditLog event = new AuditLog( "Release id=" + releaseId,
> AuditLogConstants.PREPARE_RELEASE );
>         event.setCategory( AuditLogConstants.PROJECT );
> -        event.setCurrentUser( getPrincipal() );
> +        event.setCurrentUser( username );
>         event.log();
>
>         return SUCCESS;
>
> Modified:
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
> (original)
> +++
> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
> Wed Jun 24 09:20:10 2009
> @@ -90,6 +90,8 @@
>             ContinuumReleaseManager releaseManager =
> getContinuum().getReleaseManager();
>
>             ContinuumReleaseManagerListener listener = new
> DefaultReleaseManagerListener();
> +
> +            listener.setUsername( getPrincipal() );
>
>             Project project = getContinuum().getProject( projectId );
>
>
> 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=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
> (original)
> +++
> continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
> Wed Jun 24 09:20:10 2009
> @@ -719,6 +719,7 @@
>  releaseViewResult.noOutput=No Output
>  releaseViewResult.projectName=Project Name
>  releaseViewResult.releaseGoal=Release Goal
> +releaseViewResult.username=Triggered by
>  releasePrepare.scmUsername.label=SCM Username
>  releasePrepare.scmPassword.label=SCM Password
>  releasePrepare.scmTag.label=SCM Tag
>
> Modified:
> continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp
> URL:
> http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp?rev=787953&r1=787952&r2=787953&view=diff
>
> ==============================================================================
> ---
> continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp
> (original)
> +++
> continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp
> Wed Jun 24 09:20:10 2009
> @@ -52,6 +52,9 @@
>               </s:else>
>             </s:param>
>           </c1:data>
> +          <c1:data label="%{getText('releaseViewResult.username')}">
> +              <s:param name="after"><s:property
> value="username"/></s:param>
> +          </c1:data>
>         </table>
>       </div>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message