Closed Bug 743589 Opened 12 years ago Closed 12 years ago

Remove as much code from patch-4.0 as possible, and put all changes in the Testopia extension instead

Categories

(Testopia :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(3 files)

Currently, you need to apply patch-4.0 to have a working Testopia installation. I think that Bugzilla 4.2 has enough hooks at most key places to not require them anymore. This patch should go away and all changes implemented in the extension itself.
Attached patch patch, v1Splinter Review
I didn't kill patch-4.0 entirely, because there are some heavy hacks in it, especially in User.pm. But I could kill half of the file, which is a nice improvement. Someone feel free to test this patch.
Assignee: gregaryh → LpSolit
Status: NEW → ASSIGNED
Attachment #613204 - Flags: review?
Changes in Bugzilla/Error.pm could go into the extension thanks to a new hook, but I doubt we can do anything about the remaining code, at least not easily.
Summary: Remove patch-4.0, and put all changes in the Testopia extension instead → Remove as much code from patch-4.0 as possible, and put all changes in the Testopia extension instead
Do you guys think it is good idea to get all tr_*.cgi files from Bugzilla root to Testopia/Extension.p and use page.cgi to do all the work.

This would be great to contain all Testopia code in the extension but a lot of work as there are too many tr_*.cgi files and it means a huge Extension.pm

What are your thoughts?
(In reply to rojanu from comment #3)
> Do you guys think it is good idea to get all tr_*.cgi files from Bugzilla
> root to Testopia/Extension.pm and use page.cgi to do all the work.

I thought exactly the same thing. There would be two major advantages by doing so. First of all, all the code would be contained in extensions/Testopia/, and secondly, you wouldn't have conflicts anymore when using bzr. Currently, from the bugzilla/ root directory, you cannot use bzr to upgrade both the Bugzilla code and the Testopia code, because you cannot have two .bzr directories at the same place.
Blocks: 635607
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/extensions/testopia/trunk/
modified extensions/Testopia/Extension.pm
modified extensions/Testopia/patch-4.0
modified extensions/Testopia/lib/Constants.pm
added extensions/Testopia/template/en/default/hook/global/setting-descs-settings.none.tmpl
Committed revision 650.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Attachment #613204 - Flags: review?
Blocks: 743628
I realized that the error mode 4 is already used by ERROR_MODE_TEST, and so ERROR_MODE_AJAX must use another ID. I changed it to 5. This patch also fixes a problem where ERROR_MODE_AJAX is not accessible from Bugzilla/Error.pm due to the previous patch.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/extensions/testopia/trunk/
modified extensions/Testopia/patch-4.0
modified extensions/Testopia/lib/Constants.pm
Committed revision 653.
Actually, there is a way to remove all the remaining code from patch-4.0. We can redefine existing user methods if we write in Extension.pm:

BEGIN {
    undef &Bugzilla::User::get_selectable_products;
    undef &Bugzilla::User::derive_regexp_groups;
    *Bugzilla::User::get_selectable_products = \&get_selectable_products;
    *Bugzilla::User::derive_regexp_groups =\&derive_regexp_groups;
}

sub get_selectable_products {
    # custom code here...
}

sub derive_regexp_groups {
    # custom code here...
}

@ghendricks: is that something you want to happen, or do you prefer to patch the Bugzilla source code?
Attached patch patch part2, v1Splinter Review
ghendricks told me by email that he was fine with the idea to redefine the methods from the extension.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/extensions/testopia/trunk/
modified extensions/Testopia/Extension.pm
modified extensions/Testopia/patch-4.0
Committed revision 659.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: