summaryrefslogtreecommitdiffstats
path: root/extensions/Example/lib/Migrate/ImportBugs.pm
blob: 3160c91a85934a2d6a104384aef0a736fa36735b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.


=head1 NAME

Bugzilla::Extension::Example::Migrate::ImportBugs - Bugzilla example bug importer

=head1 DESCRIPTION

This is not a complete implementation of a Import module.  For a working
implementation see L<Bugzilla::Migrate::Gnats>.

=cut

package Bugzilla::Extension::Example::Migrate::ImportBugs;

use 5.14.0
use strict;
use warnings;

use parent qw(Bugzilla::Migrate);

use Bugzilla::Constants;
use Bugzilla::Install::Util qw(indicate_progress);
use Bugzilla::Util qw(format_time trim generate_random_password);

use constant REQUIRED_MODULES => [
    {
        package => 'Email-Simple-FromHandle',
        module  => 'Email::Simple::FromHandle',
        version => 0.050,
    },
];

use constant FIELD_MAP => {
    'Number'         => 'bug_id',
    'Category'       => 'product',
};

use constant VALUE_MAP => {
    bug_severity => {
        'serious'      => 'major',
        'non-critical' => 'normal',
    },
    bug_status => {
        'feedback'  => 'RESOLVED',
        'released'  => 'VERIFIED',
    },
};

use constant IMPORTBUGS_CONFIG_VARS => (
    {
        name    => 'default_email_domain',
        default => 'example.com',
        desc    => <<'END',
# Some users do not have full email addresses, but Bugzilla requires
# every user to have an email address. What domain should be appended to
# usernames that don't have emails, to make them into email addresses?
# (For example, if you leave this at the default, "unknown" would become
# "unknown@example.com".)
END
    },
);

#########
# Hooks #
#########

sub before_insert {
    my $self = shift;
}

#########
# Users #
#########

sub _read_users {
    my $self = shift;
}

############
# Products #
############

sub _read_products {
    my $self = shift;
}

################
# Reading Bugs #
################

sub _read_bugs {
    my $self = shift;
}

sub _parse_project {
    my ($self, $directory) = @_;
}

1;