Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This library doesn't work with the Github API v3 #110

Closed
Pomax opened this issue Mar 6, 2014 · 7 comments
Closed

This library doesn't work with the Github API v3 #110

Pomax opened this issue Mar 6, 2014 · 7 comments

Comments

@Pomax
Copy link

Pomax commented Mar 6, 2014

I tried running the following simple code:

var github = new Github({ token: ".....<keyhere>.....", auth: "oauth"});
var repo = github.getRepo("Pomax", "pomax.github.io");
repo.contents("master", "gh-weblog/content", function(err, result) { console.warn(err); console.log(result); }, true);
repo.remove("master", "gh-weblog/content/2013-10-31-11-26-36.json", function(err, result) { console.log(err, result); });

But this generates one error after another. The path handling in remove is not in line with the v3 API, in browser context the global vars are getting set wrong:

  • _ ends up being unknown on line 407, despite underscore having loaded
  • XMLHttpRequest gets overwritten in function scope rather than using var XMLHTTPRequest = (typeof XMLHTTPRequest === "undefined" ? false : XMLHTTPRequest);)
  • Base64 is not necessary at all in browser context (the atob() function already exists)

Even fixing those things, I get errors that the update call to git/trees is missing sha values; dir entires should have sha values as well, so I removed the filter that takes them out, and then the github API still throws up errors, so there are some problems here that prevent github.js from being usable with the API v3.

@flamed0011
Copy link

Same experience here (there is a fix available for repo.contents, but didn't get repo.remove to work). I wonder if the michael is still maintaining this repo (last fixed issues are around 2 months ago). A statement on future plans from him would be nice. Is there a fork which is more up-to-date?

@Pomax
Copy link
Author

Pomax commented Apr 10, 2014

I'm currently using phil schatz' fork over at https://github.com/philschatz/octokit.js

@mattpass
Copy link
Collaborator

I'd agree, would be nice to see some updates. I spent some time in Sep/Oct last year getting this lib to v0.9, but seemed to be the only one maintaining it. I think @michael had made someone at GitHub a maintainer, who promised to work on this and clear all issues, but nothing happened.

Would be a shame to let the repo die a slow death, but I think Michael is quite busy on Substance now and I wonder if that'll be the case? :-/

I'd be happy to work again on this repo and start clearing issues, but only if it were transferred to me. Bit less keen on working hugely on someone else's repo.

@Pomax
Copy link
Author

Pomax commented Apr 10, 2014

you might like to jump onto Phil's fork, then. It's being maintained, and PRs are getting accepted =)

@michael
Copy link
Collaborator

michael commented Apr 10, 2014

Hey guys!

Sorry for being so unresponsive. I really can't promise when I have the time to look over the issues and pull requests. However when I do, I wanna do it properly. I don't have an active project that uses the Github API at the moment which makes it really difficult for me to verify the changes. It's also hard to identify a common set of features, since this lib was never intended to be a complete wrapper for the Github API. So as far as this repo goes I'd suggest to streamline the existing features, and keep them compatible with the latest official Github API's.

@mattpass You're very welcome to start clearing issues and merging in pull requests when they make sense to you. @jlord same applies to you. :) Thanks for the help!

-- Michael

@petrosh
Copy link
Contributor

petrosh commented Apr 12, 2014

maybe #105?

@Pomax
Copy link
Author

Pomax commented Sep 6, 2014

the PR for this landed, so technically it works for "v3", even if the library itself still doesn't work.

@Pomax Pomax closed this as completed Sep 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants