CocoaPods/metrics.cocoapods.org

No method subscribers_count

orta opened this issue · 2 comments

orta commented

Perhaps GitHub's API changed
From the logs:

2015-08-23T14:14:41.615071+00:00 app[web.1]: I, [2015-08-23T14:14:41.614953 #6]  INFO -- : (0.051455s) SELECT "pods"."id", "pods"."name", "github_pod_metrics"."id" AS "github_pod_id", "github_pod_metrics"."pod_id" AS "github_pod_pod_id", "github_pod_metrics"."subscribers" AS "github_pod_subscribers", "github_pod_metrics"."stargazers" AS "github_pod_stargazers", "github_pod_metrics"."forks" AS "github_pod_forks", "github_pod_metrics"."contributors" AS "github_pod_contributors", "github_pod_metrics"."open_issues" AS "github_pod_open_issues", "github_pod_metrics"."open_pull_requests" AS "github_pod_open_pull_requests", "github_pod_metrics"."not_found" AS "github_pod_not_found", "github_pod_metrics"."created_at" AS "github_pod_created_at", "github_pod_metrics"."updated_at" AS "github_pod_updated_at", "github_pod_metrics"."language" AS "github_pod_language", "github_pod_metrics"."closed_issues" AS "github_pod_closed_issues", "github_pod_metrics"."closed_pull_requests" AS "github_pod_closed_pull_requests" FROM "pods" LEFT JOIN "github_pod_metrics" ON ("github_pod_metrics"."pod_id" = "pods"."id") WHERE ((github_pod_metrics.updated_at <= '2015-08-22' OR github_pod_metrics.updated_at IS NULL) AND (github_pod_metrics.not_found < 3)) ORDER BY RANDOM() LIMIT 99
2015-08-23T14:14:41.881213+00:00 app[web.1]: E, [2015-08-23T14:14:41.880933 #6] ERROR -- : undefined method `subscribers_count' for #<Github::ResponseWrapper:0x007f62c230b9f8> (NoMethodError)
2015-08-23T14:14:41.881218+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/github_api-0.12.3/lib/github_api/response_wrapper.rb:127:in `method_missing'
2015-08-23T14:14:41.881220+00:00 app[web.1]: /app/lib/metrics/github.rb:61:in `update_hash'
2015-08-23T14:14:41.881222+00:00 app[web.1]: /app/lib/metrics/github.rb:42:in `update'
2015-08-23T14:14:41.881223+00:00 app[web.1]: /app/lib/metrics/updater.rb:39:in `block in update'

orta commented

Looks like we're not handling repo redirections:

 metrics.cocoapods.org   master ✘ ✹ ✭  RACK_ENV=development bundle exec rake update[phoneid_iOS]                                                                                                                                                                                                             10:47:11
Looking at phoneid_iOS
OK
Repo = #<Hashie::Mash documentation_url="https://developer.github.com/v3/#http-redirects" message="Moved Permanently" url="https://api.github.com/repositories/38322723">
orta commented

Fixed by #36