{"action":"created","comment":{"url":"https://api.github.com/repos/hellofresh/janus/pulls/comments/124383344","pull_request_review_id":46666744,"id":124383344,"diff_hunk":"@@ -0,0 +1,60 @@\n+package checker\n+\n+import (\n+\t\"fmt\"\n+\t\"net/http\"\n+\t\"time\"\n+\n+\thealth \"github.com/hellofresh/health-go\"\n+\t\"github.com/hellofresh/janus/pkg/api\"\n+\t\"github.com/hellofresh/janus/pkg/router\"\n+\tlog \"github.com/sirupsen/logrus\"\n+)\n+\n+// Register registers the health checks for valid API definitions\n+func Register(r router.Router, repo api.Repository) error {\n+\tdefinitions, err := repo.FindValidAPIHealthChecks()\n+\tif err != nil {\n+\t\tlog.WithError(err).Error(\"Error fetching API definitions for health check registering\")\n+\t\treturn err\n+\t}\n+\n+\tfor _, definition := range definitions {\n+\t\tlog.Debugf(\"%s health check registered\", definition.Name)\n+\t\thealth.Register(health.Config{\n+\t\t\tName:      definition.Name,\n+\t\t\tTimeout:   time.Second * time.Duration(definition.HealthCheck.Timeout),\n+\t\t\tSkipOnErr: true,\n+\t\t\tCheck:     check(definition),\n+\t\t})\n+\t}\n+\n+\tr.GET(\"/status\", health.HandlerFunc)\n+\treturn nil\n+}\n+\n+func check(definition *api.Definition) func() error {\n+\treturn func() error {\n+\t\treq, err := http.NewRequest(http.MethodGet, definition.HealthCheck.URL, nil)\n+\t\tif err != nil {\n+\t\t\tlog.WithError(err).Error(\"Creating the request for the health check failed\")\n+\t\t\treturn err\n+\t\t}\n+\n+\t\t// Inform auth-service to close the connection after the transaction is complete","path":"pkg/checker/checker.go","position":44,"original_position":44,"commit_id":"b6534460cba56bf2a88f1e551d734782ac4898bc","original_commit_id":"b6534460cba56bf2a88f1e551d734782ac4898bc","user":{"login":"rafaeljesus","id":1216425,"avatar_url":"https://avatars1.githubusercontent.com/u/1216425?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaeljesus","html_url":"https://github.com/rafaeljesus","followers_url":"https://api.github.com/users/rafaeljesus/followers","following_url":"https://api.github.com/users/rafaeljesus/following{/other_user}","gists_url":"https://api.github.com/users/rafaeljesus/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaeljesus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaeljesus/subscriptions","organizations_url":"https://api.github.com/users/rafaeljesus/orgs","repos_url":"https://api.github.com/users/rafaeljesus/repos","events_url":"https://api.github.com/users/rafaeljesus/events{/privacy}","received_events_url":"https://api.github.com/users/rafaeljesus/received_events","type":"User","site_admin":false},"body":"`auth-service`","created_at":"2017-06-27T20:15:27Z","updated_at":"2017-06-27T20:15:27Z","html_url":"https://github.com/hellofresh/janus/pull/153#discussion_r124383344","pull_request_url":"https://api.github.com/repos/hellofresh/janus/pulls/153","_links":{"self":{"href":"https://api.github.com/repos/hellofresh/janus/pulls/comments/124383344"},"html":{"href":"https://github.com/hellofresh/janus/pull/153#discussion_r124383344"},"pull_request":{"href":"https://api.github.com/repos/hellofresh/janus/pulls/153"}}},"pull_request":{"url":"https://api.github.com/repos/hellofresh/janus/pulls/153","id":126820669,"html_url":"https://github.com/hellofresh/janus/pull/153","diff_url":"https://github.com/hellofresh/janus/pull/153.diff","patch_url":"https://github.com/hellofresh/janus/pull/153.patch","issue_url":"https://api.github.com/repos/hellofresh/janus/issues/153","number":153,"state":"open","locked":false,"title":"Feature/checker","user":{"login":"italolelis","id":1108049,"avatar_url":"https://avatars0.githubusercontent.com/u/1108049?v=3","gravatar_id":"","url":"https://api.github.com/users/italolelis","html_url":"https://github.com/italolelis","followers_url":"https://api.github.com/users/italolelis/followers","following_url":"https://api.github.com/users/italolelis/following{/other_user}","gists_url":"https://api.github.com/users/italolelis/gists{/gist_id}","starred_url":"https://api.github.com/users/italolelis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/italolelis/subscriptions","organizations_url":"https://api.github.com/users/italolelis/orgs","repos_url":"https://api.github.com/users/italolelis/repos","events_url":"https://api.github.com/users/italolelis/events{/privacy}","received_events_url":"https://api.github.com/users/italolelis/received_events","type":"User","site_admin":false},"body":"## What does this PR do?\r\n\r\n- Updated logrus version\r\n- Added health-go to be used as our health check package\r\n- Added Healthcheck to dockerfile\r\n- Removed logstash formatter\r\n- Added wiremock instead of actual hosts\r\n- Added more tests\r\n","created_at":"2017-06-21T17:38:31Z","updated_at":"2017-06-27T20:15:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60795bf094e59ff862241df80aeccf28197e0885","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/hellofresh/janus/pulls/153/commits","review_comments_url":"https://api.github.com/repos/hellofresh/janus/pulls/153/comments","review_comment_url":"https://api.github.com/repos/hellofresh/janus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hellofresh/janus/issues/153/comments","statuses_url":"https://api.github.com/repos/hellofresh/janus/statuses/b6534460cba56bf2a88f1e551d734782ac4898bc","head":{"label":"hellofresh:feature/checker","ref":"feature/checker","sha":"b6534460cba56bf2a88f1e551d734782ac4898bc","user":{"login":"hellofresh","id":4430027,"avatar_url":"https://avatars2.githubusercontent.com/u/4430027?v=3","gravatar_id":"","url":"https://api.github.com/users/hellofresh","html_url":"https://github.com/hellofresh","followers_url":"https://api.github.com/users/hellofresh/followers","following_url":"https://api.github.com/users/hellofresh/following{/other_user}","gists_url":"https://api.github.com/users/hellofresh/gists{/gist_id}","starred_url":"https://api.github.com/users/hellofresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellofresh/subscriptions","organizations_url":"https://api.github.com/users/hellofresh/orgs","repos_url":"https://api.github.com/users/hellofresh/repos","events_url":"https://api.github.com/users/hellofresh/events{/privacy}","received_events_url":"https://api.github.com/users/hellofresh/received_events","type":"Organization","site_admin":false},"repo":{"id":63067788,"name":"janus","full_name":"hellofresh/janus","owner":{"login":"hellofresh","id":4430027,"avatar_url":"https://avatars2.githubusercontent.com/u/4430027?v=3","gravatar_id":"","url":"https://api.github.com/users/hellofresh","html_url":"https://github.com/hellofresh","followers_url":"https://api.github.com/users/hellofresh/followers","following_url":"https://api.github.com/users/hellofresh/following{/other_user}","gists_url":"https://api.github.com/users/hellofresh/gists{/gist_id}","starred_url":"https://api.github.com/users/hellofresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellofresh/subscriptions","organizations_url":"https://api.github.com/users/hellofresh/orgs","repos_url":"https://api.github.com/users/hellofresh/repos","events_url":"https://api.github.com/users/hellofresh/events{/privacy}","received_events_url":"https://api.github.com/users/hellofresh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hellofresh/janus","description":"An API Gateway written in Go","fork":false,"url":"https://api.github.com/repos/hellofresh/janus","forks_url":"https://api.github.com/repos/hellofresh/janus/forks","keys_url":"https://api.github.com/repos/hellofresh/janus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hellofresh/janus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hellofresh/janus/teams","hooks_url":"https://api.github.com/repos/hellofresh/janus/hooks","issue_events_url":"https://api.github.com/repos/hellofresh/janus/issues/events{/number}","events_url":"https://api.github.com/repos/hellofresh/janus/events","assignees_url":"https://api.github.com/repos/hellofresh/janus/assignees{/user}","branches_url":"https://api.github.com/repos/hellofresh/janus/branches{/branch}","tags_url":"https://api.github.com/repos/hellofresh/janus/tags","blobs_url":"https://api.github.com/repos/hellofresh/janus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hellofresh/janus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hellofresh/janus/git/refs{/sha}","trees_url":"https://api.github.com/repos/hellofresh/janus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hellofresh/janus/statuses/{sha}","languages_url":"https://api.github.com/repos/hellofresh/janus/languages","stargazers_url":"https://api.github.com/repos/hellofresh/janus/stargazers","contributors_url":"https://api.github.com/repos/hellofresh/janus/contributors","subscribers_url":"https://api.github.com/repos/hellofresh/janus/subscribers","subscription_url":"https://api.github.com/repos/hellofresh/janus/subscription","commits_url":"https://api.github.com/repos/hellofresh/janus/commits{/sha}","git_commits_url":"https://api.github.com/repos/hellofresh/janus/git/commits{/sha}","comments_url":"https://api.github.com/repos/hellofresh/janus/comments{/number}","issue_comment_url":"https://api.github.com/repos/hellofresh/janus/issues/comments{/number}","contents_url":"https://api.github.com/repos/hellofresh/janus/contents/{+path}","compare_url":"https://api.github.com/repos/hellofresh/janus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hellofresh/janus/merges","archive_url":"https://api.github.com/repos/hellofresh/janus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hellofresh/janus/downloads","issues_url":"https://api.github.com/repos/hellofresh/janus/issues{/number}","pulls_url":"https://api.github.com/repos/hellofresh/janus/pulls{/number}","milestones_url":"https://api.github.com/repos/hellofresh/janus/milestones{/number}","notifications_url":"https://api.github.com/repos/hellofresh/janus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hellofresh/janus/labels{/name}","releases_url":"https://api.github.com/repos/hellofresh/janus/releases{/id}","deployments_url":"https://api.github.com/repos/hellofresh/janus/deployments","created_at":"2016-07-11T12:54:21Z","updated_at":"2017-06-27T09:41:32Z","pushed_at":"2017-06-27T20:09:39Z","git_url":"git://github.com/hellofresh/janus.git","ssh_url":"git@github.com:hellofresh/janus.git","clone_url":"https://github.com/hellofresh/janus.git","svn_url":"https://github.com/hellofresh/janus","homepage":"","size":1233,"stargazers_count":583,"watchers_count":583,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":10,"forks":77,"open_issues":10,"watchers":583,"default_branch":"master"}},"base":{"label":"hellofresh:master","ref":"master","sha":"6b6dc900e92d365ae4622985edce3a769a1d0044","user":{"login":"hellofresh","id":4430027,"avatar_url":"https://avatars2.githubusercontent.com/u/4430027?v=3","gravatar_id":"","url":"https://api.github.com/users/hellofresh","html_url":"https://github.com/hellofresh","followers_url":"https://api.github.com/users/hellofresh/followers","following_url":"https://api.github.com/users/hellofresh/following{/other_user}","gists_url":"https://api.github.com/users/hellofresh/gists{/gist_id}","starred_url":"https://api.github.com/users/hellofresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellofresh/subscriptions","organizations_url":"https://api.github.com/users/hellofresh/orgs","repos_url":"https://api.github.com/users/hellofresh/repos","events_url":"https://api.github.com/users/hellofresh/events{/privacy}","received_events_url":"https://api.github.com/users/hellofresh/received_events","type":"Organization","site_admin":false},"repo":{"id":63067788,"name":"janus","full_name":"hellofresh/janus","owner":{"login":"hellofresh","id":4430027,"avatar_url":"https://avatars2.githubusercontent.com/u/4430027?v=3","gravatar_id":"","url":"https://api.github.com/users/hellofresh","html_url":"https://github.com/hellofresh","followers_url":"https://api.github.com/users/hellofresh/followers","following_url":"https://api.github.com/users/hellofresh/following{/other_user}","gists_url":"https://api.github.com/users/hellofresh/gists{/gist_id}","starred_url":"https://api.github.com/users/hellofresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellofresh/subscriptions","organizations_url":"https://api.github.com/users/hellofresh/orgs","repos_url":"https://api.github.com/users/hellofresh/repos","events_url":"https://api.github.com/users/hellofresh/events{/privacy}","received_events_url":"https://api.github.com/users/hellofresh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hellofresh/janus","description":"An API Gateway written in Go","fork":false,"url":"https://api.github.com/repos/hellofresh/janus","forks_url":"https://api.github.com/repos/hellofresh/janus/forks","keys_url":"https://api.github.com/repos/hellofresh/janus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hellofresh/janus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hellofresh/janus/teams","hooks_url":"https://api.github.com/repos/hellofresh/janus/hooks","issue_events_url":"https://api.github.com/repos/hellofresh/janus/issues/events{/number}","events_url":"https://api.github.com/repos/hellofresh/janus/events","assignees_url":"https://api.github.com/repos/hellofresh/janus/assignees{/user}","branches_url":"https://api.github.com/repos/hellofresh/janus/branches{/branch}","tags_url":"https://api.github.com/repos/hellofresh/janus/tags","blobs_url":"https://api.github.com/repos/hellofresh/janus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hellofresh/janus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hellofresh/janus/git/refs{/sha}","trees_url":"https://api.github.com/repos/hellofresh/janus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hellofresh/janus/statuses/{sha}","languages_url":"https://api.github.com/repos/hellofresh/janus/languages","stargazers_url":"https://api.github.com/repos/hellofresh/janus/stargazers","contributors_url":"https://api.github.com/repos/hellofresh/janus/contributors","subscribers_url":"https://api.github.com/repos/hellofresh/janus/subscribers","subscription_url":"https://api.github.com/repos/hellofresh/janus/subscription","commits_url":"https://api.github.com/repos/hellofresh/janus/commits{/sha}","git_commits_url":"https://api.github.com/repos/hellofresh/janus/git/commits{/sha}","comments_url":"https://api.github.com/repos/hellofresh/janus/comments{/number}","issue_comment_url":"https://api.github.com/repos/hellofresh/janus/issues/comments{/number}","contents_url":"https://api.github.com/repos/hellofresh/janus/contents/{+path}","compare_url":"https://api.github.com/repos/hellofresh/janus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hellofresh/janus/merges","archive_url":"https://api.github.com/repos/hellofresh/janus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hellofresh/janus/downloads","issues_url":"https://api.github.com/repos/hellofresh/janus/issues{/number}","pulls_url":"https://api.github.com/repos/hellofresh/janus/pulls{/number}","milestones_url":"https://api.github.com/repos/hellofresh/janus/milestones{/number}","notifications_url":"https://api.github.com/repos/hellofresh/janus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hellofresh/janus/labels{/name}","releases_url":"https://api.github.com/repos/hellofresh/janus/releases{/id}","deployments_url":"https://api.github.com/repos/hellofresh/janus/deployments","created_at":"2016-07-11T12:54:21Z","updated_at":"2017-06-27T09:41:32Z","pushed_at":"2017-06-27T20:09:39Z","git_url":"git://github.com/hellofresh/janus.git","ssh_url":"git@github.com:hellofresh/janus.git","clone_url":"https://github.com/hellofresh/janus.git","svn_url":"https://github.com/hellofresh/janus","homepage":"","size":1233,"stargazers_count":583,"watchers_count":583,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":10,"forks":77,"open_issues":10,"watchers":583,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hellofresh/janus/pulls/153"},"html":{"href":"https://github.com/hellofresh/janus/pull/153"},"issue":{"href":"https://api.github.com/repos/hellofresh/janus/issues/153"},"comments":{"href":"https://api.github.com/repos/hellofresh/janus/issues/153/comments"},"review_comments":{"href":"https://api.github.com/repos/hellofresh/janus/pulls/153/comments"},"review_comment":{"href":"https://api.github.com/repos/hellofresh/janus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hellofresh/janus/pulls/153/commits"},"statuses":{"href":"https://api.github.com/repos/hellofresh/janus/statuses/b6534460cba56bf2a88f1e551d734782ac4898bc"}}}}
{"actor":{"display_login":"rafaeljesus"}}