[p4dti-discussion] group interpolation bug in p4dti 2.4.2

Peter Mei petermei at gmail.com
Fri Oct 26 20:21:19 BST 2007


I've encountered what I believe to be a bug in the group-handling logic
in bugzilla.py. As far as I can tell, inherited membership in groups via
the bugs.group_group_map table is not calculated (i.e., hierarchical
group membership is not interpolated). This was viable in Bugzilla
versions prior to 2.22 as inherited membership was precalculated and
recorded in the database, but since Bugzilla release 2.22, this
interpolation happens entirely at runtime, and the user_group_map table
contains only those groups to which a user has been explicitly added.

For reference, see ...
http://www.bugzilla.org/releases/2.22/release-notes.html (search for
"Deriving Groups No Longer Happens")
https://bugzilla.mozilla.org/show_bug.cgi?id=304583 (you may need to
authenticate to the mozilla.org BZ, first)

To fix this, I referred to the implementation of Bugzilla::User->groups
(in $BZ3_DIR/Bugzilla/User.pm:358-426). I've implemented something
equivalent to the logic used there, and added it to bugzilla.py; the
patch is attached. This patch adds a table (group_group_map) and one
alias (groups AS inherited) to the locked-tables list. It does not add a
new entry to the "bugzilla.features" dictionary, as the new behavior is
backwards-compatible (albeit somewhat slower) with pre-2.22 databases,
and does not apply to pre-2.17 databases where bitset groups are in
effect. It has been tested against MySQL 4.1.7, but should work against
4.0 as well.

- Peter Mei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ravenbrook.com/pipermail/p4dti-discussion/attachments/20071026/1a44b8f8/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interpolate_groups.patch
Type: application/octet-stream
Size: 3424 bytes
Desc: not available
Url : http://mailman.ravenbrook.com/pipermail/p4dti-discussion/attachments/20071026/1a44b8f8/attachment.obj 


More information about the P4DTI-discussion mailing list