• 
      

    Properly handle 404s in BitBucket API layer.

    Review Request #7376 — Created June 4, 2015 and submitted

    Information

    Review Board
    release-2.0.x
    869e2ad...

    Reviewers

    We weren't translating 404 errors into FileNotFound, which could result in
    uncaught exceptions when trying to detect whether files existed.

    Ran unit tests. The newly-added test fails without the exception handling with
    the reported error, and succeeds after.

    Description From Last Updated

    I don't think with_traceback is a thing in Python 2.x. I can't make it work, and it's not in anything …

    chipx86chipx86

    This should take the path and revision as arguments.

    chipx86chipx86
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/hostingsvcs/bitbucket.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/hostingsvcs/bitbucket.py
      
      
    2. 
        
    chipx86
    1. 
        
    2. reviewboard/hostingsvcs/bitbucket.py (Diff revision 1)
       
       
      Show all issues

      This should take the path and revision as arguments.

      1. We don't have those in this context, and the get_file_exists implementation doesn't care about them.

      2. It's going to fail then. The path is a required argument.

      3. Maybe this can return some local exception, and the caller can catch it and raise the proper error with the path and revision?

    3. 
        
    david
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/hostingsvcs/bitbucket.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/hostingsvcs/bitbucket.py
      
      
    2. 
        
    chipx86
    1. I think we need a unit test for this.

    2. reviewboard/hostingsvcs/bitbucket.py (Diff revisions 1 - 2)
       
       
      Show all issues

      I don't think with_traceback is a thing in Python 2.x. I can't make it work, and it's not in anything but the Python 3 docs.

    3. 
        
    david
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/hostingsvcs/tests.py
          reviewboard/hostingsvcs/bitbucket.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/hostingsvcs/tests.py
          reviewboard/hostingsvcs/bitbucket.py
      
      
    2. 
        
    chipx86
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.0.x (3505190)