Git Product home page Git Product logo

gh-resolve's People

Contributors

dominicbarnes avatar juliangruber avatar lancejpollard avatar matthewmueller avatar stephenmathieson avatar yields avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

juliangruber

gh-resolve's Issues

using git ls-remote via a spawned process is expensive

I've been profiling duo to find ways to speed up builds.

It turns out that spawning child processes is very expensive, especially as the complexity of an app grows. Here's a gist that has the results of running duo under various conditions. (when building from scratch, there's always a disproportionate amount of time spent spawning processes)

I understand why we're using git ls-remote here, it's so we can reduce the number of API calls as much as possible. I would like to experiment with hitting GitHub's API directly, to see if it makes a noticeable impact on performance. (we can probably just set up a branch here on this repo at first) Perhaps the trade-off of more API calls will be worthwhile if we can make duo much faster.

feature: support username:password and/or token

was looking into duojs/duo#131 and decided we'll need to start this here.

support could be added with something as simple (but kinda ugly) as:

function resolve(slug, opts, fn){
  var token = opts.token || (
    opts.password && opts.username
      ? [opts.username, opts.password].join(':')
      : ''
  );
  var repo = slug.split('@')[0];
  var ref = slug.split('@')[1];
  var url = remote(repo, token);
  var cmd = fmt('git ls-remote --tags --heads %s', url);
  // ...
}

so we'd get:

resolve('foo/bar@baz', { token: 'mytoken' }, function () {});
// git ls-remote --tags --heads https://[email protected]/foo/bar

resolve('foo/bar@baz', { username: 'myusername', password: 'mypassword' }, function () {});
// git ls-remote --tags --heads https://mypassword:[email protected]/foo/bar

resolve('foo/bar@baz', {}, function () {})
// git ls-remote --tags --heads https://github.com/foo/bar

optimize *

twbs/bootstrap takes nearly 2 minutes.

segmentio/analytics.js@* resolves to last branch name instead of latest tag

yield resolve("segmentio/analytics.js@*", user, token)
{ ref: 'refs/heads/veroupdate',
  url: 'https://api.github.com/repos/segmentio/analytics.js/git/refs/heads/veroupdate',
  object:
   { sha: '4be91c78d1d473ea5faabba36d6e8fd8ca63bef6',
     type: 'commit',
     url: 'https://api.github.com/repos/segmentio/analytics.js/git/commits/4be91c78d1d473ea5faabba36d6e8fd8ca63bef6' }

Regression: Cannot resolve commit sha anymore

By using the GH API for resolving the tags/branch, I lost the ability to reference a raw commit SHA.

Is this a feature we still want to have in here? Seems like it is weird, but we should probably fix that for backwards-compatibility reasons.

Any thoughts @duojs/owners ?

gh-resolve freezes on git 1.7

gh-resolve uses https://<token>@github.com/ form of url to list tags on github.

$ git ls-remote --tags --heads https://<token>@github.com/component/type

This works fine on git 1.8, but git 1.7 prompts for password and freezes. This prevents me to use duojs on heroku which is still on git 1.7.

Maybe using https://<token>:@github.com/ would be a solution.

idempotent

dependency analytics.js resolves to veroupdate branch sometimes :/
should * always resolve to master ?

cc @matthewmueller

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.