Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
765c0eac
Commit
765c0eac
authored
Oct 05, 2002
by
matty%chariot.net.au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #93667: General bug check refactoring.
parent
995ec6c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
127 deletions
+47
-127
sanitycheck.cgi
sanitycheck.cgi
+47
-127
No files found.
sanitycheck.cgi
View file @
765c0eac
...
@@ -521,152 +521,72 @@ if (exists $::FORM{'rebuildkeywordcache'}) {
...
@@ -521,152 +521,72 @@ if (exists $::FORM{'rebuildkeywordcache'}) {
}
}
###########################################################################
###########################################################################
#
Perform duplicates table
checks
#
General bug
checks
###########################################################################
###########################################################################
Status
(
"Checking duplicates table"
);
sub
BugCheck
($$)
{
my
(
$middlesql
,
$errortext
)
=
@_
;
SendSQL
(
"SELECT bugs.bug_id "
.
"FROM bugs, duplicates "
.
SendSQL
(
"SELECT DISTINCT bugs.bug_id "
.
"WHERE bugs.resolution != 'DUPLICATE' "
.
"FROM $middlesql "
.
" AND bugs.bug_id = duplicates.dupe "
.
"ORDER BY bugs.bug_id"
);
"ORDER BY bugs.bug_id"
);
my
@badbugs
=
();
@badbugs
=
();
while
(
@row
=
FetchSQLData
())
{
while
(
@row
=
FetchSQLData
())
{
my
(
$id
)
=
(
@row
);
my
(
$id
)
=
(
@row
);
push
(
@badbugs
,
$id
);
push
(
@badbugs
,
$id
);
}
}
@badbugs
=
map
(
BugLink
(
$_
),
@badbugs
);
if
(
@badbugs
)
{
Alert
(
"Bug(s) found on duplicates table that are not marked duplicate: "
.
if
(
@badbugs
)
{
join
(
', '
,
@badbugs
));
Alert
(
"$errortext: "
.
join
(
', '
,
@badbugs
));
}
}
}
SendSQL
(
"SELECT bugs.bug_id "
.
Status
(
"Checking resolution/duplicates"
);
"FROM bugs LEFT JOIN duplicates ON bugs.bug_id = duplicates.dupe "
.
"WHERE bugs.resolution = 'DUPLICATE' AND duplicates.dupe IS NULL "
.
"ORDER BY bugs.bug_id"
);
@badbugs
=
();
while
(
@row
=
FetchSQLData
())
{
my
(
$id
)
=
(
@row
);
push
(
@badbugs
,
$id
);
}
if
(
@badbugs
)
{
BugCheck
(
"bugs, duplicates WHERE "
.
Alert
(
"Bug(s) found marked resolved duplicate and not on duplicates
"
.
"bugs.resolution != 'DUPLICATE' AND
"
.
"table: "
.
join
(
', '
,
@badbugs
));
"bugs.bug_id = duplicates.dupe"
,
}
"Bug(s) found on duplicates table that are not marked duplicate"
);
###########################################################################
BugCheck
(
"bugs LEFT JOIN duplicates ON bugs.bug_id = duplicates.dupe WHERE "
.
# Perform status/resolution checks
"bugs.resolution = 'DUPLICATE' AND "
.
###########################################################################
"duplicates.dupe IS NULL"
,
"Bug(s) found marked resolved duplicate and not on duplicates table"
);
Status
(
"Checking statuses/resolutions"
);
Status
(
"Checking statuses/resolutions"
);
my
@open_states
=
map
(
SqlQuote
(
$_
),
OpenStates
());
my
@open_states
=
map
(
SqlQuote
(
$_
),
OpenStates
());
my
$open_states
=
join
(
', '
,
@open_states
);
my
$open_states
=
join
(
', '
,
@open_states
);
@badbugs
=
();
BugCheck
(
"bugs WHERE bug_status IN ($open_states) AND resolution != ''"
,
"Bugs with open status and a resolution"
);
SendSQL
(
"SELECT bug_id FROM bugs "
.
BugCheck
(
"bugs WHERE bug_status NOT IN ($open_states) AND resolution = ''"
,
"WHERE bug_status IN ($open_states) "
.
"Bugs with non-open status and no resolution"
);
"AND resolution != '' "
.
"ORDER BY bug_id"
);
while
(
@row
=
FetchSQLData
())
{
my
(
$id
)
=
(
@row
);
push
(
@badbugs
,
$id
);
}
if
(
@badbugs
>
0
)
{
Alert
(
"Bugs with open status and a resolution: "
.
join
(
", "
,
@badbugs
));
}
@badbugs
=
();
SendSQL
(
"SELECT bug_id FROM bugs "
.
"WHERE bug_status NOT IN ($open_states) "
.
"AND resolution = '' "
.
"ORDER BY bug_id"
);
while
(
@row
=
FetchSQLData
())
{
my
(
$id
)
=
(
@row
);
push
(
@badbugs
,
$id
);
}
if
(
@badbugs
>
0
)
{
Alert
(
"Bugs with non-open status and no resolution: "
.
join
(
", "
,
@badbugs
));
}
###########################################################################
# Perform status/everconfirmed checks
###########################################################################
Status
(
"Checking statuses/everconfirmed"
);
Status
(
"Checking statuses/everconfirmed"
);
@badbugs
=
();
my
$sqlunconfirmed
=
SqlQuote
(
$::unconfirmedstate
);
SendSQL
(
"SELECT bug_id FROM bugs "
.
"WHERE bug_status = "
.
SqlQuote
(
$::unconfirmedstate
)
.
' '
.
"AND everconfirmed = 1 "
.
"ORDER BY bug_id"
);
while
(
@row
=
FetchSQLData
())
{
my
(
$id
)
=
(
@row
);
push
(
@badbugs
,
$id
);
}
if
(
@badbugs
>
0
)
{
Alert
(
"Bugs that are UNCONFIRMED but have everconfirmed set: "
.
join
(
", "
,
@badbugs
));
}
@badbugs
=
();
SendSQL
(
"SELECT bug_id FROM bugs "
.
BugCheck
(
"bugs WHERE bug_status = $sqlunconfirmed AND everconfirmed = 1"
,
"WHERE bug_status IN ('NEW', 'ASSIGNED', 'REOPENED') "
.
"Bugs that are UNCONFIRMED but have everconfirmed set"
);
"AND everconfirmed = 0 "
.
# The below list of resolutions is hardcoded because we don't know if future
"ORDER BY bug_id"
);
# resolutions will be confirmed, unconfirmed or maybeconfirmed. I suspect
# they will be maybeconfirmed, eg ASLEEP and REMIND. This hardcoding should
while
(
@row
=
FetchSQLData
())
{
# disappear when we have customised statuses.
my
(
$id
)
=
(
@row
);
BugCheck
(
"bugs WHERE bug_status IN ('NEW', 'ASSIGNED', 'REOPENED') AND everconfirmed = 0"
,
push
(
@badbugs
,
$id
);
"Bugs with confirmed status but don't have everconfirmed set"
);
}
if
(
@badbugs
>
0
)
{
Alert
(
"Bugs with confirmed status but don't have everconfirmed set: "
.
join
(
", "
,
@badbugs
));
}
###########################################################################
# Perform vote/everconfirmed checks
###########################################################################
Status
(
"Checking votes/everconfirmed"
);
Status
(
"Checking votes/everconfirmed"
);
@badbugs
=
();
BugCheck
(
"bugs, products WHERE "
.
"bugs.product = products.product AND "
.
SendSQL
(
"SELECT bug_id FROM bugs, products "
.
"everconfirmed = 0 AND "
.
"WHERE bugs.product_id = products.id "
.
"votestoconfirm <= votes"
,
"AND bug_status = "
.
SqlQuote
(
$::unconfirmedstate
)
.
' '
.
"Bugs that have enough votes to be confirmed but haven't been"
);
"AND votestoconfirm <= votes "
.
"ORDER BY bug_id"
);
while
(
@row
=
FetchSQLData
())
{
my
(
$id
)
=
(
@row
);
push
(
@badbugs
,
$id
);
}
if
(
@badbugs
>
0
)
{
Alert
(
"Bugs that have enough votes to be confirmed but haven't been: "
.
join
(
", "
,
@badbugs
));
}
###########################################################################
###########################################################################
# Unsent mail
# Unsent mail
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment