Add functionality for private review requests

Review Request #7727 — Created Oct. 23, 2015 and discarded

sherman
Review Board
master
reviewboard, students

Project Description
Today, review requests can be made private if they're filed against a private repository or invite-only review group. However, there's no way to make one private if you just want to assign it to specific people.

This project would allow a review request to be marked as private. Private review requests will only be visible to those who are on the reviewer list.

Only invite-only groups or individual users will be allowed as reviewers.

It should be possible to make a public review request private, but only if the reviewers list meets the above criteria, and no other reviews have been made. It should be possible to make a review request public at any point.

The API also needs to be updated to include a field representing whether the review request is private.

Updates
Pre 11/13/15
Update accessibility for private review requests

Fix issues raised in review request

Create a new field for private instead of using extra_data

Update _query for to filter private requests

Limit the permission to set a review request private to just the owner and super user

Fix error with setting private to F instead of T

11/13/15
Move new private field to BaseReviewRequestDetails model since it is used in both ReviewRequest and ReviewRequestDraft

Update database evolutions accordingly

11/16/15
Experiment with different ways to set the private field to true

11/18/15
Add PrivateField to reviews/buildin_fields.py

Clean up formatting caught by ReviewBot

Fix some typos and docstrings in review request model

11/20/15
Set Private button finally works!

Clean up some formatting

11/25/15
Create a new button for making a review request no longer private and write the handler for it

Make the existing button a little prettier

Remove debugging code

Fix issues raised in the last review request

11/27/15
Add very basic permissions for who can change the privacy status of a review request. This is done by hiding the set private button if the user is not a superuser or the submitter of the review request.

11/30/15
Add a basic check to see if the privacy status of the review request can be changed. The status cannot be changed if there are non-invite-only groups in the list of target review groups or if the user does not have the required editting permissions. If it cannot, the publish button gets greyed out. A warning is also logged to the console.

Tested the new check mentioned above.

12/1/15
Add a toggle for the privacy lock icon so there is only one button instead of two. Now unlock icon will be shown when the review request can be set unprivate, meaning that the review request is currently private. If a review request is not private, a lock icon will be shown instead, indicating that the review request can be set to private. These icons will only be shown if the user already has the necessary permissions.

Test the toggling for the new single button.

12/2/15
Allow review requests to be accessed by submitters and target people in the "All Review Requests" page. These were previously hidden due to the strictness of the private query.

Test set private
To test the "set private" button, I selected an existing review request and clicked the button to set it to private. I then opened an icognito window to check that the private review request did not show up under "All Review Requests".

Next I set a particular review request to private and then logged in to the user account that submitted the review request. Using that account, I was still able to access the review request.

I also tried to directly open a review request that was set to private by going directly to the URL in the incognito window and was greeted by a Permission Denied error. This validates the functionality.

Test unset private
To test the "unset private" button, I first set a review request to private. Then, verifying that it was correctly set to private, clicked the "unset private" button. I opened an incognito window to make sure the review request had once again appeared under "All Review Requests". I also logged into a user account to make sure a logged in user could also access the review request.

Test basic permissions for changing privacy status
I tested the basic permissions with three scenarios. First I logged in on a superuser account and was able to set any review request to private, regardless of the submitter. The change privacy button was not hidden in this case.

Next I logged in to a regular account and was able to change the privacy status of review requests that were submitted by that account. The change privacy button was hidden for review requests for which that account was not the submitter.

Finally I logged out and was unable to change the privacy status of any review requests. The privacy buttons were always hidden in this case.

Test set private when the review list contains non-invite-only review groups
I tested this by creating a review group that was not invite-only and adding the group to the reviewer list for a review request. I then tried to set the review request to private by clicking the "set private" button. When I did this, the "publish request" button was greyed out and an error was logged to the console.

Using an alternate review request, I added a review group that was invite-only and was able to properly set the review request to private. I then signed in on an account where a user was a member of that invite-only review group and was able to view the review request on that account. This indicates that the functionality is working as intended.

