Create extension for auto-assigning students to the students group

Review Request #7856 — Created Jan. 8, 2016 and discarded

Information

rb-extension-pack
master

Reviewers

A simple extension for auto-assigning students working on Review Board to
the "students" group.

I can imagine this maybe being useful for other projects as well, so I can
see this expanding out to allow multiple auto-assignments, but for now I've
just hard-coded the "students" group.

Created some test users and a "students" group. Entered the extension
configuration page and added some users in the comma-separated list to
auto-assign. Created review requests for the users in the list and saw
that they were correctly added to the "students" group. The review requests
from the other users were not.

Description From Last Updated

'RBAutoAssigner' imported but unused

reviewbotreviewbot

'json' imported but unused

reviewbotreviewbot

Single quotes.

brenniebrennie

Blank line here.

brenniebrennie

Same here.

brenniebrennie

And here.

brenniebrennie

logging.info, etc will do % interpolation with positional arguments, so you can do: logging.info('foo %s', bar)

brenniebrennie

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

reviewbotreviewbot

Single quotes

brenniebrennie

Prefer MANIFEST.in over package_data

brenniebrennie

Instead of doing this on publish, what about on create?

daviddavid

I don't think we care if they've joined the group or not.

daviddavid

Would be better to do Group.objects.get(name=self.auto_assign_group) and catch Group.DoesNotExist

daviddavid

Not possible.

daviddavid

Limiting to 40 characters means we won't be able to put in very many usernames.

daviddavid
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbauto_assigner/rbauto_assigner/admin_urls.py
        rbauto_assigner/rbauto_assigner/extension.py
        rbauto_assigner/setup.py
    
    Ignored Files:
        rbauto_assigner/rbauto_assigner/__init__.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbauto_assigner/rbauto_assigner/admin_urls.py
        rbauto_assigner/rbauto_assigner/extension.py
        rbauto_assigner/setup.py
    
    Ignored Files:
        rbauto_assigner/rbauto_assigner/__init__.py
    
    
  2. Show all issues
     'RBAutoAssigner' imported but unused
    
  3. Show all issues
     'json' imported but unused
    
  4. rbauto_assigner/setup.py (Diff revision 1)
     
     
    Show all issues
    Col: 80
     E501 line too long (100 > 79 characters)
    
  5. 
      
brennie
  1. 
      
  2. Show all issues

    Single quotes.

  3. Show all issues

    Blank line here.

  4. Show all issues

    Same here.

  5. Show all issues

    And here.

  6. Show all issues

    logging.info, etc will do % interpolation with positional arguments, so you can do:

    logging.info('foo %s',
                 bar)
    
  7. 
      
brennie
  1. 
      
  2. rbauto_assigner/setup.py (Diff revision 1)
     
     
     
     
    Show all issues

    Single quotes

  3. rbauto_assigner/setup.py (Diff revision 1)
     
     
     
     
     
    Show all issues

    Prefer MANIFEST.in over package_data

  4. 
      
mike_conley
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbauto_assigner/rbauto_assigner/admin_urls.py
        rbauto_assigner/rbauto_assigner/extension.py
        rbauto_assigner/setup.py
        rbauto_assigner/rbauto_assigner/forms.py
    
    Ignored Files:
        rbauto_assigner/rbauto_assigner/__init__.py
    
    
  2. 
      
david
  1. Given that this is currently highly student-specific (right now), instead of putting it in rb-extension-pack, how about in the misc/ directory of the student-sonar repository? We can always move it when/if we make it more generic.

  2. Show all issues

    Instead of doing this on publish, what about on create?

    1. I don't see a signal for review request creation. Should I add one in a separate review request?

    2. There's no explicit creation signal, but you can listen to django.db.models.signals.pre_save for ReviewRequest and see if the pk is falsy.

  3. Show all issues

    I don't think we care if they've joined the group or not.

  4. Show all issues

    Would be better to do Group.objects.get(name=self.auto_assign_group) and catch Group.DoesNotExist

  5. Show all issues

    Not possible.

  6. Show all issues

    Limiting to 40 characters means we won't be able to put in very many usernames.

  7. 
      
mike_conley
Review request changed

Status: Discarded

Change Summary:

Re-posted for the student-sonar repo at https://reviews.reviewboard.org/r/7872/

Loading...