Thread: [Codestriker-commits] CVS update: codestriker/lib/Codestriker/TopicListeners BugTracking.pm
Brought to you by:
sits
|
From: <si...@us...> - 2008-01-13 09:15:25
|
User: sits
Date: 08/01/13 01:15:22
Modified: . CHANGELOG INFO.txt codestriker.conf
bin install.pl
lib/Codestriker/BugDB BugDBConnectionFactory.pm
BugzillaConnection.pm FlysprayConnection.pm
lib/Codestriker/TopicListeners BugTracking.pm
Added: lib/Codestriker/BugDB TestDirectorConnection.pm
Log:
* Support for TestDirector as a supported bug tracking system.
Submitted by rob...@us....
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.221
retrieving revision 1.222
diff -u -r1.221 -r1.222
--- CHANGELOG 10 Jan 2008 21:48:34 -0000 1.221
+++ CHANGELOG 13 Jan 2008 09:15:20 -0000 1.222
@@ -16,6 +16,9 @@
* Only require Authen::SASL as a pre-requisite if SMTP authentication
is needed. For some deployments, installing Authen::SASL can be
inconvenient.
+
+* Support for TestDirector as a supported bug tracking system.
+ Submitted by rob...@us....
Version 1.9.4
Index: INFO.txt
===================================================================
RCS file: /cvsroot/codestriker/codestriker/INFO.txt,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- INFO.txt 18 Apr 2006 10:45:39 -0000 1.8
+++ INFO.txt 13 Jan 2008 09:15:20 -0000 1.9
@@ -135,3 +135,6 @@
+----------------+----------------+
1 row in set (0.00 sec)
+Subversion test, retrieve from collab win-tests.py revision 25651.
+
+Also do diff 25651 25653
Index: codestriker.conf
===================================================================
RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- codestriker.conf 12 Jul 2007 23:39:17 -0000 1.89
+++ codestriker.conf 13 Jan 2008 09:15:20 -0000 1.90
@@ -55,14 +55,17 @@
# Location of the cvs binary.
#$cvs = 'c:/Program Files/GNU/WinCvs 1.3/CVSNT/cvs.exe';
+#$cvs = 'c:/Program Files/cvsnt/cvs.exe';
$cvs = '/usr/bin/cvs';
# Location of the svn binary.
#$svn = 'c:/Program Files/SVN/svn.exe';
+#$svn = 'c:/Program Files/svn-win32-1.4.4/bin/svn.exe';
$svn = '/usr/bin/svn';
# Location of the ssh binary. This is only required if a CVS :ext
# type repository is used.
+#$ssh='c:/Program Files/OpenSSH/bin/ssh.exe';
$ssh = '/usr/local/bin/ssh';
# Location of the p4 (Perforce client) binary. This does not need to be set
@@ -80,7 +83,7 @@
# directory here that exists on the system. For *NIX platforms, there is
# usually no need to do anything here.
#$tmpdir = '/tmp/codestriker';
-#$tmpdir = 'c:/codestriker temp';
+#$tmpdir = 'c:/temp';
# If codestriker is installed differently to that described in the README file
# (for example on the sourceforge servers), it may be necessary to explicitly
@@ -103,6 +106,7 @@
# connect to the repository.
@valid_repositories =
(
+ 'svn://svn.openchange.org/openchange/trunk',
# Example CVSROOT of a CVS repository on the same machine as the
# codestriker server.
'/home/sits/cvs',
@@ -112,6 +116,9 @@
# CVSROOT of the repository.
'http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi /cvsroot',
+ # Codestriker pserver repository.
+ ':pserver:anonymous:@codestriker.cvs.sourceforge.net:/cvsroot/codestriker',
+
# The next example is the syntax used for specifying a Subversion
# repository, which is simply the subversion repository URL
# prefixed # by svn:
@@ -186,6 +193,7 @@
# followed by the view name, followed by the location where the
# view is loaded.
# 'clearcase:dyn:viewname:/vobs'
+ # 'clearcase:dyn:viewname:P:\\viewname'
);
# A mapping of repository URLs to names. In any screen where a
@@ -344,17 +352,22 @@
# can be changed dynamically on the view topic screen.
$default_tabwidth = 8;
-# Bug database to update. Currently, Bugzilla and Flyspray are
-# supported, but it is straight-forward to support other bug
+# Bug database to update. Currently, Bugzilla, Flyspray and TestDirector
+# are supported, but it is straight-forward to support other bug
# databases. To enable Bugzilla, set $bug_db to "bugzilla", and set
-# the following parameters to your setup. To enable Flysprat, set
-# $bug_db to "flyspray", and set the relevant parameters.
-# if the $bug_db is an empty string, all bug-tracking related
-# features will be disabled.
+# the following parameters to your setup. To enable Flyspray, set
+# $bug_db to "flyspray", and set the relevant parameters. To enable
+# TestDirectory, set $bug_db to "testdirector" and set the relevant
+# parameters. If the $bug_db is an empty string, all bug-tracking related
+# features will be disabled. To allow the association of a bug ID
+# with a topic, without any physical connection to a bug database,
+# set the value to "noconnection".
$bug_db = '';
#$bug_db = 'bugzilla';
#$bug_db = 'flyspray';
+#$bug_db = 'testdirector';
+$bug_db = 'noconnection';
# Bugzilla database connection details.
#$bug_db_host = 'localhost';
@@ -370,12 +383,20 @@
#$flyspray_db_dbname = 'flyspray_dev';
#$flyspray_db_user_id = 50;
+# TestDirector connection details
+#$testdirector_url = 'http://emea-testdir:8080/qcbin';
+#$testdirector_user_id = 'robh';
+#$testdirector_password = '';
+#$testdirector_domain = 'DEFAULT';
+#$testdirector_project = 'BPM33';
+#$testdirector_file_list = 'BG_USER_29';
+
# The URL to the bug tracking system. The bug number is appended to the
# end of this string when URLs are generated. This can be left blank if
# there is no need for bug-tracking integration. Below are some example
# URLs for Bugzilla and Flyspray.
$bugtracker = '';
-#$bugtracker = 'http://localhost.localdomain/bugzilla/show_bug.cgi?id=';
+$bugtracker = 'http://localhost.localdomain/bugzilla/show_bug.cgi?id=';
#$bugtracker = '/flyspray_dev/?do=details&id=';
# LXR database. Each repository can be optionally mapped to a
@@ -405,7 +426,7 @@
# (compatible with ASCII) if not set, but this can be over-ridden here.
# List of example encoding names can be retrieved from the following
# URL: http://perldoc.perl.org/Encode/Supported.html.
-#$topic_text_encoding = 'utf8';
+$topic_text_encoding = 'utf8';
#$topic_text_encoding = 'gb2312';
# Each comment thread (or issue) that is created against a specific
Index: install.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- install.pl 13 Jan 2008 04:25:33 -0000 1.14
+++ install.pl 13 Jan 2008 09:15:21 -0000 1.15
@@ -131,6 +131,13 @@
push @{$modules}, { name => 'Authen::SASL', version => '0' };
}
+# Check if TestDirector is being used, and if so, ensure the required
+# modules are loaded.
+if (defined $Codestriker::bug_db &&
+ $Codestriker::bug_db eq 'testdirector') {
+ push @{$modules}, { name => 'Win32::OLE', version => '0' };
+}
+
# Check for various character encoding modules that are required.
if (defined $Codestriker::topic_text_encoding) {
if ($Codestriker::topic_text_encoding =~ /euc\-cn|gb2312|hz|gbk/) {
Index: BugDBConnectionFactory.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/BugDBConnectionFactory.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BugDBConnectionFactory.pm 25 Aug 2007 09:11:07 -0000 1.4
+++ BugDBConnectionFactory.pm 13 Jan 2008 09:15:21 -0000 1.5
@@ -13,6 +13,7 @@
use Codestriker::BugDB::BugzillaConnection;
use Codestriker::BugDB::FlysprayConnection;
use Codestriker::BugDB::NoConnection;
+use Codestriker::BugDB::TestDirectorConnection;
# Factory method for retrieving a BugDBConnection object.
sub getBugDBConnection ($) {
@@ -23,6 +24,8 @@
return Codestriker::BugDB::BugzillaConnection->get_connection();
} elsif ($dbtype eq "flyspray") {
return Codestriker::BugDB::FlysprayConnection->get_connection();
+ } elsif ($dbtype eq "testdirector") {
+ return Codestriker::BugDB::TestDirectorConnection->get_connection();
} elsif ($dbtype =~ /^noconnect/) {
return Codestriker::BugDB::NoConnection->get_connection();
} else {
Index: BugzillaConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/BugzillaConnection.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BugzillaConnection.pm 16 Jan 2006 21:22:58 -0000 1.5
+++ BugzillaConnection.pm 13 Jan 2008 09:15:22 -0000 1.6
@@ -46,7 +46,7 @@
# Method for updating the bug with information that a code review has been
# created/closed/committed against this bug.
sub update_bug($$$$) {
- my ($self, $bugid, $comment) = @_;
+ my ($self, $bugid, $comment, $topic_url) = @_;
# Create the necessary prepared statements.
my $insert_comment =
Index: FlysprayConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/FlysprayConnection.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FlysprayConnection.pm 22 Jan 2006 22:47:14 -0000 1.4
+++ FlysprayConnection.pm 13 Jan 2008 09:15:22 -0000 1.5
@@ -47,7 +47,7 @@
# Method for updating the bug with information that a code review has been
# created/closed/committed against this bug.
sub update_bug($$$$) {
- my ($self, $bugid, $comment) = @_;
+ my ($self, $bugid, $comment, $topic_url) = @_;
# Create the necessary prepared statements.
my $insert_comment =
Index: TestDirectorConnection.pm
===================================================================
RCS file: TestDirectorConnection.pm
diff -N TestDirectorConnection.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TestDirectorConnection.pm 13 Jan 2008 09:15:22 -0000 1.1
@@ -0,0 +1,108 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# TestDirector connection class, for appending comments to a bug report.
+
+package Codestriker::BugDB::TestDirectorConnection;
+
+use strict;
+
+use Win32::OLE;
+
+# Static method for building a database connection.
+sub get_connection($) {
+ my ($type) = @_;
+
+ # Return a connection with Test Director via the TD Object.
+ my $self = {};
+ eval 'use Win32::OLE';
+ die "Unable to load Win32::OLE module: $@\n" if $@;
+ my $conn = Win32::OLE->new('TDapiole80.TDconnection');
+
+ if (!$conn) {
+ die "Cannot start TestDirector object";
+ }
+
+ # Connect to specified server.
+ $conn->InitConnectionEx($Codestriker::testdirector_url);
+
+ # Connect to specified project.
+ $conn->Login($Codestriker::testdirector_user_id,
+ $Codestriker::testdirector_password);
+ $conn->Connect($Codestriker::testdirector_domain,
+ $Codestriker::testdirector_project);
+
+ $self->{dbh} = $conn;
+ bless $self, $type;
+}
+
+# Method for releasing a Test Director connection.
+sub release_connection($) {
+ my ($self) = @_;
+
+ # Close the TD connection.
+ # Disconnect the project and release the server.
+ $self->{dbh}->Disconnect();
+ $self->{dbh}->Logout();
+ $self->{dbh}->ReleaseConnection();
+}
+
+# Retrieve the specified bug record.
+sub _retrieve_bug_record {
+ my ($self, $bugid) = @_;
+
+ if (! defined $self->{dbh}->bugfactory) {
+ die "Unable to retrieve bug factory object";
+ }
+
+ return $self->{dbh}->bugfactory->item($bugid);
+}
+
+# Return true if the specified bugid exists in the bug database,
+# false otherwise.
+sub bugid_exists($$) {
+ my ($self, $bugid) = @_;
+
+ my $bug = $self->_retrieve_bug_record($bugid);
+ return defined $bug;
+}
+
+# Method for updating the bug with information that a code review has been
+# created/closed/committed against this bug.
+sub update_bug($$$$) {
+ my ($self, $bugid, $comment, $topic_url) = @_;
+
+ # Now get the bug out of Test Director.
+ my $bug = $self->_retrieve_bug_record($bugid);
+
+ # Test director stores comments as html so convert the comment to html.
+ my $parsed_comment = $comment;
+ $parsed_comment =~ s/\n/<BR>/g;
+
+ my $full_comment = "";
+ $full_comment .= "\n<HTML><BODY>\n";
+ $full_comment .= "<font color=\"\#000080\">";
+ $full_comment .= "<b>Code Review, ";
+ $full_comment .= localtime;
+ $full_comment .= ":</b></font><BR>";
+ $full_comment .= $parsed_comment;
+ $full_comment .= "</BODY></HTML>\n";
+
+ if (defined $bug->Attachments) {
+ my $attach = $bug->Attachments->AddItem([$topic_url,
+ "TDATT_INTERNET",
+ $full_comment]);
+ $attach->post();
+ }
+ else
+ {
+ $$bug{"BG_DEV_COMMENTS"} .= $full_comment;
+ $bug->post();
+ }
+}
+
+1;
Index: BugTracking.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/BugTracking.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BugTracking.pm 11 Jun 2006 07:54:01 -0000 1.4
+++ BugTracking.pm 13 Jan 2008 09:15:22 -0000 1.5
@@ -70,7 +70,7 @@
"Description:\n" . "$topic->{description}\n";
for (my $i = 0; $i <= $#ids; $i++) {
- $bug_db_connection->update_bug($ids[$i], $text);
+ $bug_db_connection->update_bug($ids[$i], $text, $topic_url);
}
$bug_db_connection->release_connection();
}
@@ -124,7 +124,7 @@
"State changed to \"$newstate\" by $user\n";
for (my $i = 0; $i <= $#ids; $i++) {
- $bug_db_connection->update_bug($ids[$i], $text);
+ $bug_db_connection->update_bug($ids[$i], $text, $topic_url);
}
$bug_db_connection->release_connection();
}
|
|
From: <si...@us...> - 2008-02-22 00:56:23
|
User: sits
Date: 08/02/21 16:56:21
Modified: lib/Codestriker/BugDB BugzillaConnection.pm
FlysprayConnection.pm TestDirectorConnection.pm
lib/Codestriker/Model Topic.pm
lib/Codestriker/TopicListeners BugTracking.pm
Log:
Rob's changes for allowing TestDirector records to be removed when a topic review is deleted
Index: BugzillaConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/BugzillaConnection.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- BugzillaConnection.pm 13 Jan 2008 09:15:22 -0000 1.6
+++ BugzillaConnection.pm 22 Feb 2008 00:56:21 -0000 1.7
@@ -45,8 +45,8 @@
# Method for updating the bug with information that a code review has been
# created/closed/committed against this bug.
-sub update_bug($$$$) {
- my ($self, $bugid, $comment, $topic_url) = @_;
+sub update_bug($$$$$) {
+ my ($self, $bugid, $comment, $topic_url, $topic_state) = @_;
# Create the necessary prepared statements.
my $insert_comment =
Index: FlysprayConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/FlysprayConnection.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FlysprayConnection.pm 13 Jan 2008 09:15:22 -0000 1.5
+++ FlysprayConnection.pm 22 Feb 2008 00:56:21 -0000 1.6
@@ -46,8 +46,8 @@
# Method for updating the bug with information that a code review has been
# created/closed/committed against this bug.
-sub update_bug($$$$) {
- my ($self, $bugid, $comment, $topic_url) = @_;
+sub update_bug($$$$$) {
+ my ($self, $bugid, $comment, $topic_url, $topic_state) = @_;
# Create the necessary prepared statements.
my $insert_comment =
Index: TestDirectorConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/TestDirectorConnection.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestDirectorConnection.pm 21 Feb 2008 02:32:09 -0000 1.2
+++ TestDirectorConnection.pm 22 Feb 2008 00:56:21 -0000 1.3
@@ -73,9 +73,9 @@
}
# Method for updating the bug with information that a code review has been
-# created/closed/committed against this bug.
-sub update_bug($$$$) {
- my ($self, $bugid, $comment, $topic_url) = @_;
+# created/closed/committed/deleted against this bug.
+sub update_bug($$$$$) {
+ my ($self, $bugid, $comment, $topic_url, $topic_state) = @_;
# Now get the bug out of Test Director.
my $bug = $self->_retrieve_bug_record($bugid);
@@ -94,10 +94,14 @@
$full_comment .= "</BODY></HTML>\n";
if (defined $bug->Attachments) {
- my $attach = $bug->Attachments->AddItem([$topic_url,
- "TDATT_INTERNET",
- $full_comment]);
- $attach->post();
+ if( $topic_state eq "Deleted" ) {
+ $self->_update_bug_delete( $bug->Attachments, $topic_url );
+ } else {
+ my $attach = $bug->Attachments->AddItem([$topic_url,
+ "TDATT_INTERNET",
+ $full_comment]);
+ $attach->post();
+ }
}
else
{
@@ -106,4 +110,27 @@
}
}
+# Method for updating the bug with information that a code review has been
+# deleted against this bug.
+sub _update_bug_delete($$$) {
+ my ($self, $attachments, $topic_url) = @_;
+
+ if( $attachments ) {
+ my $attachment_list = $attachments->NewList("");
+
+ my $attach_counter = 1;
+ while ( $attach_counter <= $attachment_list->Count ) {
+ my $attachment = $attachment_list->Item($attach_counter);
+
+ if( $attachment->Name eq $topic_url ) {
+ # Remove the attachment for the deleted topic
+ $attachments->RemoveItem($attachment->ID);
+ }
+ $attach_counter++;
+ }
+ $attachments->post();
+ }
+}
+
+
1;
Index: Topic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Topic.pm,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- Topic.pm 7 Mar 2007 01:12:32 -0000 1.48
+++ Topic.pm 22 Feb 2008 00:56:21 -0000 1.49
@@ -1045,6 +1045,9 @@
Codestriker::DB::DBI->release_connection($dbh, $success);
+ # Update the topic state to deleted
+ $self->{topic_state} = "Deleted";
+
# Indicate the success of the operation.
return $success ? $Codestriker::OK : $Codestriker::INVALID_TOPIC;
}
Index: BugTracking.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/BugTracking.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BugTracking.pm 13 Jan 2008 09:15:22 -0000 1.5
+++ BugTracking.pm 22 Feb 2008 00:56:21 -0000 1.6
@@ -124,7 +124,7 @@
"State changed to \"$newstate\" by $user\n";
for (my $i = 0; $i <= $#ids; $i++) {
- $bug_db_connection->update_bug($ids[$i], $text, $topic_url);
+ $bug_db_connection->update_bug($ids[$i], $text, $topic_url, $topic->{topic_state});
}
$bug_db_connection->release_connection();
}
|
|
From: <si...@us...> - 2008-02-28 23:17:03
|
User: sits
Date: 08/02/28 15:17:00
Modified: lib/Codestriker/TopicListeners BugTracking.pm
Log:
Missed an extra parameter
Index: BugTracking.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/BugTracking.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- BugTracking.pm 22 Feb 2008 00:56:21 -0000 1.6
+++ BugTracking.pm 28 Feb 2008 23:17:00 -0000 1.7
@@ -70,7 +70,8 @@
"Description:\n" . "$topic->{description}\n";
for (my $i = 0; $i <= $#ids; $i++) {
- $bug_db_connection->update_bug($ids[$i], $text, $topic_url);
+ $bug_db_connection->update_bug($ids[$i], $text, $topic_url,
+ $topic->{topic_state});
}
$bug_db_connection->release_connection();
}
|
|
From: <si...@us...> - 2008-09-02 06:35:41
|
User: sits
Date: 08/09/01 23:35:39
Modified: lib/Codestriker/TopicListeners BugTracking.pm
Log:
Make sure the view_url is composed correctly.
Index: BugTracking.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/BugTracking.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- BugTracking.pm 10 Aug 2008 12:18:43 -0000 1.9
+++ BugTracking.pm 2 Sep 2008 06:35:39 -0000 1.10
@@ -113,7 +113,7 @@
my $newstate = $topic->{topic_state};
my $query = new CGI;
my $url_builder = Codestriker::Http::UrlBuilder->new($query);
- my $topic_url = $url_builder->view_url(topicid => $topic->{topicid});
+ my $topic_url = $url_builder->view_url(topicid => $topic->{topicid}, projectid => $topic->{project_id});
my $bug_db_connection =
Codestriker::BugDB::BugDBConnectionFactory->getBugDBConnection();
|