Test change privacy icon toggle
First I logged in on the superuser account to be able to change the privacy status of any review request. When selecting a particular review request, the single lock icon appeared, meaning that I could set the review request to private. I clicked the button and published the review request. After doing this, the lock icon turned into an unlock icon meaning that the review request was private and could be set to no longer private.


Description From Last Updated

You can just use self.is_mutable_by(user) here.

daviddavid

You can just use self.is_mutable_by(user) here.

daviddavid

This method doesn't add anything over users just accessing review_request.private. I'd get rid of it.

daviddavid

Single quotes.

brenniebrennie

Only one space after a period.

brenniebrennie

"superuser"

brenniebrennie

I feel like this should raise an exception that can be caught so it can be returned to the front …

brenniebrennie

Again, I feel this should throw an exception.

brenniebrennie

This will need to be tested.

brenniebrennie

Update the docstring to indicate the new changes.

brenniebrennie

Col: 80 E501 line too long (81 > 79 characters)

reviewbotreviewbot

Col: 1 W391 blank line at end of file

reviewbotreviewbot

The docstring should make it clear that this does not call save().

brenniebrennie

Missing a period.

AD adriano

As far as I can tell, Django QuerySets are iterable, and Python's for loops are smart enough to only execute …

AD adriano

There seems to be a typo: exlude -> exclude. You also might want to consider using the exists() method instead, …

AD adriano

Col: 80 E501 line too long (81 > 79 characters)

reviewbotreviewbot

Col: 1 W391 blank line at end of file

reviewbotreviewbot

Col: 13 E265 block comment should start with '# '

reviewbotreviewbot

Col: 58 E262 inline comment should start with '# '

reviewbotreviewbot

Col: 57 E261 at least two spaces before inline comment

reviewbotreviewbot

Col: 22 E203 whitespace before ':'

reviewbotreviewbot

