Skip to content
Commits on Apr 25, 2009
  1. Limit number of repetitions for retryable requests

    committed Apr 25, 2009
    If a RetryableAPIError exception is raised, we only repeat the request
    MAX_RETRIES number of times before raising an APIError. This guards against
    infinite loops, while still allowing most 403 errors to be worked around.
    
    As I explained in the commit message for
    6cae2e3, this logic is still pretty vague
    because GitHub hasn't documented their rate limiting policy yet.
  2. Retry 403s and Net::HTTPBadResponse errors.

    committed Apr 25, 2009
    My testing strongly suggests that when GitHub returns status code 403 the
    request can be retried. This may be how they implement rate limiting. So, if
    we get a 403 we simply repeat the request. We don't wait between requests
    because there is not yet any evidence that it would benefit us. Hopefully,
    once the rate limiting is documented, we can revisit this issue.
    
    We also retry on Net::HTTPBadResponse exceptions. These are typically raised
    when something between the client and the server clobbers the response, so
    repeating the request is the most sensible approach.
    
    We don't limit the number of retries which means this code could end up
    looping forever. I'm loath to specify some arbitrary limit, however, without
    documentation on what to expect. For example, in the case of 403 errors, my
    testing reveals that sometimes we succeed after retrying twice, and other
    times it may take nearly ten retries.
  3. Add RetryableAPIError.

    committed Apr 25, 2009
    If GitHub responds with an error that implies the request would succeed if we
    simply repeated it, we raise a RetryableAPIError.
Commits on Apr 24, 2009
Commits on Apr 23, 2009
  1. @fcoury

    Merge commit 'runpaint/master'

    fcoury committed Apr 23, 2009
  2. @fcoury

    Fix README

    fcoury committed Apr 23, 2009
  3. Testing...

    committed Apr 23, 2009
  4. Make .keys and .emails return Arrays.

    committed Apr 23, 2009
    The .keys and .emails methods were returning HTTParty responses which were
    confusing to the caller, and contained an unnecessary level of depth. We now
    index the response with the appropriate hash key, thus returning its Array
    value.
  5. Removing superfluous yield.

    committed Apr 23, 2009
    The `submit` method yields to the block it's been passed, prints out a trace,
    then makes almost the same yield again. I assume that this is in error, and
    could have been caused by my previous merge.
  6. Undo 3cb8fbd.

    committed Apr 23, 2009
    Commit 3cb8fbd has been made obsolete by
    commit 67320c5. Now we're appending the
    credentials to GET requests, .keys and .emails can return to using the correct
    request type.
  7. Add credentials to `default_params` for auth'd GET.

    committed Apr 23, 2009
    We want the token and login to be sent for all authenticated queries. They
    were being sent for POST requests, but, seemingly, not for GETs, causing
    methods relying on the latter to fail. HTTParty's `default_params` method
    causes parameters so set to be sent on every request. We specify `login` and
    `token` as default parameters if the request is authenticated.
  8. POST is required for /user/keys and /user/emails.

    committed Apr 23, 2009
    The .keys and .emails methods returned a "not authenticated" error because
    they were fetched via GET and thus the credentials were not sent. Using POST
    fixes this bug.
Commits on Apr 22, 2009
  1. @fcoury
  2. @fcoury

    Version bump to 0.0.7

    fcoury committed Apr 22, 2009
  3. @fcoury

    Add '?' suffix to generated method names of bools

    committed with fcoury Apr 23, 2009
    Objects with values that are either true or false have an '?' appended to
    their name to fit with standard Ruby convention. For example, Repository
    objects now have a .fork? and .private? method. This convention is not
    reflected in the value of the @keys instance variable, because we assume
    callers will use it to iterate through the instance variables, whose names do
    not have a '?' suffix...
    
    Note: This commit theoretically breaks backward compatibility, as the
    unadorned method names no longer work.
    
    This closes #2.
    
    Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
  4. @fcoury

    Use new .all_issues method.

    committed with fcoury Apr 23, 2009
    Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
  5. @fcoury

    Add .all_issues method to get issues of all states.

    committed with fcoury Apr 23, 2009
    This closes #16.
    
    Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
  6. @fcoury

    Use .validate_args to validate states.

    committed with fcoury Apr 23, 2009
    Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
  7. @fcoury

    Support validation of states with validate_args.

    committed with fcoury Apr 23, 2009
    Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
  8. @fcoury

    Make Issue::STATES constant holding valid states.

    committed with fcoury Apr 23, 2009
    Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
  9. Add '?' suffix to generated method names of bools

    committed Apr 22, 2009
    Objects with values that are either true or false have an '?' appended to
    their name to fit with standard Ruby convention. For example, Repository
    objects now have a .fork? and .private? method. This convention is not
    reflected in the value of the @keys instance variable, because we assume
    callers will use it to iterate through the instance variables, whose names do
    not have a '?' suffix...
    
    Note: This commit theoretically breaks backward compatibility, as the
    unadorned method names no longer work.
    
    This closes #2.
  10. Use new .all_issues method.

    committed Apr 22, 2009
  11. Add .all_issues method to get issues of all states.

    committed Apr 22, 2009
    This closes #16.
  12. @fcoury

    First pass at a backup script using the API.

    committed with fcoury Apr 22, 2009
    Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
  13. Merge branch 'master' of git://github.com/fcoury/octopi

    committed Apr 22, 2009
    Conflicts:
    	lib/octopi.rb
  14. @fcoury

    Improved README

    fcoury committed Apr 22, 2009
  15. @fcoury

    Improved README

    fcoury committed Apr 22, 2009
  16. @fcoury

    Improved README

    fcoury committed Apr 22, 2009
  17. @fcoury

    Improved README

    fcoury committed Apr 22, 2009
Something went wrong with that request. Please try again.