From 65aeb54b2937560d2eb4ca46ad9a58c636afb361 Mon Sep 17 00:00:00 2001
From: "terry%mozilla.org" <>
Date: Thu, 27 May 1999 21:13:40 +0000
Subject: Added dependencies, so that you can mark which bugs depend on which
other ones.
---
CHANGES | 6 ++
bug_form.pl | 82 +++++++++++++++++------
defparams.pl | 10 +++
makedependenciestable.sh | 43 ++++++++++++
process_bug.cgi | 162 ++++++++++++++++++++++++++++++++++++++++++----
processmail | 30 ++++++++-
showdependencygraph.cgi | 165 +++++++++++++++++++++++++++++++++++++++++++++++
showdependencytree.cgi | 81 +++++++++++++++++++++++
8 files changed, 546 insertions(+), 33 deletions(-)
create mode 100755 makedependenciestable.sh
create mode 100755 showdependencygraph.cgi
create mode 100755 showdependencytree.cgi
diff --git a/CHANGES b/CHANGES
index 0b91ab636..fcba496c0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,12 @@ query the CVS tree. For example,
will tell you what has been changed in the last week.
+5/27/99 Added support for dependency information. You must run the new
+"makedependenciestable.sh" script. You can turn off dependencies with the new
+"usedependencies" param, but it defaults to being on. Also, read very
+carefully the description for the new "webdotbase" param; you will almost
+certainly need to tweak it.
+
5/24/99 Added "Mac System 8.6" and "Neutrino" to the list of OS's.
Feed this to mysql:
diff --git a/bug_form.pl b/bug_form.pl
index 7757b038c..a2fb1056b 100644
--- a/bug_form.pl
+++ b/bug_form.pl
@@ -106,6 +106,8 @@ sub quoteUrls {
my $loginok = quietly_check_login();
+my $id = $::FORM{'id'};
+
my $query = "
select
bug_id,
@@ -129,7 +131,7 @@ select
groupset,
delta_ts
from bugs
-where bug_id = $::FORM{'id'}
+where bug_id = $id
and bugs.groupset & $::usergroupset = bugs.groupset";
SendSQL($query);
@@ -150,29 +152,29 @@ if (@row = FetchSQLData()) {
$count++;
}
} else {
- SendSQL("select groupset from bugs where bug_id = $::FORM{'id'}");
+ SendSQL("select groupset from bugs where bug_id = $id");
if (@row = FetchSQLData()) {
print "
Permission denied.
\n";
if ($loginok) {
print "Sorry; you do not have the permissions necessary to see\n";
- print "bug $::FORM{'id'}.\n";
+ print "bug $id.\n";
} else {
- print "Sorry; bug $::FORM{'id'} can only be viewed when logged\n";
+ print "Sorry; bug $id can only be viewed when logged\n";
print "into an account with the appropriate permissions. To\n";
print "see this bug, you must first\n";
- print "";
+ print "";
print "log in.";
}
} else {
print "
Bug not found
\n";
- print "There does not seem to be a bug numbered $::FORM{'id'}.\n";
+ print "There does not seem to be a bug numbered $id.\n";
}
exit;
}
$bug{'assigned_to'} = DBID_to_name($bug{'assigned_to'});
$bug{'reporter'} = DBID_to_name($bug{'reporter'});
-$bug{'long_desc'} = GetLongDescription($::FORM{'id'});
+$bug{'long_desc'} = GetLongDescription($id);
my $longdesclength = length($bug{'long_desc'});
@@ -193,7 +195,7 @@ my $component_popup = make_options($::components{$bug{'product'}},
$bug{'component'});
my $cc_element = '';
+ ShowCcList($id) . '">';
my $URL = $bug{'bug_file_loc'};
@@ -205,12 +207,12 @@ if (defined $URL && $URL ne "none" && $URL ne "NULL" && $URL ne "") {
}
print "
-Bug $::FORM{'id'} -- " . html_quote($bug{'short_desc'}) .
+Bug $id -- " . html_quote($bug{'short_desc'}) .
"
Description:
@@ -426,7 +470,7 @@ print "
# To add back option of editing the long description, insert after the above
# long_list.cgi line:
-# Edit Long Description
+# Edit Long Description
navigation_header();
diff --git a/defparams.pl b/defparams.pl
index ac19dcf09..c471ebd62 100644
--- a/defparams.pl
+++ b/defparams.pl
@@ -292,6 +292,16 @@ DefParam("usebrowserinfo",
"b",
1);
+DefParam("usedependencies",
+ "Do you wish to use dependencies (allowing you to mark which bugs depend on which other ones)?",
+ "b",
+ 1);
+
+DefParam("webdotbase",
+ "This is the URL prefix that is common to all requests for webdot. The webdot package is a very swell thing that generates pictures of graphs. If you have an installation of bugsplat that hides behind a firewall, then to get graphs to work, you will have to install a copy of webdot behind your firewall, and change this path to match. Also, webdot has some trouble with software domain names, so you may have to play games and hack the %urlbase% part of this. If this all seems like too much trouble, you can set this paramater to be the empty string, which will cause the graphing feature to be disabled entirely.",
+ "t",
+ "http://www.research.att.com/~north/cgi-bin/webdot.cgi/%urlbase%");
+
DefParam("expectbigqueries",
"If this is on, then we will tell mysql to set option SQL_BIG_TABLES=1 before doing queries on bugs. This will be a little slower, but one will not get the error The table ### is full for big queries that require a big temporary table.",
"b",
diff --git a/makedependenciestable.sh b/makedependenciestable.sh
new file mode 100755
index 000000000..80a6795b2
--- /dev/null
+++ b/makedependenciestable.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# The contents of this file are subject to the Mozilla Public License
+# Version 1.0 (the "License"); you may not use this file except in
+# compliance with the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+# License for the specific language governing rights and limitations
+# under the License.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are Copyright (C) 1998
+# Netscape Communications Corporation. All Rights Reserved.
+#
+# Contributor(s): Terry Weissman
+
+mysql > /dev/null 2>/dev/null << OK_ALL_DONE
+
+use bugs;
+
+drop table dependencies
+OK_ALL_DONE
+
+mysql << OK_ALL_DONE
+use bugs;
+create table dependencies (
+ blocked mediumint not null,
+ dependson mediumint not null,
+
+ index(blocked),
+ index(dependson)
+);
+
+
+
+show columns from dependencies;
+show index from dependencies;
+
+OK_ALL_DONE
diff --git a/process_bug.cgi b/process_bug.cgi
index 3c1852d1d..f947869bf 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -262,18 +262,46 @@ if ($::comma eq "") {
my $basequery = $::query;
my $delta_ts;
+
sub SnapShotBug {
my ($id) = (@_);
SendSQL("select delta_ts, " . join(',', @::log_columns) .
" from bugs where bug_id = $id");
my @row = FetchSQLData();
$delta_ts = shift @row;
+
return @row;
}
+sub SnapShotDeps {
+ my ($i, $target, $me) = (@_);
+ SendSQL("select $target from dependencies where $me = $i order by $target");
+ my @list;
+ while (MoreSQLData()) {
+ push(@list, FetchOneColumn());
+ }
+ return join(',', @list);
+}
+
+
+my $whoid = DBNameToIdAndCheck($::FORM{'who'});
+my $timestamp;
+
+sub LogDependencyActivity {
+ my ($i, $oldstr, $target, $me) = (@_);
+ my $newstr = SnapShotDeps($i, $target, $me);
+ if ($oldstr ne $newstr) {
+ SendSQL("insert into bugs_activity (bug_id,who,when,field,oldvalue,newvalue) values ($i,$whoid,$timestamp,'$target','$oldstr','$newstr')");
+ return 1;
+ }
+ return 0;
+}
+
+
foreach my $id (@idlist) {
- SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write");
+ my %dependencychanged;
+ SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write, dependencies write");
my @oldvalues = SnapShotBug($id);
if (defined $::FORM{'delta_ts'} && $::FORM{'delta_ts'} ne $delta_ts) {
@@ -301,16 +329,66 @@ The changes made were:
print qq{\n};
}
print qq{\n};
- print " (This will cause all of the above changes to be overwritten";
+ print " This will cause all of the above changes to be overwritten";
if ($longchanged) {
print ", except for the changes to the description";
}
- print qq{.)\n