Closed Bug 286509 Opened 20 years ago Closed 10 years ago

Make Bugzilla::Bug work with Bugzilla::Object->new_from_list

Categories

(Bugzilla :: Creating/Changing Bugs, enhancement)

2.19.2
enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mkanat, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

Attachments

(1 file)

We need to be able to have an object that can represent a list of bugs in a way that will not break performance. It needs to be a list of Bug objects, but they can't be each read from the database individually. I think it would be pretty simple to create, actually. We'd just have to break out the SQL code from _initBug and modify it to either take a single id or a list. Or, it could take a $where_part argument, using an IN or a = depending on whether it was being called from BugList or Bug. Then we'd make _initBug itself just take a single hashref containing the necessary fields, and we could easily call that a bunch of times from BugList. I think that BugList should be allowed to call private functions within Bug, because they're pretty much in the same "package." After the initial creation of the BugList, we could create some clever methods on the list to collect other Bug information in a performant fashion, if *and only if* we found that it was needed for performance reasons.
Blocks: 288296
Max, now that we have Object->new_from_list(), I think we can WONTFIX this bug. Agreed?
Actually, instead, let's make this bug into our bug for making Bugzilla::Bug work with new_from_list.
Summary: Bugzilla::BugList object for creating lists of Bugs → Make Bugzilla::Bug work with Bugzilla::Object->new_from_list
Blocks: bz-object
Target Milestone: --- → Bugzilla 4.0
Attached patch patch, v1 (deleted) — Splinter Review
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #392705 - Flags: review?(mkanat)
Comment on attachment 392705 [details] [diff] [review] patch, v1 Actually, I don't want new_from_list to use {error}. Instead I want to stop using {error} in new() and have some sort of eval system or some other function that returns a specific return value based on what error we experienced, or something like that.
Attachment #392705 - Flags: review?(mkanat) → review-
(In reply to comment #4) You are pretty vague. Could you explain a bit further? For now, the goal is to get a list of bugs faster thanks to new_from_list(). This one can be updated at the same time as new() when the "schema" changes.
Depends on: 509734
No longer blocks: bz-object
Assignee: LpSolit → create-and-change
Status: ASSIGNED → NEW
We are going to branch for Bugzilla 4.4 next week and this bug is too invasive or too risky to be accepted for 4.4 at this point. The target milestone is set to 5.0 which is our next major release. I ask the assignee to reassign the bug to the default assignee if you don't plan to work on this bug in the near future, to make it clearer which bugs should be fixed by someone else on time for 5.0.
Target Milestone: Bugzilla 4.4 → Bugzilla 5.0
grep -rs "Bugzilla::Bug->new_from_list" * returns plenty of results
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
Target Milestone: Bugzilla 5.0 → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: