Skip to content

GitHub API auth limit (and a workaround) #586

Description

@barrywoolgar

Hello, I'm aware of the reasons for why RailsDiff.org stops working if your IP exceeds the unauthenticated API limit of 60 requests an hour, as discussed in #582.

A solution could be to optionally request a GitHub Personal Access Token from the user (only needs the public_repo scope ticked), store it in a browser session, and send this along with each request.

Request:

Please could the site be updated to show a warning if a 403 rate limit error is received from the API?

At present this is unhandled and just "hangs" with no feedback to the user that the issue is technically at their end, not with RailsDiff.

Workaround:

The workaround for anyone affected by this is to:

  1. Make a token (as above)
  2. Clone the repo, and follow the README installation instructions
  3. Edit app/api/github.ts and make the following change to add the auth option to the Octokit initialiser around line 12:
const github_token = "ghp_mytoken123123123123";
const octokit = new Octokit({ auth: github_token });
  1. Then run ember serve --environment production and visit http://localhost:4200/ - Using the production environment is the key undocumented bit as otherwise you'll only see dummy diff data.

I apologise for not creating a proper PR with the necessary UI changes, etc, but I'm not familiar with Ember at present. I thought it would be helpful to document a (clunky) way to get around this issue in the meantime.

Thanks for making such a great tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions