View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0008936 | mantisbt | integration | public | 2008-03-03 07:01 | 2010-09-19 03:11 |
Reporter | egoeht69 | Assigned To | dhx | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Product Version | 1.1.1 | ||||
Summary | 0008936: 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). | ||||
Tags | patch | ||||
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 | ||||
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? |
|
I agree. See also patch for 0008730. |
|
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 |
|
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 |
|
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. thanks |
|
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. |
|