Col: 80 E501 line too long (84 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (105 > 79 characters)

reviewbotreviewbot

Col: 9 E265 block comment should start with '# '

reviewbotreviewbot

Col: 80 E501 line too long (84 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (105 > 79 characters)

reviewbotreviewbot

Can we rename this to isPrivate so we don't have to quote it? You'll need to add an entry to …

brenniebrennie

Same here.

brenniebrennie

JS objects can't end in a comma.

brenniebrennie

Col: 80 E501 line too long (84 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (105 > 79 characters)

reviewbotreviewbot

Needs: def should_render(self, value): return False

brenniebrennie

Col: 80 E501 line too long (84 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (105 > 79 characters)

reviewbotreviewbot

How about "This field is is rendered through a different mechanism and so the default rendering mechanism doesn't apply."

brenniebrennie

Needs Args and Returns

brenniebrennie

Col: 80 E501 line too long (84 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (105 > 79 characters)

reviewbotreviewbot

Returns: is documented here but I think Args: may need to be documented as well.

AH ahache

Same as above?

AH ahache

Did you update RBSearchView.get_results?

brenniebrennie

Can we call this can_set_private and have it return whether or not the user can change the privacy? Also, can …

brenniebrennie

Remove this.

brenniebrennie

See comment about can_set_private.

brenniebrennie

Combine these rules?

brenniebrennie

Trailing whitespace.

brenniebrennie

Trailing whitespace.

brenniebrennie

We should only show one of these at a time. The JS can toggle the class between fa-unlock and fa-lock.

brenniebrennie

I prefer fa-unlock-alt for this icon.

brenniebrennie

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Col: 17 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 17 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 17 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 21 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 21 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 21 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 17 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Col: 17 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 17 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 21 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 21 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 21 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Col: 57 W291 trailing whitespace

reviewbotreviewbot

Col: 52 W291 trailing whitespace

reviewbotreviewbot

Col: 73 W291 trailing whitespace

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
    
    
  2. 
      
david
  1. This review request seems to supercede your old one at /r/7705/ . If that's true, can you discard that one?

    1. Sure thing. I think I accidentally created this one by doing rbt post instead of rbt post -u For future reference, I should always use the latter when updating a review request rather than creating a new one, correct?

    2. Correct.

    3. You can also do rbt post -r 7727, which will automatically use this one instead of asking which one to use.

  2. 
      
david
  1. 
      
  2. You can just use self.is_mutable_by(user) here.

  3. You can just use self.is_mutable_by(user) here.

  4. reviewboard/reviews/models/review_request.py (Diff revision 1)
     
     
     
     

    This method doesn't add anything over users just accessing review_request.private. I'd get rid of it.

  5. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
    
    
  2. 
      
brennie
  1. 
      
  2. Single quotes.

    1. The other fields in this file use double quotes:

      public = models.BooleanField(_("public"), default=False)
      changenum = models.PositiveIntegerField(_("change number"), blank=True,
                                              null=True, db_index=True)
      
    2. We're slowly fixing up old code that was inconsistent. New code should prefer single quotes.

  3. Only one space after a period.

  4. reviewboard/reviews/models/review_request.py (Diff revision 2)
     
     
     
     
     

    I feel like this should raise an exception that can be caught so it can be returned to the front end.

    You'll want to confirm this with Christian before switching your implementation.

  5. Again, I feel this should throw an exception.

  6. This will need to be tested.

  7. Update the docstring to indicate the new changes.

  8. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
    
    
  2. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. Col: 80
     E501 line too long (81 > 79 characters)
    
  3. Col: 1
     W391 blank line at end of file
    
  4. 
      
brennie
  1. 
      
  2. The docstring should make it clear that this does not call save().

  3. 
      
AD
  1. 
      
  2. Missing a period.

  3. reviewboard/reviews/models/review_request.py (Diff revision 5)
     
     
     
     

    As far as I can tell, Django QuerySets are iterable, and Python's for loops are smart enough to only execute the database query once. So (unless you plan to reuse this list of groups later) there is no need to cache the results as a list and we can replace this with:

    for group in self.target_groups.all():
    
  4. There seems to be a typo: exlude -> exclude.

    You also might want to consider using the exists() method instead, as it might be slightly more efficient. Something like:

    if self.reviews.exclude(user=user).exists():
    
  5. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. Col: 80
     E501 line too long (81 > 79 characters)
    
  3. Col: 1
     W391 blank line at end of file
    
  4. reviewboard/reviews/managers.py (Diff revision 6)
     
     
    Col: 13
     E265 block comment should start with '# '
    
  5. reviewboard/reviews/managers.py (Diff revision 6)
     
     
    Col: 58
     E262 inline comment should start with '# '
    
  6. reviewboard/reviews/managers.py (Diff revision 6)
     
     
    Col: 57
     E261 at least two spaces before inline comment
    
  7. Col: 22
     E203 whitespace before ':'
    
  8. Col: 80
     E501 line too long (84 > 79 characters)
    
  9. Col: 80
     E501 line too long (105 > 79 characters)
    
  10. Col: 9
     E265 block comment should start with '# '
    
  11. 
      
SH
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. Col: 80
     E501 line too long (84 > 79 characters)
    
  3. Col: 80
     E501 line too long (105 > 79 characters)
    
  4. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. Col: 80
     E501 line too long (84 > 79 characters)
    
  3. Col: 80
     E501 line too long (105 > 79 characters)
    
  4. 
      
CA
  1. Just two minor comments. It definitely looks good so far in terms of the code at least. Cool stuff, Sherman!

  2. Could you fit this in one line? Or does it pass the character limit?

  3. reviewboard/reviews/managers.py (Diff revision 8)
     
     

    How come this is commented out? Are you keeping this for now because it might be used later?

  4. 
      
brennie
  1. 
      
  2. Can we rename this to isPrivate so we don't have to quote it?

    You'll need to add an entry to the attrToJSONMap.

  3. JS objects can't end in a comma.

  4. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. Col: 80
     E501 line too long (84 > 79 characters)
    
  3. Col: 80
     E501 line too long (105 > 79 characters)
    
  4. 
      
brennie
  1. 
      
  2. reviewboard/reviews/builtin_fields.py (Diff revision 9)
     
     

    Needs:

    def should_render(self, value): return False

  3. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. Col: 80
     E501 line too long (84 > 79 characters)
    
  3. Col: 80
     E501 line too long (105 > 79 characters)
    
  4. 
      
brennie
  1. 
      
  2. reviewboard/reviews/builtin_fields.py (Diff revision 10)
     
     
     

    How about

    "This field is is rendered through a different mechanism and so the default rendering mechanism doesn't apply."

  3. reviewboard/reviews/builtin_fields.py (Diff revision 10)
     
     

    Needs Args and Returns

  4. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
AH
  1. 
      
  2. Returns: is documented here but I think Args: may need to be documented as well.

  3. 
      
AH
  1. 
      
  2. Same as above?

  3. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
brennie
  1. Screenshots?

    For saving your, you'll want to look at overrideing BaseReviewRequestField.save_field to call can_set_private (see comments). e.g.

    def save_field(self, value):
        if value and not self.review_request_details.can_set_private(self.request.user):
            raise PublishError('...')
        elif not value and not self.review_request_details.can_unset_private(self.request.user):
            raise PublishError('...')
    
        self.review_request_details.private = value
    
  2. reviewboard/reviews/managers.py (Diff revision 13)
     
     
     
     
     

    Did you update RBSearchView.get_results?

  3. Can we call this can_set_private and have it return whether or not the user can change the privacy?

    Also, can we move this to BaseReviewRequestDetails?

  4. Remove this.

  5. See comment about can_set_private.

  6. reviewboard/static/rb/css/ui/buttons.less (Diff revision 13)
     
     
     
     
     
     
     
     
     

    Combine these rules?

  7. Trailing whitespace.

  8. Trailing whitespace.

  9. reviewboard/templates/reviews/review_detail.html (Diff revision 13)
     
     
     
     
     

    We should only show one of these at a time. The JS can toggle the class between fa-unlock and fa-lock.

  10. I prefer fa-unlock-alt for this icon.

  11. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. Col: 80
     E501 line too long (80 > 79 characters)
    
  3. Col: 17
     E128 continuation line under-indented for visual indent
    
  4. Col: 17
     E128 continuation line under-indented for visual indent
    
  5. Col: 17
     E128 continuation line under-indented for visual indent
    
  6. Col: 21
     E128 continuation line under-indented for visual indent
    
  7. Col: 21
     E128 continuation line under-indented for visual indent
    
  8. Col: 21
     E128 continuation line under-indented for visual indent
    
  9. Col: 17
     E128 continuation line under-indented for visual indent
    
  10. Col: 80
     E501 line too long (80 > 79 characters)
    
  11. Col: 17
     E128 continuation line under-indented for visual indent
    
  12. Col: 17
     E128 continuation line under-indented for visual indent
    
  13. Col: 21
     E128 continuation line under-indented for visual indent
    
  14. Col: 21
     E128 continuation line under-indented for visual indent
    
  15. Col: 21
     E128 continuation line under-indented for visual indent
    
  16. Col: 57
     W291 trailing whitespace
    
  17. 
      
SH
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. Col: 52
     W291 trailing whitespace
    
  3. Col: 73
     W291 trailing whitespace
    
  4. 
      
SH
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
SH
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/reviews/evolutions/__init__.py
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/reviews/evolutions/review_request_draft_private.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/managers.py
        reviewboard/reviews/models/base_review_request_details.py
        reviewboard/reviews/evolutions/review_request_private.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/css/ui/buttons.less
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
SH
david
Review request changed

Status: Discarded

Loading...