Open Bug 874035 Opened 11 years ago Updated 8 months ago

Bugzilla::Migrate support for Bug Tracker

Categories

(Bugzilla :: Bug Import/Export & Moving, enhancement)

enhancement
Not set
normal

Tracking

()

People

(Reporter: aliustek, Assigned: aliustek)

Details

Attachments

(1 file, 2 obsolete files)

Attached file BugTracker importer (obsolete) —
Bugzilla::Migrate could support the "Bug Tracker" bug import. Here is what is on Bug Trackers site. "Bug Tracker is a PHP web based bug tracking system. It helps you manage software development. It uses a database to store issues to be done, bugs to be fixed, and features to be added." http://www.twbsd.org/enu/bug_tracker/index.php
Comment on attachment 751665 [details] BugTracker importer I can't change the type of this patch to patch
Attachment #751665 - Flags: review?(LpSolit)
Assignee: import-export → aliustek
Attachment #751665 - Attachment is obsolete: true
Attachment #751665 - Flags: review?(LpSolit)
Attachment #751666 - Flags: review?(LpSolit)
Severity: normal → enhancement
Comment on attachment 751666 [details] [diff] [review] BugTracker importer Thank you for your patch. I know nothing about Bug Tracker (I didn't even know about its existence), so this is just a basic review which is in no way complete. But there are already a few things which need to be fixed in order for your patch to be accepted. >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ You must use the MPL 2.0 license. >+package Bugzilla::Migrate::BugTracker; >+use strict; To pass tests, you must also use Perl 5.10.1. Make sure to run runtests.pl once your patch is ready for upload. >+use constant REQUIRED_MODULES => [ >+ { >+ package => 'DBD-Pg', >+ module => 'DBD::Pg', >+ version => '1.45', >+ }, Why is DBD::Pg recommended? I see in their documentation that Bug Tracker also works with MySQL. >+sub _map_status { >+ use v5.10.1; Move this code at the top of the module. >+use constant BUGTRACKER_CONFIG_VARS => ( >+ { >+ name => 'host', >+ default => 'db.hostserver.com', >+ desc => << 'END', >+# Name/IP Address of DB server >+END Nit: you could write one-liners like this: desc => 'the description here'. That's much nicer. >+sub dbh { >+ my $self = shift; >+ my $db = $self->config('db'); >+ my $host = $self->config('host'); >+ my $port = $self->config('port'); >+ my $user = $self->config('user'); >+ my $pass = $self->config('pass'); >+ $self->{request_cache}->{dbh} ||= DBI->connect("DBI:Pg:dbname=$db;host=$host", $user, $pass, {RaiseError => 1}); >+ >+ return $self->{request_cache}->{dbh}; >+} Err... you should use Bugzilla->dbh directly, right? >+sub _link_bugs { >+# my $bug = Bugzilla::Bug->check($bug_id); >+# if(!@{$bug->see_also}){ >+# $self->debug("Linking Bugs: $bug_id <-> $see_also"); >+# my %set_all_fields; >+# my $timestamp = $dbh->selectrow_array( >+# 'SELECT creation_ts FROM bugs WHERE bug_id = ?', undef, $bug_id); >+# $set_all_fields{who} = $self->config('default_assignee'); >+# #$set_all_fields{bug_when} = >+# $set_all_fields{see_also}->{add} = [$see_also]; >+# $bug->set_all(\%set_all_fields); >+# $bug->update($timestamp); >+# } If this code is useless, it should be removed rather than commented out. I never reviewed any code related to Migrate.pm, so I have no idea if your patch is correctly written or not, besides the few comments I made above. You will have to choose another reviewer for your updated patch. :)
Attachment #751666 - Flags: review?(LpSolit) → review-
Attachment #9384021 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: