{"action":"created","issue":{"url":"https://api.github.com/repos/duckduckgo/community-platform/issues/801","labels_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/801/labels{/name}","comments_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/801/comments","events_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/801/events","html_url":"https://github.com/duckduckgo/community-platform/pull/801","id":92120149,"number":801,"title":"Eric/community stats","user":{"login":"kablamo","id":104742,"avatar_url":"https://avatars.githubusercontent.com/u/104742?v=3","gravatar_id":"","url":"https://api.github.com/users/kablamo","html_url":"https://github.com/kablamo","followers_url":"https://api.github.com/users/kablamo/followers","following_url":"https://api.github.com/users/kablamo/following{/other_user}","gists_url":"https://api.github.com/users/kablamo/gists{/gist_id}","starred_url":"https://api.github.com/users/kablamo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kablamo/subscriptions","organizations_url":"https://api.github.com/users/kablamo/orgs","repos_url":"https://api.github.com/users/kablamo/repos","events_url":"https://api.github.com/users/kablamo/events{/privacy}","received_events_url":"https://api.github.com/users/kablamo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/duckduckgo/community-platform/labels/WIP","name":"WIP","color":"fef2c0"}],"state":"open","locked":false,"assignee":{"login":"MariagraziaAlastra","id":3652195,"avatar_url":"https://avatars.githubusercontent.com/u/3652195?v=3","gravatar_id":"","url":"https://api.github.com/users/MariagraziaAlastra","html_url":"https://github.com/MariagraziaAlastra","followers_url":"https://api.github.com/users/MariagraziaAlastra/followers","following_url":"https://api.github.com/users/MariagraziaAlastra/following{/other_user}","gists_url":"https://api.github.com/users/MariagraziaAlastra/gists{/gist_id}","starred_url":"https://api.github.com/users/MariagraziaAlastra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MariagraziaAlastra/subscriptions","organizations_url":"https://api.github.com/users/MariagraziaAlastra/orgs","repos_url":"https://api.github.com/users/MariagraziaAlastra/repos","events_url":"https://api.github.com/users/MariagraziaAlastra/events{/privacy}","received_events_url":"https://api.github.com/users/MariagraziaAlastra/received_events","type":"User","site_admin":false},"milestone":null,"comments":13,"created_at":"2015-06-30T15:12:02Z","updated_at":"2015-07-03T15:16:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/duckduckgo/community-platform/pulls/801","html_url":"https://github.com/duckduckgo/community-platform/pull/801","diff_url":"https://github.com/duckduckgo/community-platform/pull/801.diff","patch_url":"https://github.com/duckduckgo/community-platform/pull/801.patch"},"body":"This pr is for the Github community stats dashboard.  \r\n\r\n# Back end\r\n\r\nThe existing code was written to populate the `github_*` tables, but that work wasn't completed.  This pr finishes some of that work and refactors some of the code.  I've also added a few tables and columns.\r\n\r\n`github_*` tables are separate from the `instant_answer_*` tables.  The github tables represent the data from github while the instant_answer tables represent an instant answer.  \r\n\r\nThe github tables will be a convenient source of data for multiple projects including eventually the instant_answer tables.  For now its the data source for the github stats dashboard. In the future it will either be a data source for the instant_answer tables or the instant_answer table could link to the github tables directly via an id.\r\n\r\n**Code**\r\n - `DDG::GitHub`\r\n - `DDGC::DB::Result::GitHub::*`\r\n - `DDGC::DB::ResultSet::GitHub::*`\r\n - `script/ddgc_import_github.pl`  <-- cron job to import db data\r\n\r\n**How to setup the db**\r\n 1. Update your db schema: 'sql/1.044/github_tables.sql`\r\n 2. To import data from the github api create a token [here] (https://github.com/settings/tokens)\r\n 3. Add the token to your environment: `export DDGC_GITHUB_TOKEN=_your_token_here_`\r\n 4. Load data into tables from the github api: `script/ddgc_import_github.pl`\r\n\r\n# Business logic\r\n\r\nThe logic which calculates the stats. \r\n\r\n**Code**\r\n - `DDGC::Stats::GitHub::*`\r\n\r\n# Front end\r\n\r\n**controller:** `lib/DDGC/Web/Controller/InstantAnswer.pm`\r\n**template:** `/templates/instantanswer/dashboard.tx`\r\n**path:*** `/ia/dashboard`\r\n\r\nThis page is intended to be used internally and requires an admin account to access.  Later on these kinds of stats will be exposed on the ia pages.  But exactly how that will work is undecided.\r\n\r\nTODO - screenshot.\r\nLayout inspired by https://status.github.com/\r\n"},"comment":{"url":"https://api.github.com/repos/duckduckgo/community-platform/issues/comments/118371808","html_url":"https://github.com/duckduckgo/community-platform/pull/801#issuecomment-118371808","issue_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/801","id":118371808,"user":{"login":"MariagraziaAlastra","id":3652195,"avatar_url":"https://avatars.githubusercontent.com/u/3652195?v=3","gravatar_id":"","url":"https://api.github.com/users/MariagraziaAlastra","html_url":"https://github.com/MariagraziaAlastra","followers_url":"https://api.github.com/users/MariagraziaAlastra/followers","following_url":"https://api.github.com/users/MariagraziaAlastra/following{/other_user}","gists_url":"https://api.github.com/users/MariagraziaAlastra/gists{/gist_id}","starred_url":"https://api.github.com/users/MariagraziaAlastra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MariagraziaAlastra/subscriptions","organizations_url":"https://api.github.com/users/MariagraziaAlastra/orgs","repos_url":"https://api.github.com/users/MariagraziaAlastra/repos","events_url":"https://api.github.com/users/MariagraziaAlastra/events{/privacy}","received_events_url":"https://api.github.com/users/MariagraziaAlastra/received_events","type":"User","site_admin":false},"created_at":"2015-07-03T15:16:12Z","updated_at":"2015-07-03T15:16:12Z","body":"@kablamo Did all that and when I run the script now I get:\r\n<pre>encountered object '0', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /opt/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/JSON.pm line 154.\r\nDBIx::Class::Storage::TxnScopeGuard::DESTROY(): A DBIx::Class::Storage::TxnScopeGuard went out of scope without explicit commit or error. Rolling back. at /opt/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/JSON.pm line 154\r\n</pre>"}}