Add extensibility to the comment issue bar on the review page

Review Request #7841 — Created Dec. 31, 2015 and discarded

Information

Review Board
master

Reviewers

Add a hook to support additional UI on the comment issue bar on review page.

This hook is called CommentIssueBarActionHook. It allows an extension to render
additional UI for a comment in the comment issue bar. The hook makes itself and
the CommentIssueManager instance available to the extension. The extension can 
use the CommentIssueBar instance to manage the UI elements and the 
CommentIssueManager instance to set or get the extra_data for the comment.

CommentIssueManager exposes two new APIs getCommentExtraData and 
setCommentExtraData which can be used by the extension to manage custom fields.
Tested with an extension that I am developing. I was able to see the parameters
that I had set in extra_data and modify them from the extensions.
Description From Last Updated

So this worries me. There's plenty of state that other users probably shouldn't access. I think what we should do …

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/base_comment.py
        reviewboard/reviews/models/base_comment.py
        reviewboard/webapi/resources/review_diff_comment.py
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/models/commentIssueManagerModel.js
        reviewboard/static/rb/js/extensions/models/commentIssueBarActionHookModel.js
        reviewboard/static/rb/js/views/commentIssueBarView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/base_comment.py
        reviewboard/reviews/models/base_comment.py
        reviewboard/webapi/resources/review_diff_comment.py
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/models/commentIssueManagerModel.js
        reviewboard/static/rb/js/extensions/models/commentIssueBarActionHookModel.js
        reviewboard/static/rb/js/views/commentIssueBarView.js
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/reviews/models/base_comment.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    So this worries me. There's plenty of state that other users probably shouldn't access.

    I think what we should do is instead extend the new APIExtraDataAccessHook (see https://reviews.reviewboard.org/r/8084/) to let extensions decide on a key-by-key basis whether a user should have access. That way your extension can grant access to the review author for your own key without potentially opening up security issues for other extensions.

  3. 
      
david
Review request changed

Status: Discarded

Loading...