Use the GitHub API to determine repository validity.

Review Request #4853 — Created Oct. 26, 2013 and submitted

Information

Review Board
master

Reviewers

Use the GitHub API to determine repository validity.

We were previously attempting to access GitHub repositories directly
through Git, which required a valid SSH key configured. This led to
some problems.

  1. It required that the user properly create and associate an SSH key.
    While annoying, this was actually made worse by the "Associate SSH
    key" checkbox, which associated as a deploy key. Deploy keys could
    only be used for one repository at a time, and this caused massive
    confusion.
  2. It meant that we only knew that a repository could be accessed by
    that key, but we didn't know if anything else was invalid.
  3. It was a problem in networks that didn't allow SSH access to the
    outside world.
  4. When validation failed, we didn't know much, and the resulting error
    was hard to figure out.

Now, the GitHub API is used to validate repositories. We can tell the
user that the repository wasn't found, and list possible reasons why. We
can also make sure that there isn't a mismatch between the selected plan
and the public/private setting of the repository.

Hand-tested every error condition, as well as a valid repository.

Saw that the Associate SSH Key checkbox was gone.

Unit tests pass.

Description From Last Updated

Bare exceptions seem odd. Can we at least make this an SCMError?

daviddavid

Same here.

daviddavid

typo: ImportError

daviddavid
david
  1. 
      
  2. reviewboard/hostingsvcs/github.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     

    Bare exceptions seem odd. Can we at least make this an SCMError?

  3. reviewboard/hostingsvcs/github.py (Diff revision 1)
     
     
     
     
     
     
     
     

    Same here.

  4. reviewboard/hostingsvcs/tests.py (Diff revision 1)
     
     

    typo: ImportError

    1. I'm surprised my tests at all run, given that..

  5. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...