Closed Bug 282632 Opened 20 years ago Closed 19 years ago

Eliminate AUTOLOAD section from BugMail.pm

Categories

(Bugzilla :: Email Notifications, enhancement, P3)

2.19.2
enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: mkanat, Assigned: mkanat)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 4 obsolete files)

There's an AUTOLOAD section in BugMail.pm. The comment above it says this:

# I got sick of adding &:: to everything.
# However, 'Yuck!'
# I can't require, cause that pulls it in only once, so it won't then be
# in the global package, and these aren't modules, so I can't use globals.pl
# Remove this evilness once our stuff uses real packages.

The AUTOLOAD statement really messes with the namespace -- I keep getting
inexplicable errors while I'm working on patches to BugMail.pm.

Enough stuff is in packages now that we don't need this thing.
Severity: normal → enhancement
Target Milestone: --- → Bugzilla 2.20
This makes life soo much better.
Attachment #174618 - Flags: review?
Status: NEW → ASSIGNED
Attachment #174618 - Flags: review? → review?(timeless)
Priority: -- → P3
Attachment #174618 - Flags: review?(timeless) → review?(wurblzap)
Attached patch Fix bitrot (obsolete) — Splinter Review
Attachment #174618 - Attachment is obsolete: true
Attachment #177551 - Flags: review?(jake)
Attachment #174618 - Flags: review?(wurblzap)
Comment on attachment 177551 [details] [diff] [review]
Fix bitrot

I haven't even come close to doing a complete review, but upon trying to add a
comment to a bug after applying this patch I got the following error:

undef error - Undefined subroutine &Bugzilla::BugMail::login_to_id called at
Bugzilla/BugMail.pm line 612.
Attachment #177551 - Flags: review?(jake) → review-
Oh right, that's a bitrot fix I forgot to fix. :-) It's simple, I just need to
add a use Bugzilla::Bug.
Attached patch v1.2 (obsolete) — Splinter Review
OK, that should do it.
Attachment #177551 - Attachment is obsolete: true
Attachment #177553 - Flags: review?(jake)
Attached patch v1.3 (obsolete) — Splinter Review
OK, yeah, I forgot Bugzilla::User, not Bugzilla::Bug. :-)
Attachment #177553 - Attachment is obsolete: true
Attachment #178768 - Flags: review?(jake)
Attachment #177553 - Flags: review?(jake)
Target Milestone: Bugzilla 2.20 → Bugzilla 2.22
Comment on attachment 178768 [details] [diff] [review]
v1.3

I suspect this has possibly experienced a bit of bitrot, but it might still be
OK...
Attachment #178768 - Flags: review?(jake) → review?(wurblzap)
Blocks: 282628
Attached patch v2Splinter Review
OK, here's the AUTOLOAD removal, but it creates a circular dependency between
Bugzilla::BugMail and Bugzilla::User. Normally circular dependencies aren't a
problem; I'm not sure why this one is. It causes a bunch of messages to be
printed like this when you try to compile BugMail:

Subroutine FormatTriple redefined at Bugzilla/BugMail.pm line 79.
Subroutine FormatDouble redefined at Bugzilla/BugMail.pm line 89.
Subroutine Send redefined at Bugzilla/BugMail.pm line 110.
Subroutine ProcessOneBug redefined at Bugzilla/BugMail.pm line 120.
Subroutine sendMail redefined at Bugzilla/BugMail.pm line 472.
Subroutine MessageToMTA redefined at Bugzilla/BugMail.pm line 606.
Subroutine PerformSubsts redefined at Bugzilla/BugMail.pm line 647.
Subroutine MailPassword redefined at Bugzilla/BugMail.pm line 654.
Attachment #178768 - Attachment is obsolete: true
Attachment #188898 - Flags: review?(wicked)
Attachment #178768 - Flags: review?(wurblzap)
Depends on: 300334
OK, the fix in bug 300334 seems to have fixed the errors I was getting, so
everything should be good, now. :-)
Comment on attachment 188898 [details] [diff] [review]
v2

Yhh, those &:: make this code look bad. :( I don't think this is a big problem
because all lines  seem to refer to a sub in globals.pl and these are going to
go away RSN. Maybe this change even gives us nice incentive to kill globals.pl
sooner than later..

I tested both bugmail during bug changes and creation as well as flagmail. All
mailings seem to still work.

Hmm, looks like this patch will slightly bitrot the patch in the blocked bug.

>+use Bugzilla::User;
>+use Bugzilla;

Not even a nit: Any reason Bugzilla couldn't be first one, if it's needed at
all?
Attachment #188898 - Flags: review?(wicked) → review+
wicked, don't forget to request approval when you grant review.
Flags: approval?
Oh yeah, Bugzilla could be the first one. It would look cleaner, and be more
consistent with our other files. I can fix that on checkin.
Whiteboard: checkin fix
(In reply to comment #11)
> wicked, don't forget to request approval when you grant review.

I have usually let the assignee do that so that he/she can catch up on my review
comments if any. This was an option before but looking at reviewer guide now
indicates that process might have been changed since then. Now if only r+ on
attachment screen could do that automatically.. :)
don't forget comment 12.
Flags: approval? → approval+
Did the checkin fix.

Checking in Bugzilla/BugMail.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm,v  <--  BugMail.pm
new revision: 1.41; previous revision: 1.40
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: checkin fix
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: