Creating versioneyes from GitHub from the API returns 500s

Issue #118 resolved
Matthew Andrews created an issue
curl -I -XPOST https://www.versioneye.com/api/v2/github/Financial-Times%3Adam-api-client?api_key=xxxx
HTTP/1.1 500 Internal Server Error
Server: nginx/1.4.6 (Ubuntu)
Date: Thu, 17 Sep 2015 12:28:27 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 2517
Connection: keep-alive
X-Request-Id: e77ad69a-c5c2-439f-9f4c-f177c0d97785
X-Runtime: 0.650784
Strict-Transport-Security: max-age=31536000

Comments (9)

  1. Robert Reiz

    @matthewandrews Did you call first this here?

    GET /v2/github/sync
    

    That is fetching meta information about your GitHub repositories. All other Endpoints related to GitHub are based on the meta information VersionEye has in his database.

  2. Robert Reiz

    @matthewandrews I just found it in the logs:

    Going to import Financial-Times/ask-next-ft:master:Gemfile for matthewandrews
    
    RuntimeError ( Didn't find any project file of a supported package manager.):
      app/api/v2/github_api_v2.rb:190:in `block (2 levels) in <class:GithubApiV2>'
    

    It seems that your Gemfile is empty. Or VersionEye didn't recognise any dependencies in it. In that case the parser is throwing an Exception. That is handled in the web interface and you get a nice error message. But it seems that this Exception is not handled in the API. I will fix it today and deploy a bug fix.

  3. Robert Reiz

    @matthewandrews I improved the API error messages and added more tests. Currently at 91% test coverage. The API key works for all supported project files. I will check your package.json right now.

  4. Robert Reiz

    @matthewandrews The API works, just SwaggerUI is a little bit buggy.

    I forked the repository and tried it via SwaggerUI and got the same error message as you. Somehow SwaggerUI doesn't send the file parameter to the Server. And the default & fallback value for the filename is "Gemfile". But then I tried it with the CocoaRestClient and it worked immediately.

    VersionEye-API-GitHub-Import.png

  5. Robert Reiz

    @matthewandrews Let me know if you have further questions or you need more help. There are a couple command line tools for the VersionEye API. For example veye from @timgluz, written in Ruby. But I'm not sure if it supports already the file parameter for GitHub imports. Otherwise there is versioneye-php and versioneye-update written in Node.JS.

  6. Matthew Andrews reporter

    You're right, it is a bug in Swagger not the API. Working beautifully now for me! Thankyou :)

  7. Log in to comment