summaryrefslogtreecommitdiffstats
path: root/sanitycheck.cgi
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-08-17 13:05:31 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2011-08-17 13:05:31 +0200
commit589632e9d5d35c25c932aafa164feb92c26f5e3d (patch)
treea91df977bac1818f8a70fb7e758576a294a7221e /sanitycheck.cgi
parent664920c7dd532d2243538b1fd3705a72e8d496e6 (diff)
downloadbugzilla-589632e9d5d35c25c932aafa164feb92c26f5e3d.tar.gz
bugzilla-589632e9d5d35c25c932aafa164feb92c26f5e3d.tar.xz
Bug 661476: sanitycheck.pl should check if all products have components defined.
Also, creating a new product from the web UI asks you to create a component too. r=glob a=LpSolit
Diffstat (limited to 'sanitycheck.cgi')
-rwxr-xr-xsanitycheck.cgi20
1 files changed, 20 insertions, 0 deletions
diff --git a/sanitycheck.cgi b/sanitycheck.cgi
index da308aaeb..7b8177d83 100755
--- a/sanitycheck.cgi
+++ b/sanitycheck.cgi
@@ -748,6 +748,26 @@ if (scalar(@invalid_flags)) {
}
###########################################################################
+# Check for products with no component
+###########################################################################
+
+Status('product_check_start');
+
+my $products_missing_data = $dbh->selectcol_arrayref(
+ 'SELECT DISTINCT products.name
+ FROM products
+ LEFT JOIN components
+ ON components.product_id = products.id
+ LEFT JOIN versions
+ ON versions.product_id = products.id
+ WHERE components.id IS NULL
+ OR versions.id IS NULL');
+
+if (scalar(@$products_missing_data)) {
+ Status('product_alert', { name => $_ }, 'alert') foreach @$products_missing_data;
+}
+
+###########################################################################
# General bug checks
###########################################################################