jspm / github

Github Location Service
16 stars 43 forks source link

github registry should not require git client #66

Closed jhoguet closed 8 years ago

jhoguet commented 9 years ago

I have been experimenting with jspm for several months now with the hopes of evangelizing it to a wider audience at my company, but there are a few concerns that are holding me back, this is one of them

why does the github registry require both the git client and the github api?

In case my reason for concern isn't obvious, each point of coupling increases the surface area for something to go wrong.

It appears that the git client is used to lookup available versions (git tags).

It appears that you can also do this with the github api

curl  https://api.github.com/repos/webdriverio/webdriverio/git/refs/tags

Is there a good reason the git client is needed? If not, should I start a pull request or is this already in the works?

guybedford commented 9 years ago

Yes - ideally we would not be calling out to the local git executable at all, and this is being tracked in https://github.com/jspm/github/issues/25.

The reason we call out to git is to get the tag information via git ls-remote. This is the fastest protocol for this offered by GitHub (we can filter to just tags) without any rate limits.

guybedford commented 9 years ago

If there was a way to run git ls-remote through some Node implementation that would be ideal though.

jhoguet commented 9 years ago

@guybedford thanks for your response and hard work moving JSPM forward.

I understand the git client may be a faster way of getting the tags, but is it so much faster than http that it is worth adding the complexity of a second client(request and git) with a second protocol (http and git) to the same remote service (github)?

Regarding the rate limits concern, isn't this a side effect of using the github http api? In other words, switching the "lookup" call to use the github api would not make us have to auth to avoid the rate limit, we already have to auth to avoid the rate limit because we use the http api for everything else?

guybedford commented 9 years ago

@jhoguet note that even though it calls out to git, it still runs over https. It's just a more efficient version of the protocol without any rate limits, which really does make a big difference to performance.

guybedford commented 9 years ago

(we may be able to avoid the rate limit in future by removing the feature of using github releases)

guybedford commented 8 years ago

This is tracking in https://github.com/jspm/github/issues/25.