• 
      

    Add a setting for all review bots to skip posting a review if there were no files processed.

    Review Request #8192 — Created May 27, 2016 and discarded

    Information

    ReviewBot
    release-0.2.x

    Reviewers

    Add a setting for all review tools to skip posting a review if there were no files processed. I'm not a big fan of the variable naming, it seems confusing, but I couldn't think of better ones. Suggestions are welcome.

    I've been using this for a while locally and finally polished it up a bit for review.

    I have just the PEP8 and pyflakes bots enabled.

    • Setting defaults to off
      • Posting a powershell file results in a review posted.
      • Posting a python file results in a review posted.
    • Turn setting on for both bots
      • Posting a powershell file results in silent bots (verified by logging).
      • Posting a python file results in a review posted.

    • Revision 2 is currently untested as I ran in to some issues with trying to manage the settings entries in the database through django. I may need some assistance if you'd like me to test it before submission *
    Description From Last Updated

    Also, you have a typo in your testing done: "pythong"

    brenniebrennie

    Can you clean up your testing done? We have support for lists via markdown, and Verifications really doesn't belong there.

    brenniebrennie

    This should be in __init__, as it is an attribute of the instance, not the class itself. These other attributes …

    brenniebrennie

    We don't really need this here. We can pull the setting out when checking it. Also, we should call this …

    brenniebrennie

    The try should be inside the if in this configuration.

    brenniebrennie

    Format as: if (not review.ignore_irrelevant or (review.ignore_irrelevant and review.relevant_review)): Also, this is logically equivalent to: not review.ignore_irrelevant or review.relevant_review

    brenniebrennie

    We use signgle quotes for all strings.

    brenniebrennie

    Single quotes for strings.

    brenniebrennie

    Remove this.

    brenniebrennie

    Blank line between these.

    brenniebrennie

    post_trivial.

    brenniebrennie

    post_trivial and it should default to True.

    brenniebrennie

    Single quotes.

    brenniebrennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          bot/reviewbot/tasks.py
          extension/reviewbotext/evolutions/add_tool_relevant_review_setting.py
          bot/reviewbot/tools/__init__.py
          extension/reviewbotext/evolutions/__init__.py
          extension/reviewbotext/admin.py
          extension/reviewbotext/extension.py
          extension/reviewbotext/models.py
          bot/reviewbot/processing/review.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          bot/reviewbot/tasks.py
          extension/reviewbotext/evolutions/add_tool_relevant_review_setting.py
          bot/reviewbot/tools/__init__.py
          extension/reviewbotext/evolutions/__init__.py
          extension/reviewbotext/admin.py
          extension/reviewbotext/extension.py
          extension/reviewbotext/models.py
          bot/reviewbot/processing/review.py
      
      
    2. 
        
    BD
    brennie
    1. 
        
    2. Show all issues

      Can you clean up your testing done? We have support for lists via markdown, and Verifications really doesn't belong there.

      1. Weird, when I first tried it I couldn't get the lists to indent but it worked this time.

    3. bot/reviewbot/processing/review.py (Diff revision 1)
       
       
      Show all issues

      This should be in __init__, as it is an attribute of the instance, not the class itself.

      These other attributes should also be moved into __init__ but that doesn't need to be done now.

      Also, can we use the term "trivial review" to refer a review with no processed files?

    4. bot/reviewbot/processing/review.py (Diff revision 1)
       
       
      Show all issues

      We don't really need this here. We can pull the setting out when checking it.

      Also, we should call this post_empty_reviews.

      1. I called it post_trivial_reviews to match the trivial_review setting.

    5. bot/reviewbot/tasks.py (Diff revision 1)
       
       
       
      Show all issues

      The try should be inside the if in this configuration.

    6. bot/reviewbot/tasks.py (Diff revision 1)
       
       
       
      Show all issues

      Format as:

      if (not review.ignore_irrelevant or
          (review.ignore_irrelevant and review.relevant_review)):
      

      Also, this is logically equivalent to:

      not review.ignore_irrelevant or review.relevant_review
      
      1. Switched to:

        if (post_trivial_reviews or not review.trivial_review):
        
    7. bot/reviewbot/tasks.py (Diff revision 1)
       
       
      Show all issues

      We use signgle quotes for all strings.

      1. Is that a new requirement? Literally every log statement in this file uses double quotes ....

        I'd switch them all but I don't want to conflate the review.

    8. bot/reviewbot/tasks.py (Diff revision 1)
       
       
      Show all issues

      Single quotes for strings.

      1. Same response as above.

    9. bot/reviewbot/tasks.py (Diff revision 1)
       
       
      Show all issues

      Remove this.

    10. bot/reviewbot/tools/__init__.py (Diff revision 1)
       
       
       
      Show all issues

      Blank line between these.

    11. extension/reviewbotext/admin.py (Diff revision 1)
       
       
      Show all issues

      post_trivial.

      1. Changed to post_trivial_reviews.

    12. extension/reviewbotext/extension.py (Diff revision 1)
       
       
      Show all issues

      post_trivial and it should default to True.

    13. extension/reviewbotext/models.py (Diff revision 1)
       
       
      Show all issues

      Single quotes.

      1. Every other help_text entry in this file uses double quotes...

    14. 
        
    brennie
    1. 
        
    2. Show all issues

      Also, you have a typo in your testing done: "pythong"

    3. 
        
    BD
    david
    1. I'm working on a major reboot of Review Bot which uses the new status updates feature, which will eliminate the need for this (since we'll have feedback that a tool was run without needing to create a review).

    2. 
        
    david
    Review request changed
    Status:
    Discarded