View Issue Details

IDProjectCategoryView StatusLast Update
0008936mantisbtintegrationpublic2010-09-19 03:11
Reporteregoeht69 Assigned Todhx  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionwon't fix 
Product Version1.1.1 
Summary0008936: SVN/CVS checkings don't notify by email
Description

When SVN/CVS is integrated into Mantis, and you make a checking (for add a note or resolve a bug), there isn't any email notification to any user.

I've developed a patch to solve it (see file attached).

Tagspatch
Attached Files
PatchMantisNotifySVNCheckins.patch (853 bytes)   
Index: scripts/checkin.php
===================================================================
--- scripts/checkin.php	(revision 5076)
+++ scripts/checkin.php	(working copy)
@@ -92,11 +92,19 @@
 	foreach ( $t_issues as $t_issue_id ) {
 		if ( !in_array( $t_issue_id, $t_fixed_issues ) ) {
 			helper_call_custom_function( 'checkin', array( $t_issue_id, $t_comment, $t_history_old_value, $t_history_new_value, false ) );
+			if ( !is_blank( $t_comment ) ) {
+				email_bugnote_add( $t_issue_id );
+			}
 		}
 	}
 
 	foreach ( $t_fixed_issues as $t_issue_id ) {
 		helper_call_custom_function( 'checkin', array( $t_issue_id, $t_comment, $t_history_old_value, $t_history_new_value, true ) );
+		if ( $g_source_control_set_status_to == 'CLOSED' ) {
+			email_close( $t_issue_id );
+		} else {
+			email_resolved( $t_issue_id );
+		}
 	}
 
 	exit( 0 );
bug8936.patch (1,842 bytes)   
Index: core/custom_function_api.php
===================================================================
--- core/custom_function_api.php	(revision 5412)
+++ core/custom_function_api.php	(working copy)
@@ -137,6 +137,8 @@
 	# Register a checkin in source control by adding a history entry and a note
 	# This can be overriden to do extra work.
 	# The issue status/resolution would only be set if the issue is fixed, and hence $p_fixed is passed as true.
+	# @todo by giallu: check if we can remove $p_fixed param, since we should 
+	# have everything needed to determine if issue is fixed or not
 	function custom_function_default_checkin( $p_issue_id, $p_comment, $p_file, $p_new_version, $p_fixed ) {
 		if ( bug_exists( $p_issue_id ) ) {
 			history_log_event_special( $p_issue_id, CHECKIN, $p_file, $p_new_version );
@@ -146,6 +148,13 @@
 			if ( ( OFF != $t_status ) && $p_fixed ) {
 				bug_set_field( $p_issue_id, 'status', $t_status );
 				bug_set_field( $p_issue_id, 'resolution', config_get( 'source_control_set_resolution_to' ) );
+
+				if ( $t_status == 'CLOSED' ) {
+					email_close( $p_issue_id );
+				}
+				else if ( bug_is_resolved( $p_issue_id ) ) {
+					email_resolved( $p_issue_id );
+				}
 			}
 		}
 	}
Index: config_defaults_inc.php
===================================================================
--- config_defaults_inc.php	(revision 5412)
+++ config_defaults_inc.php	(working copy)
@@ -1249,7 +1249,7 @@
 
 	# For open source projects it is expected that the notes be public, however,
 	# for non-open source it will probably be VS_PRIVATE.
-	$g_source_control_notes_view_status = VS_PRIVATE;
+	$g_source_control_notes_view_status = VS_PUBLIC;
 
 	# Account to be used by the source control script.  The account must be enabled
 	# and must have the appropriate access level to add notes to all issues even
bug8936.patch (1,842 bytes)   

Relationships

related to 0011732 closeddhx Remove built-in source code integration support 
has duplicate 0008730 closedvboctor no notification with checkin.php 

Activities

giallu

giallu

2008-05-26 09:36

reporter   ~0017921

Reminder sent to: nuclear_eclipse

I'm leaning toward merging this patch in SVN.

John, can you confirm the new plugins based integration will honour the email settings?

vboctor

vboctor

2008-07-14 04:34

manager   ~0018494

I agree. See also patch for 0008730.

jreese

jreese

2008-07-14 07:47

reporter   ~0018502

The patch looks good for 1.2.x.

Since the integration plugins have nothing to do with bugnotes, no, it does not deal with email notifications. However, with the plans for pluggable notifications, I will plan to support that system when it gets put in place. See wiki page: http://www.mantisbt.org/wiki/doku.php/mantisbt:notification_requirements

giallu

giallu

2008-07-14 18:00

reporter   ~0018516

upon further inspection, I think the modifications should be performed in the called custom function; moreover, I found that the bugnotes are really sent (at least, they are on SVN latest code) but the default set config_defaults is to add them as private ones: I think this should be changed since it could be one cause of the reported problem.

I'm going to attach a revised patch

faouzi

faouzi

2009-05-27 11:07

reporter   ~0021940

Last edited: 2009-05-27 11:10

Hi everyone

I want to integrate CVS with mantis, is that someone has an idea?

I found that it is possible with SVN but I have failed to integrate.
Is it possible to modify the code for the plugins to integrate SVN and CVS to adapt

thanks

dhx

dhx

2010-03-31 03:25

reporter   ~0024941

Won't fix as this old source code integration support is being dropped in favour of using a more modern plugin approach with the SourceIntegration plugin.

Refer to 0011732 for more details and feedback.