Automatically execute tools based on AutomaticRunGroups.

Review Request #6222 — Created Aug. 12, 2014 and submitted

Information

ReviewBot
master
999aa00...

Reviewers

Previously, all tools with run_automatically set to True were automatically
executed on every published review request. This has been broken since the
addition of tool profiles.

This change fixes automatic execution of tools and changes it such that when a
'review request published' signal is received, tools are automatically executed
only if a set of rules (specified as AutomaticRunGroups) are followed. An
AutomaticRunGroup is very similar to Review Board's DefaultReviewer - it is
basically a set of tool profiles which will be automatically executed when a
file in the diff matches the file regex specified.

Without any AutomaticRunGroups created, I published a review request with a
diff, and did not see a tool execution get created.

I then added some AutomaticRunGroups, and tried several cases where a tool
execution was not created (as expected):
- Published a new review request with no diff.
- Updated a review request's title (diff was not added).
- Published a review request in a repository that did not match any
AutomaticRunGroup's repos.
- Published a review request with files that did not match any
AutomaticRunGroup's file regexes.

I also tried publishing review requests where tool executions were created, and
reviews were posted by Review Bot:
- Matched an AutomaticRunGroup with a single profile.
- Matched an AutomaticRunGroup with multiple profiles.
- Matched several AutomaticRunGroups with overlapping sets of profiles, and saw
that only unique tool profiles were executed.

Description From Last Updated

This should probably log regexes that don't compile.

daviddavid

Instead of the Q expression, you can use status__in(ToolExecution.QUEUED, ToolExecution.RUNNING, ToolExecution.SUCCEEDED)

daviddavid

Can you use ToolExecution.QUEUED instead of the 'Q' literal?

daviddavid
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        extension/reviewbotext/managers.py
        extension/reviewbotext/handlers.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        extension/reviewbotext/managers.py
        extension/reviewbotext/handlers.py
    
    
  2. 
      
david
  1. 
      
  2. extension/reviewbotext/handlers.py (Diff revision 1)
     
     

    This should probably log regexes that don't compile.

  3. extension/reviewbotext/handlers.py (Diff revision 1)
     
     

    Instead of the Q expression, you can use status__in(ToolExecution.QUEUED, ToolExecution.RUNNING, ToolExecution.SUCCEEDED)

  4. extension/reviewbotext/handlers.py (Diff revision 1)
     
     

    Can you use ToolExecution.QUEUED instead of the 'Q' literal?

  5. 
      
anselina
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        extension/reviewbotext/managers.py
        extension/reviewbotext/handlers.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        extension/reviewbotext/managers.py
        extension/reviewbotext/handlers.py
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
anselina
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (ee3a60d)
Loading...