diff options
Diffstat (limited to 'Bugzilla/Install.pm')
-rw-r--r-- | Bugzilla/Install.pm | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm index ced559111..6ac16821e 100644 --- a/Bugzilla/Install.pm +++ b/Bugzilla/Install.pm @@ -19,6 +19,7 @@ use 5.10.1; use strict; use warnings; +use Bugzilla::Logging; use Bugzilla::Component; use Bugzilla::Config qw(:admin); use Bugzilla::Constants; @@ -31,21 +32,31 @@ use Bugzilla::Util qw(get_text); use Bugzilla::Version; use constant STATUS_WORKFLOW => ( - [undef, 'UNCONFIRMED'], - [undef, 'CONFIRMED'], - [undef, 'IN_PROGRESS'], - ['UNCONFIRMED', 'CONFIRMED'], - ['UNCONFIRMED', 'IN_PROGRESS'], - ['UNCONFIRMED', 'RESOLVED'], - ['CONFIRMED', 'IN_PROGRESS'], - ['CONFIRMED', 'RESOLVED'], - ['IN_PROGRESS', 'CONFIRMED'], - ['IN_PROGRESS', 'RESOLVED'], - ['RESOLVED', 'UNCONFIRMED'], - ['RESOLVED', 'CONFIRMED'], - ['RESOLVED', 'VERIFIED'], - ['VERIFIED', 'UNCONFIRMED'], - ['VERIFIED', 'CONFIRMED'], + [ undef, 'UNCONFIRMED' ], + [ undef, 'NEW' ], + [ undef, 'ASSIGNED' ], + [ 'UNCONFIRMED', 'NEW' ], + [ 'UNCONFIRMED', 'ASSIGNED' ], + [ 'UNCONFIRMED', 'RESOLVED' ], + [ 'NEW', 'UNCONFIRMED' ], + [ 'NEW', 'ASSIGNED' ], + [ 'NEW', 'RESOLVED' ], + [ 'ASSIGNED', 'UNCONFIRMED' ], + [ 'ASSIGNED', 'NEW' ], + [ 'ASSIGNED', 'RESOLVED' ], + [ 'REOPENED', 'UNCONFIRMED' ], + [ 'REOPENED', 'NEW' ], + [ 'REOPENED', 'ASSIGNED' ], + [ 'REOPENED', 'RESOLVED' ], + [ 'RESOLVED', 'UNCONFIRMED' ], + [ 'RESOLVED', 'REOPENED' ], + [ 'RESOLVED', 'VERIFIED' ], + [ 'VERIFIED', 'UNCONFIRMED' ], + [ 'VERIFIED', 'REOPENED' ], + [ 'VERIFIED', 'RESOLVED' ], + [ 'CLOSED', 'UNCONFIRMED' ], + [ 'CLOSED', 'REOPENED' ], + [ 'CLOSED', 'RESOLVED' ], ); sub SETTINGS { @@ -273,6 +284,12 @@ use constant DEFAULT_PRODUCT => { defaultmilestone => DEFAULT_MILESTONE, }; +use constant DEFAULT_PRODUCT_GROUP => { + name => 'test-product-security', + description => "Security Sensitive TestProduct Bug", + isbuggroup => 1, +}; + use constant DEFAULT_COMPONENT => { name => 'TestComponent', description => 'This is a test component in the test product database.' @@ -351,7 +368,8 @@ sub create_default_product { print get_text('install_default_product', { name => DEFAULT_PRODUCT->{name} }) . "\n"; - my $product = Bugzilla::Product->create(DEFAULT_PRODUCT); + my $group = Bugzilla::Group->create(DEFAULT_PRODUCT_GROUP); + my $product = Bugzilla::Product->create({ %{DEFAULT_PRODUCT()}, security_group_id => $group->id }); # Get the user who will be the owner of the Component. # We pick the admin with the lowest id, which is probably the @@ -381,6 +399,7 @@ sub init_workflow { 'SELECT value, id FROM bug_status', {Columns=>[1,2]}) }; foreach my $pair (STATUS_WORKFLOW) { + WARN("unknown bug_status: " . $pair->[1]) unless $status_ids{$pair->[1]}; my $old_id = $pair->[0] ? $status_ids{$pair->[0]} : undef; my $new_id = $status_ids{$pair->[1]}; $dbh->do('INSERT INTO status_workflow (old_status, new_status) |