Closed Bug 344878 Opened 18 years ago Closed 16 years ago

Automatically generate list of acceptable columns for buglist.cgi from the database

Categories

(Bugzilla :: Query/Bug List, enhancement)

2.23
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.4

People

(Reporter: mkanat, Assigned: wicked)

References

Details

Attachments

(1 file, 1 obsolete file)

We should just have a fielddefs.buglist field, and then any field that that's "true" for appears as a choice for buglist.cgi.

That is, we want to get rid of DefineColumns and just replace it with a Bugzilla.get_fields call. We might have to keep the time-tracking fields in there, or the fields that are SQL fragments. Other fields can just come from Bugzilla.get_fields, though. And eventually everything should come from get_fields.
We may also want to add a buglist_sortkey field to the columns, so that we can sort them in the right order. That way we could use this code in colchange.cgi, too.

We can do the sorting in perl, there's no need to do the sorting in the DB.
This bug is retargetted to Bugzilla 3.2 for one of the following reasons:

- it has no assignee (except the default one)
- we don't expect someone to fix it in the next two weeks (i.e. before we freeze the trunk to prepare Bugzilla 3.0 RC1)
- it's not a blocker

If you are working on this bug and you think you will be able to submit a patch in the next two weeks, retarget this bug to 3.0.

If this bug is something you would like to see implemented in 3.0 but you are not a developer or you don't think you will be able to fix this bug yourself in the next two weeks, please *do not* retarget this bug.

If you think this bug should absolutely be fixed before we release 3.0, either ask on IRC or use the "blocking3.0 flag".
Target Milestone: Bugzilla 3.0 → Bugzilla 3.2
The current buglist.cgi uses alias column names in GROUP BY and ORDER BY, however, some database like Oracle doesn't support this feature. 

Will this bug fix the problem.
(In reply to comment #3)
> Will this bug fix the problem.

  Maybe. But I think you should just file a separate bug for that problem. We might already have a bug for it, even.
Bugzilla 3.2 is now frozen. Only enhancements blocking 3.2 or specifically approved for 3.2 may be checked in to the 3.2 branch. If you would like to nominate your enhancement for Bugzilla 3.2, set the "blocking3.2" flag to "?". Then, either the target milestone will be changed back, or the blocking3.2 flag will be granted, if we will accept this enhancement for Bugzilla 3.2.

This particular bug has not been touched in over eight months, and thus is being retargeted to "---" instead of "Bugzilla 4.0". If you believe this is a mistake, feel free to retarget it to Bugzilla 4.0.
Target Milestone: Bugzilla 3.2 → ---
Blocks: 418953
I'm going to work on this due to my effort to get bug 245375 fixed.
Assignee: query-and-buglist → wicked
Target Milestone: --- → Bugzilla 3.4
Blocks: 245375
Blocks: 297382
Attached patch Eradicate DefineColumn, V1 (obsolete) — Splinter Review
Here we go, this patch removes DefineColumn from buglist.cgi and instead uses the Bugzilla->get_fields to generate list of valid columns. A column hash with same id, name and title keys is still created so rest of the code doesn't need to be changed.

I had to rename some columns for backward compatibility (creation_ts to opendate, delta_ts to changeddate and work_time to actual_time). There's also buglist specific columns relevance, short_short_desc and realnames for assignee, reporter and QA. All these could be moved to fielddefs as new buglist-only fields in a separate bug.

The SQL fragments in name key are still created in buglist but could eventually changed to come from buglist_sql column of fielddefs in a separate bug.

Patch adds a buglist column to fielddefs table as well necessary code in Field.pm to support this new column. This boolean column determines which fields will be available in buglist for use as display and order columns.
Attachment #356373 - Flags: review?(mkanat)
Comment on attachment 356373 [details] [diff] [review]
Eradicate DefineColumn, V1

You call the field "buglist" in the DB but "in_buglist" in Bugzilla::Field. It should probably be "buglist" everywhere. (since we already use "enter_bug" as a column name, let's be consistent).

Instead of _check_buglist, you can just use Bugzilla::Object::check_boolean.

Other things look fine, but i didn't look at it in detail.
Attachment #356373 - Flags: review?(mkanat) → review-
Both changes done.

Also fixed custom field handling per our discussion on IRC. Now existing custom fields are now set as buglist capable fields when adding buglist column to DB. For new custom fields the editfields.cgi creates them as buglist capable. In both places multiselect fields are set non-buglist fields as they are not yet supported in buglist.
Attachment #356373 - Attachment is obsolete: true
Attachment #356384 - Flags: review?(mkanat)
Comment on attachment 356384 [details] [diff] [review]
Eradicate DefineColumn, V1.1

>+foreach my $field (Bugzilla->get_fields({ obsolete => 0, buglist => 1 })) {
>+    # Rename some field names for backward compatibility
> [snip]

  In a future bug, I want the fielddefs names to be made the canonical names, and only preserve these names for backwards-compatibility.

>+        $dbh->do('UPDATE fielddefs SET buglist = 1 WHERE custom = 1 AND type != 3');

  It's OK to use FIELD_TYPE_MULTI_SELECT there.

  Otherwise, this looks fine, though I haven't tested it yet. I'll approve it as soon as I test it.
Attachment #356384 - Flags: review?(mkanat) → review+
Okay, works!
Status: NEW → ASSIGNED
Flags: approval+
Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v  <--  buglist.cgi
new revision: 1.389; previous revision: 1.388
done
Checking in editfields.cgi;
/cvsroot/mozilla/webtools/bugzilla/editfields.cgi,v  <--  editfields.cgi
new revision: 1.12; previous revision: 1.11
done
Checking in Bugzilla/Field.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Field.pm,v  <--  Field.pm
new revision: 1.41; previous revision: 1.40
done
Checking in Bugzilla/DB/Schema.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v  <--  Schema.pm
new revision: 1.110; previous revision: 1.109
done
Checking in Bugzilla/Install/DB.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm,v  <--  DB.pm
new revision: 1.59; previous revision: 1.58
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Added to the release notes for Bugzilla 3.4 in bug 494037.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: