{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/pandora/pulls/comments/26988938","id":26988938,"diff_hunk":"@@ -0,0 +1,66 @@\n+package com.wikia.userpreference;\n+\n+import com.google.inject.Injector;\n+\n+import com.hubspot.dropwizard.guice.GuiceBundle;\n+\n+import com.wikia.dropwizard.consul.bundle.ConsulBundle;\n+import com.wikia.dropwizard.consul.config.ConsulVariableInterpolationBundle;\n+import com.wikia.userpreference.configuration.UserPreferenceConfiguration;\n+import com.wikia.userpreference.health.UserPreferenceHealthCheck;\n+import com.wikia.pandora.core.dropwizard.GovernatorInjectorFactory;\n+import static com.wikia.pandora.http.Util.*;\n+import com.wikia.userpreference.health.WikiCitiesHealthCheck;\n+\n+import io.dropwizard.Application;\n+import io.dropwizard.setup.Bootstrap;\n+import io.dropwizard.setup.Environment;\n+import io.federecio.dropwizard.swagger.SwaggerBundle;\n+\n+public class UserPreferenceApplication extends Application<UserPreferenceConfiguration> {\n+\n+  private GuiceBundle<UserPreferenceConfiguration> guiceBundle;\n+\n+\n+  public static void main(String[] args) throws Exception {\n+    new UserPreferenceApplication().run(args);\n+  }\n+\n+  @Override\n+  public String getName() {\n+    return \"user-preference\";\n+  }\n+\n+\n+  @Override\n+  public void initialize(Bootstrap<UserPreferenceConfiguration> bootstrap) {\n+    guiceBundle =\n+        GuiceBundle.<UserPreferenceConfiguration>newBuilder()\n+            .addModule(new UserPreferenceModule())\n+            .setInjectorFactory(new GovernatorInjectorFactory())\n+            .setConfigClass(UserPreferenceConfiguration.class)\n+            .enableAutoConfig(getClass().getPackage().getName())\n+            .build();\n+\n+    bootstrap.addBundle(guiceBundle);\n+\n+    Injector injector = guiceBundle.getInjector();\n+    bootstrap.addBundle(injector.getInstance(ConsulVariableInterpolationBundle.class));\n+    bootstrap.addBundle(injector.getInstance(ConsulBundle.class));\n+    bootstrap.addBundle(new SwaggerBundle<>());\n+  }\n+\n+  @Override\n+  public void run(UserPreferenceConfiguration configuration, Environment environment)\n+      throws Exception {\n+    final Injector injector = guiceBundle.getInjector();\n+\n+    final UserPreferenceHealthCheck healthCheck = new UserPreferenceHealthCheck();\n+    environment.healthChecks().register(\"AmIUpHealthCheck\", healthCheck);","path":"service/user-preference/src/main/java/com/wikia/userpreference/UserPreferenceApplication.java","position":59,"original_position":59,"commit_id":"86bcc78ef3958f9355346be89d975dec9ca89bf5","original_commit_id":"86bcc78ef3958f9355346be89d975dec9ca89bf5","user":{"login":"nmonterroso","id":325800,"avatar_url":"https://avatars.githubusercontent.com/u/325800?v=3","gravatar_id":"","url":"https://api.github.com/users/nmonterroso","html_url":"https://github.com/nmonterroso","followers_url":"https://api.github.com/users/nmonterroso/followers","following_url":"https://api.github.com/users/nmonterroso/following{/other_user}","gists_url":"https://api.github.com/users/nmonterroso/gists{/gist_id}","starred_url":"https://api.github.com/users/nmonterroso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmonterroso/subscriptions","organizations_url":"https://api.github.com/users/nmonterroso/orgs","repos_url":"https://api.github.com/users/nmonterroso/repos","events_url":"https://api.github.com/users/nmonterroso/events{/privacy}","received_events_url":"https://api.github.com/users/nmonterroso/received_events","type":"User","site_admin":false},"body":"`enableAutoConfig` on the `guiceBundle` covers health checks as well (provided the health checks extend `InjectableHealthCheck`). Not a big deal, but I think it's nice to let magic handle this sort of boiler plaet","created_at":"2015-03-23T22:51:15Z","updated_at":"2015-03-23T22:51:15Z","html_url":"https://github.com/Wikia/pandora/pull/117#discussion_r26988938","pull_request_url":"https://api.github.com/repos/Wikia/pandora/pulls/117","_links":{"self":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/comments/26988938"},"html":{"href":"https://github.com/Wikia/pandora/pull/117#discussion_r26988938"},"pull_request":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/117"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/pandora/pulls/117","id":31779795,"html_url":"https://github.com/Wikia/pandora/pull/117","diff_url":"https://github.com/Wikia/pandora/pull/117.diff","patch_url":"https://github.com/Wikia/pandora/pull/117.patch","issue_url":"https://api.github.com/repos/Wikia/pandora/issues/117","number":117,"state":"open","locked":false,"title":"User preferences service","user":{"login":"drsnyder","id":21621,"avatar_url":"https://avatars.githubusercontent.com/u/21621?v=3","gravatar_id":"","url":"https://api.github.com/users/drsnyder","html_url":"https://github.com/drsnyder","followers_url":"https://api.github.com/users/drsnyder/followers","following_url":"https://api.github.com/users/drsnyder/following{/other_user}","gists_url":"https://api.github.com/users/drsnyder/gists{/gist_id}","starred_url":"https://api.github.com/users/drsnyder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drsnyder/subscriptions","organizations_url":"https://api.github.com/users/drsnyder/orgs","repos_url":"https://api.github.com/users/drsnyder/repos","events_url":"https://api.github.com/users/drsnyder/events{/privacy}","received_events_url":"https://api.github.com/users/drsnyder/received_events","type":"User","site_admin":false},"body":"This service provides limited access to global user preferences via `/preferences/{userid}/global`. The set of preferences supported is white listed via the service configuration file.\r\n\r\nThe service accesses the wikicities database through the handy jooq module provided by @nmonterroso. \r\n\r\nApologies in advance for the additional service related additions. This PR also includes:\r\n * Support for a standard problem response class to help aid compliance with the [guidelines](https://github.com/Wikia/guidelines/tree/master/APIDesign#error-handling).\r\n * A `StandardResponses` helper class for generating common responses (e.g. 404s)\r\n * A helper for enabling CORS (thanks @jogura)\r\n\r\nhttps://wikia-inc.atlassian.net/browse/SERVICES-136\r\n\r\n/cc @pchojnacki @sqreek @nmonterroso ","created_at":"2015-03-23T22:16:39Z","updated_at":"2015-03-23T22:51:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2eaf5ed5bc5b8628392e4f8d0d3b42c5387cec07","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/pandora/pulls/117/commits","review_comments_url":"https://api.github.com/repos/Wikia/pandora/pulls/117/comments","review_comment_url":"https://api.github.com/repos/Wikia/pandora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/pandora/issues/117/comments","statuses_url":"https://api.github.com/repos/Wikia/pandora/statuses/86bcc78ef3958f9355346be89d975dec9ca89bf5","head":{"label":"Wikia:user-preferences","ref":"user-preferences","sha":"86bcc78ef3958f9355346be89d975dec9ca89bf5","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26663749,"name":"pandora","full_name":"Wikia/pandora","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/pandora","description":"API Service","fork":false,"url":"https://api.github.com/repos/Wikia/pandora","forks_url":"https://api.github.com/repos/Wikia/pandora/forks","keys_url":"https://api.github.com/repos/Wikia/pandora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/pandora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/pandora/teams","hooks_url":"https://api.github.com/repos/Wikia/pandora/hooks","issue_events_url":"https://api.github.com/repos/Wikia/pandora/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/pandora/events","assignees_url":"https://api.github.com/repos/Wikia/pandora/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/pandora/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/pandora/tags","blobs_url":"https://api.github.com/repos/Wikia/pandora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/pandora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/pandora/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/pandora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/pandora/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/pandora/languages","stargazers_url":"https://api.github.com/repos/Wikia/pandora/stargazers","contributors_url":"https://api.github.com/repos/Wikia/pandora/contributors","subscribers_url":"https://api.github.com/repos/Wikia/pandora/subscribers","subscription_url":"https://api.github.com/repos/Wikia/pandora/subscription","commits_url":"https://api.github.com/repos/Wikia/pandora/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/pandora/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/pandora/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/pandora/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/pandora/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/pandora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/pandora/merges","archive_url":"https://api.github.com/repos/Wikia/pandora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/pandora/downloads","issues_url":"https://api.github.com/repos/Wikia/pandora/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/pandora/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/pandora/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/pandora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/pandora/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/pandora/releases{/id}","created_at":"2014-11-15T00:29:06Z","updated_at":"2015-03-23T22:33:06Z","pushed_at":"2015-03-23T22:33:07Z","git_url":"git://github.com/Wikia/pandora.git","ssh_url":"git@github.com:Wikia/pandora.git","clone_url":"https://github.com/Wikia/pandora.git","svn_url":"https://github.com/Wikia/pandora","homepage":null,"size":6108,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":3,"default_branch":"master"}},"base":{"label":"Wikia:master","ref":"master","sha":"28ce5d8cffbcee3d24ad69df5a4856fda980f6e8","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26663749,"name":"pandora","full_name":"Wikia/pandora","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/pandora","description":"API Service","fork":false,"url":"https://api.github.com/repos/Wikia/pandora","forks_url":"https://api.github.com/repos/Wikia/pandora/forks","keys_url":"https://api.github.com/repos/Wikia/pandora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/pandora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/pandora/teams","hooks_url":"https://api.github.com/repos/Wikia/pandora/hooks","issue_events_url":"https://api.github.com/repos/Wikia/pandora/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/pandora/events","assignees_url":"https://api.github.com/repos/Wikia/pandora/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/pandora/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/pandora/tags","blobs_url":"https://api.github.com/repos/Wikia/pandora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/pandora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/pandora/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/pandora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/pandora/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/pandora/languages","stargazers_url":"https://api.github.com/repos/Wikia/pandora/stargazers","contributors_url":"https://api.github.com/repos/Wikia/pandora/contributors","subscribers_url":"https://api.github.com/repos/Wikia/pandora/subscribers","subscription_url":"https://api.github.com/repos/Wikia/pandora/subscription","commits_url":"https://api.github.com/repos/Wikia/pandora/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/pandora/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/pandora/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/pandora/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/pandora/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/pandora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/pandora/merges","archive_url":"https://api.github.com/repos/Wikia/pandora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/pandora/downloads","issues_url":"https://api.github.com/repos/Wikia/pandora/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/pandora/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/pandora/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/pandora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/pandora/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/pandora/releases{/id}","created_at":"2014-11-15T00:29:06Z","updated_at":"2015-03-23T22:33:06Z","pushed_at":"2015-03-23T22:33:07Z","git_url":"git://github.com/Wikia/pandora.git","ssh_url":"git@github.com:Wikia/pandora.git","clone_url":"https://github.com/Wikia/pandora.git","svn_url":"https://github.com/Wikia/pandora","homepage":null,"size":6108,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/117"},"html":{"href":"https://github.com/Wikia/pandora/pull/117"},"issue":{"href":"https://api.github.com/repos/Wikia/pandora/issues/117"},"comments":{"href":"https://api.github.com/repos/Wikia/pandora/issues/117/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/117/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/117/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/pandora/statuses/86bcc78ef3958f9355346be89d975dec9ca89bf5"}}}}