From 589632e9d5d35c25c932aafa164feb92c26f5e3d Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 17 Aug 2011 13:05:31 +0200 Subject: 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 --- sanitycheck.cgi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sanitycheck.cgi') diff --git a/sanitycheck.cgi b/sanitycheck.cgi index da308aaeb..7b8177d83 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -747,6 +747,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 ########################################################################### -- cgit v1.2.3-24-g4f1b