Closed Bug 277454 Opened 20 years ago Closed 20 years ago

Bugs in inactivated groups don't show padlocks on the buglist

Categories

(Bugzilla :: Query/Bug List, defect)

2.19.1
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: justdave, Assigned: Wurblzap)

References

Details

Attachments

(2 files, 6 obsolete files)

Last night I posted a blog entry asking for help fixing the op_sys field on a bunch of corrupted bugs on bugzilla.mozilla.org. This morning, people were mentioning that they appeared to be all done, but when I ran the query myself, I still got 15 of them. We couldn't figure out why nobody else could see them -- they didn't have padlock icons on them. Then I opened one of the bugs and looked at it, and it was in the Netscape Confidential group, which was disabled a long time ago to prevent people from placing new bugs in that group. The code at fault appears to be the code that tests whether the bug is hidden by a n implied or manual group setting. Disabled groups show up as neither, and wind up without a lock. I would think they should be assumed to be manual.
Assignee: justdave → query-and-buglist
Flags: blocking2.20+
QA Contact: mattyt-bugzilla → default-qa
Target Milestone: --- → Bugzilla 2.20
Attached patch Patch (obsolete) — Splinter Review
Assignee: query-and-buglist → wurblzap
Status: NEW → ASSIGNED
Attachment #178455 - Flags: review?
I don't like changing this bit of code very much; I wonder if the right thing would be to have an explicit clause for the deactivated group case and then explicitly set it to "manual" with a comment explaining why.
Severity: normal → critical
I have no qualms at all touching this piece of code :) Actually, I think the real cause of this bug is a semi-corrupt database. I suspect the bugs in question show up in sanity check as "Have groups not permitted for their products".
Whiteboard: [patch awaiting review]
Attachment #178455 - Flags: review? → review?(LpSolit)
OK, the conversion code in checksetup.pl for when the group_control_map table was introduced appears to be at fault here. A record for group_control_map was never created for this group, which was already disabled before the group_control_map mechanism was introduced. See http://lxr.mozilla.org/bugzilla/source/checksetup.pl#3300
Comment on attachment 178455 [details] [diff] [review] Patch Your patch is correct and makes the code easier to read... but justdave is right, the correct fix is to remove 'AND isactive != 0' from this query in checksetup.pl, line 3301: $sth = $dbh->prepare("SELECT groups.id, products.id, groups.name, " . "products.name FROM groups, products " . "WHERE isbuggroup != 0 AND isactive != 0"); Moreover, checksetup.pl should fix corrupted DBs. For that, it has to look at groups associated with bugs in bug_group_map which are in a product which is not associated with that group in group_control_map. If such invalid group-product combinations are found, it should add it to group_control_map with CONTROLMAPSHOWN as a default in order to keep these bugs private. If the group has the same name as a product, then some additional checks may be required in order to set the correct values in group_control_map.
Attachment #178455 - Flags: review?(LpSolit) → review-
I guess 2.18 is affected too and this bug produces data corruption for disabled groups.
Flags: blocking2.18.2?
Target Milestone: Bugzilla 2.20 → Bugzilla 2.18
It was discussed on IRC that it's probably not safe to just have checksetup.pl fix this, because there's no way to tell at this point if the missed conversion is the reason for the corruption. There appears to be a test for this in sanitycheck already on the tip, probably that test should get backported to 2.18 and make sure the repair options offer allowing those groups as an option.
Target Milestone: Bugzilla 2.18 → Bugzilla 2.20
Flags: blocking2.18.2? → blocking2.18.2+
Target Milestone: Bugzilla 2.20 → Bugzilla 2.18
Whiteboard: [patch awaiting review]
Attached patch HEAD patch 2.1 (obsolete) — Splinter Review
o Makes buglist.cgi display padlocks even for semi-broken bugs o Remedies checksetup.pl o Fixes sanitycheck.cgi to complain about semi-broken bugs, offering to set up SHOWN/NA group_control_map entries
Attachment #178455 - Attachment is obsolete: true
Attachment #186582 - Flags: review?
Attached patch HEAD patch 2.1.1 (obsolete) — Splinter Review
Style changes only, as per discussion on IRC.
Attachment #186582 - Attachment is obsolete: true
Attachment #186585 - Flags: review?(LpSolit)
Attachment #186582 - Flags: review?
Blocks: 298024
Comment on attachment 186585 [details] [diff] [review] HEAD patch 2.1.1 >+ qq{INSERT INTO group_control_map ( >+ group_id, product_id, entry, >+ membercontrol, othercontrol, canedit >+ ) >+ VALUES ( >+ ?, ?, 0, >+ $shown, $na, 0 >+ )}); ( Nit: /me does not like parens alone on a line... sigh ) >+ PutFooter(); >+ exit; >+} Nit: do you really want to stop sanitycheck at this level? If you want to submit a new patch with these two lines removed, feel free to carry forward my r+. This patch needs to be backported to 2.18. r=LpSolit
Attachment #186585 - Flags: review?(LpSolit) → review+
Attached patch HEAD Patch 2.2 (obsolete) — Splinter Review
Continues sanitycheck after repairing, and writes a nice finishing status summary.
Attachment #186585 - Attachment is obsolete: true
Attachment #186814 - Flags: review?(LpSolit)
Attached patch Branch patch 2.2 (obsolete) — Splinter Review
Attachment #186815 - Flags: review?(LpSolit)
Comment on attachment 186814 [details] [diff] [review] HEAD Patch 2.2 >+if (defined $cgi->param('createmissinggroupcontrolmapentries')) { >+ my $na = CONTROLMAPNA; >+ my $shown = CONTROLMAPSHOWN; Usually, we inform the user that something is being fixed, such as: Status("OK, now fixing missing entries in group_control_map."); I think you should do the same here. Add a convenient message and carry forward my r+. r=LpSolit
Attachment #186814 - Flags: review?(LpSolit) → review+
Attachment #186815 - Flags: review?(LpSolit)
Attached patch HEAD Patch 2.3Splinter Review
o Added a starting Status() call o Tweaked the update message o Tweaked the repair link text
Attachment #186814 - Attachment is obsolete: true
Attachment #186933 - Flags: review?(LpSolit)
Attached patch Branch patch 2.3 (obsolete) — Splinter Review
Attachment #186815 - Attachment is obsolete: true
Attachment #186934 - Flags: review?(LpSolit)
Comment on attachment 186933 [details] [diff] [review] HEAD Patch 2.3 r=LpSolit
Attachment #186933 - Flags: review?(LpSolit) → review+
Comment on attachment 186934 [details] [diff] [review] Branch patch 2.3 >+ WHERE COALESCE(gcm.membercontrol, $na) = $na >+ } . $dbh->sql_group_by('bugs.product_id, bgm.group_id')); $dbh->sql_group_by() does not exist in 2.18. Use GROUP BY instead. Else the patch works fine.
Attachment #186934 - Flags: review?(LpSolit) → review-
Uses GROUP BY.
Attachment #186934 - Attachment is obsolete: true
Attachment #187007 - Flags: review?(LpSolit)
Comment on attachment 187007 [details] [diff] [review] Branch patch 2.3.1 r=LpSolit
Attachment #187007 - Flags: review?(LpSolit) → review+
Flags: approval?
Flags: approval2.18?
Flags: approval?
Flags: approval2.18?
Flags: approval2.18+
Flags: approval+
Tip: Checking in buglist.cgi; /cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v <-- buglist.cgi new revision: 1.296; previous revision: 1.295 done Checking in checksetup.pl; /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl new revision: 1.408; previous revision: 1.407 done Checking in sanitycheck.cgi; /cvsroot/mozilla/webtools/bugzilla/sanitycheck.cgi,v <-- sanitycheck.cgi new revision: 1.95; previous revision: 1.94 done 2.18.1: Checking in checksetup.pl; /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl new revision: 1.289.2.32; previous revision: 1.289.2.31 done Checking in sanitycheck.cgi; /cvsroot/mozilla/webtools/bugzilla/sanitycheck.cgi,v <-- sanitycheck.cgi new revision: 1.72.2.3; previous revision: 1.72.2.2 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: