Closed Bug 801713 Opened 12 years ago Closed 12 years ago

implement "bug shadowing" feature

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: glob, Assigned: glob)

References

()

Details

Attachments

(1 file, 1 obsolete file)

in order to help facilitate bugs which have both public and private data, we'll write a "shadow bug" extension. this is more or less a hack to work around bugzilla's limitation of being unable to restrict comment visibility by groups (beyond the insidergroup function). the basic idea is to create a custom bug_id field "shadow bug" / "shadows", and link a public bug with a "shadow bug". - the shadow bug will show comments from both bugs - similar implementation to inline history; comments injected by javascript - the injected comments will be styled different from normal comments - set a placeholder in the add_comment textarea on the shadow bug to clearly indicate that it isn't a normal bug, and that public comments should go on the other bug - set a custom background colour/whatever on the shadow bug - on the linked bug, ensure the link to the shadow bug is clear
Attached patch patch v1 (obsolete) — Splinter Review
Attachment #675893 - Flags: review?(dkl)
Comment on attachment 675893 [details] [diff] [review] patch v1 Review of attachment 675893 [details] [diff] [review]: ----------------------------------------------------------------- Overall, looks very good. General Comments: * According to the wiki, you should only be allowed to shadow public bugs. With the current patch I am able to shadow another private bug so was that left out? ::: extensions/ShadowBugs/template/en/default/hook/bug/comments-aftercomments.html.tmpl @@ +23,5 @@ > + [% RETURN IF comment_text == '' %] > + > + <div id="pc[% count %]" class="bz_comment[% " bz_private" IF comment.is_private %] > + shadow_bug_comment bz_default_hidden > + [% " bz_comment_hilite" IF marks.$count %] Will this highlight the private bugs comment as well as the public shadowed comment? Might be better to leave this out. ::: extensions/ShadowBugs/template/en/default/hook/bug/edit-after_comment_textarea.html.tmpl @@ +8,5 @@ > + > +[% RETURN UNLESS is_shadow_bug %] > + > +<br> > +<a href="show_bug.cgi?id=[% bug.cf_shadow_bug FILTER none %]#comment">Add public comment</a> <a href="show_bug.cgi?id=[% bug.cf_shadow_bug FILTER none %]#comment" target="_blank">Add public comment to bug [% bug.cf_shadow_bug %]</a> ::: extensions/ShadowBugs/template/en/default/hook/bug/edit-after_custom_fields.html.tmpl @@ +9,5 @@ > +[% RETURN IF Bugzilla.is_cf_shadow_bug_hidden(bug) %] > +[% field = Bugzilla.process_cache.shadow_bug_field %] > +[% shadowed_by = bug.related_bugs(field).pop %] > +<tr> > + [% IF shadowed_by && user.can_see_bug(shadowed_by) %] nit: fix indentation @@ +21,5 @@ > + [% PROCESS bug/field.html.tmpl > + value = bug.cf_shadow_bug > + editable = bug.check_can_change_field(field.name, 0, 1) > + no_tds = false > + value_span = 2 %] nit: line up indentation with PROCESS and line up equals "=" ::: extensions/ShadowBugs/template/en/default/hook/bug/show-header-end.html.tmpl @@ +7,5 @@ > + #%] > + > +[% IF is_shadow_bug %] > + [% style_urls.push('extensions/ShadowBugs/web/style.css') %] > + [% javascript_urls.push('extensions/ShadowBugs/web/shadow-bugs.js') %] semi-nit (leave it up to you): Respective files should be placed in extensions/ShadowBugs/web/{style,js}/
Attachment #675893 - Flags: review?(dkl) → review-
(In reply to David Lawrence [:dkl] from comment #2) > * According to the wiki, you should only be allowed to shadow public bugs. > With the current patch I am able to shadow another private bug so was that > left out? oops, will add. > > +<a href="show_bug.cgi?id=[% bug.cf_shadow_bug FILTER none %]#comment">Add public comment</a> > > <a href="show_bug.cgi?id=[% bug.cf_shadow_bug FILTER none %]#comment" > target="_blank">Add public comment to bug [% bug.cf_shadow_bug %]</a> i don't think it's right to force a new tab in this instance.
Attached patch patch v2Splinter Review
Attachment #675893 - Attachment is obsolete: true
Attachment #678758 - Flags: review?(dkl)
Comment on attachment 678758 [details] [diff] [review] patch v2 Review of attachment 678758 [details] [diff] [review]: ----------------------------------------------------------------- r=dkl
Attachment #678758 - Flags: review?(dkl) → review+
thanks dkl :) Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.0/ added extensions/ShadowBugs modified extensions/InlineHistory/Extension.pm added extensions/ShadowBugs/Config.pm added extensions/ShadowBugs/Extension.pm added extensions/ShadowBugs/template added extensions/ShadowBugs/web added extensions/ShadowBugs/template/en added extensions/ShadowBugs/template/en/default added extensions/ShadowBugs/template/en/default/hook added extensions/ShadowBugs/template/en/default/hook/bug added extensions/ShadowBugs/template/en/default/hook/global added extensions/ShadowBugs/template/en/default/hook/bug/comments-aftercomments.html.tmpl added extensions/ShadowBugs/template/en/default/hook/bug/edit-after_comment_textarea.html.tmpl added extensions/ShadowBugs/template/en/default/hook/bug/edit-after_custom_fields.html.tmpl added extensions/ShadowBugs/template/en/default/hook/bug/edit-custom_field.html.tmpl added extensions/ShadowBugs/template/en/default/hook/bug/show-header-end.html.tmpl added extensions/ShadowBugs/template/en/default/hook/global/user-error-errors.html.tmpl added extensions/ShadowBugs/web/shadow-bugs.js added extensions/ShadowBugs/web/style.css modified template/en/default/bug/edit.html.tmpl Committed revision 8374. Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.2/ added extensions/ShadowBugs modified extensions/InlineHistory/Extension.pm added extensions/ShadowBugs/Config.pm added extensions/ShadowBugs/Extension.pm added extensions/ShadowBugs/template added extensions/ShadowBugs/web added extensions/ShadowBugs/template/en added extensions/ShadowBugs/template/en/default added extensions/ShadowBugs/template/en/default/hook added extensions/ShadowBugs/template/en/default/hook/bug added extensions/ShadowBugs/template/en/default/hook/global added extensions/ShadowBugs/template/en/default/hook/bug/comments-aftercomments.html.tmpl added extensions/ShadowBugs/template/en/default/hook/bug/edit-after_comment_textarea.html.tmpl added extensions/ShadowBugs/template/en/default/hook/bug/edit-after_custom_fields.html.tmpl added extensions/ShadowBugs/template/en/default/hook/bug/edit-custom_field.html.tmpl added extensions/ShadowBugs/template/en/default/hook/bug/show-header-end.html.tmpl added extensions/ShadowBugs/template/en/default/hook/global/user-error-errors.html.tmpl added extensions/ShadowBugs/web/shadow-bugs.js added extensions/ShadowBugs/web/style.css modified template/en/default/bug/edit.html.tmpl Committed revision 8397. i've created cf_shadow_bug, but it's currently disabled. i'll leave the bug open as a reminder to activate the field once the code has been pushed.
pushed, and activated.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Component: Extensions: Other → Extensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: