{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/autoheal/pulls/comments/186345355","pull_request_review_id":117902942,"id":186345355,"diff_hunk":"@@ -0,0 +1,74 @@\n+/*\n+Copyright (c) 2018 Red Hat, Ine.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+  http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+// Package config contains types and functions used to load the service configuration.\n+//\n+package config\n+\n+import (\n+\t\"github.com/golang/glog\"\n+\t\"github.com/yaacov/observer/observer\"\n+)\n+\n+// ChangeEvent contains config change event info\n+//\n+type ChangeEvent struct {\n+\t// Empty\n+}\n+\n+// ChangeListener a listener function that can be called when config event change is triggered.\n+//\n+type ChangeListener func(*ChangeEvent)\n+\n+// EventListener is an event listener for autoheal configuration object\n+//\n+type EventListener struct {","path":"pkg/config/event_listener.go","position":38,"original_position":38,"commit_id":"d2cef68b3c4d9b889d58c9b143d67c14d2307932","original_commit_id":"d2cef68b3c4d9b889d58c9b143d67c14d2307932","user":{"login":"jhernand","id":1423971,"avatar_url":"https://avatars3.githubusercontent.com/u/1423971?v=4","gravatar_id":"","url":"https://api.github.com/users/jhernand","html_url":"https://github.com/jhernand","followers_url":"https://api.github.com/users/jhernand/followers","following_url":"https://api.github.com/users/jhernand/following{/other_user}","gists_url":"https://api.github.com/users/jhernand/gists{/gist_id}","starred_url":"https://api.github.com/users/jhernand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhernand/subscriptions","organizations_url":"https://api.github.com/users/jhernand/orgs","repos_url":"https://api.github.com/users/jhernand/repos","events_url":"https://api.github.com/users/jhernand/events{/privacy}","received_events_url":"https://api.github.com/users/jhernand/received_events","type":"User","site_admin":false},"body":"Can this type be private?","created_at":"2018-05-07T07:24:58Z","updated_at":"2018-05-07T07:26:34Z","html_url":"https://github.com/openshift/autoheal/pull/93#discussion_r186345355","pull_request_url":"https://api.github.com/repos/openshift/autoheal/pulls/93","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openshift/autoheal/pulls/comments/186345355"},"html":{"href":"https://github.com/openshift/autoheal/pull/93#discussion_r186345355"},"pull_request":{"href":"https://api.github.com/repos/openshift/autoheal/pulls/93"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/autoheal/pulls/93","id":185191971,"html_url":"https://github.com/openshift/autoheal/pull/93","diff_url":"https://github.com/openshift/autoheal/pull/93.diff","patch_url":"https://github.com/openshift/autoheal/pull/93.patch","issue_url":"https://api.github.com/repos/openshift/autoheal/issues/93","number":93,"state":"open","locked":false,"title":"Add watch for config files loaded","user":{"login":"yaacov","id":2181522,"avatar_url":"https://avatars2.githubusercontent.com/u/2181522?v=4","gravatar_id":"","url":"https://api.github.com/users/yaacov","html_url":"https://github.com/yaacov","followers_url":"https://api.github.com/users/yaacov/followers","following_url":"https://api.github.com/users/yaacov/following{/other_user}","gists_url":"https://api.github.com/users/yaacov/gists{/gist_id}","starred_url":"https://api.github.com/users/yaacov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaacov/subscriptions","organizations_url":"https://api.github.com/users/yaacov/orgs","repos_url":"https://api.github.com/users/yaacov/repos","events_url":"https://api.github.com/users/yaacov/events{/privacy}","received_events_url":"https://api.github.com/users/yaacov/received_events","type":"User","site_admin":false},"body":"**Description**\r\n\r\nSecond step for soving #41 Watch config files loaded.\r\n\r\nCurrently we only have `\"config files change on file system\"` trigger, this PR add a new trigger `\"config files finished loading\"` that other objects can subscribe to.\r\n\r\nUsing the new event, we can clean up `healer` object from the reference to `loader`, because it now subscribe to an event after `loader` loaded the new config files and we do not need to call the `loader` from inside the `healer\r\n\r\n**Caveat**\r\n\r\nDoes not emit event if load method partially changed config, but returns an error (can't load some config file).\r\nAlways delete all, and then reload all, no intelligent reload. \r\n\r\n**Screenshoot**\r\n\r\n![watch-event](https://user-images.githubusercontent.com/2181522/39491119-da6a6620-4d93-11e8-86b5-06dd809db815.gif)\r\n\r\n","created_at":"2018-05-01T14:38:17Z","updated_at":"2018-05-07T07:26:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"030251cdb7fee807be94f3ae8b2c73bdfcd38674","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":876360891,"url":"https://api.github.com/repos/openshift/autoheal/labels/size/XXL","name":"size/XXL","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/autoheal/pulls/93/commits","review_comments_url":"https://api.github.com/repos/openshift/autoheal/pulls/93/comments","review_comment_url":"https://api.github.com/repos/openshift/autoheal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/autoheal/issues/93/comments","statuses_url":"https://api.github.com/repos/openshift/autoheal/statuses/d2cef68b3c4d9b889d58c9b143d67c14d2307932","head":{"label":"yaacov:add-watch-config-files-loaded","ref":"add-watch-config-files-loaded","sha":"d2cef68b3c4d9b889d58c9b143d67c14d2307932","user":{"login":"yaacov","id":2181522,"avatar_url":"https://avatars2.githubusercontent.com/u/2181522?v=4","gravatar_id":"","url":"https://api.github.com/users/yaacov","html_url":"https://github.com/yaacov","followers_url":"https://api.github.com/users/yaacov/followers","following_url":"https://api.github.com/users/yaacov/following{/other_user}","gists_url":"https://api.github.com/users/yaacov/gists{/gist_id}","starred_url":"https://api.github.com/users/yaacov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaacov/subscriptions","organizations_url":"https://api.github.com/users/yaacov/orgs","repos_url":"https://api.github.com/users/yaacov/repos","events_url":"https://api.github.com/users/yaacov/events{/privacy}","received_events_url":"https://api.github.com/users/yaacov/received_events","type":"User","site_admin":false},"repo":{"id":130653082,"name":"autoheal","full_name":"yaacov/autoheal","owner":{"login":"yaacov","id":2181522,"avatar_url":"https://avatars2.githubusercontent.com/u/2181522?v=4","gravatar_id":"","url":"https://api.github.com/users/yaacov","html_url":"https://github.com/yaacov","followers_url":"https://api.github.com/users/yaacov/followers","following_url":"https://api.github.com/users/yaacov/following{/other_user}","gists_url":"https://api.github.com/users/yaacov/gists{/gist_id}","starred_url":"https://api.github.com/users/yaacov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaacov/subscriptions","organizations_url":"https://api.github.com/users/yaacov/orgs","repos_url":"https://api.github.com/users/yaacov/repos","events_url":"https://api.github.com/users/yaacov/events{/privacy}","received_events_url":"https://api.github.com/users/yaacov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yaacov/autoheal","description":"Autoheals based on monitoring alerts","fork":true,"url":"https://api.github.com/repos/yaacov/autoheal","forks_url":"https://api.github.com/repos/yaacov/autoheal/forks","keys_url":"https://api.github.com/repos/yaacov/autoheal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yaacov/autoheal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yaacov/autoheal/teams","hooks_url":"https://api.github.com/repos/yaacov/autoheal/hooks","issue_events_url":"https://api.github.com/repos/yaacov/autoheal/issues/events{/number}","events_url":"https://api.github.com/repos/yaacov/autoheal/events","assignees_url":"https://api.github.com/repos/yaacov/autoheal/assignees{/user}","branches_url":"https://api.github.com/repos/yaacov/autoheal/branches{/branch}","tags_url":"https://api.github.com/repos/yaacov/autoheal/tags","blobs_url":"https://api.github.com/repos/yaacov/autoheal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yaacov/autoheal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yaacov/autoheal/git/refs{/sha}","trees_url":"https://api.github.com/repos/yaacov/autoheal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yaacov/autoheal/statuses/{sha}","languages_url":"https://api.github.com/repos/yaacov/autoheal/languages","stargazers_url":"https://api.github.com/repos/yaacov/autoheal/stargazers","contributors_url":"https://api.github.com/repos/yaacov/autoheal/contributors","subscribers_url":"https://api.github.com/repos/yaacov/autoheal/subscribers","subscription_url":"https://api.github.com/repos/yaacov/autoheal/subscription","commits_url":"https://api.github.com/repos/yaacov/autoheal/commits{/sha}","git_commits_url":"https://api.github.com/repos/yaacov/autoheal/git/commits{/sha}","comments_url":"https://api.github.com/repos/yaacov/autoheal/comments{/number}","issue_comment_url":"https://api.github.com/repos/yaacov/autoheal/issues/comments{/number}","contents_url":"https://api.github.com/repos/yaacov/autoheal/contents/{+path}","compare_url":"https://api.github.com/repos/yaacov/autoheal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yaacov/autoheal/merges","archive_url":"https://api.github.com/repos/yaacov/autoheal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yaacov/autoheal/downloads","issues_url":"https://api.github.com/repos/yaacov/autoheal/issues{/number}","pulls_url":"https://api.github.com/repos/yaacov/autoheal/pulls{/number}","milestones_url":"https://api.github.com/repos/yaacov/autoheal/milestones{/number}","notifications_url":"https://api.github.com/repos/yaacov/autoheal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yaacov/autoheal/labels{/name}","releases_url":"https://api.github.com/repos/yaacov/autoheal/releases{/id}","deployments_url":"https://api.github.com/repos/yaacov/autoheal/deployments","created_at":"2018-04-23T06:56:00Z","updated_at":"2018-05-01T06:43:53Z","pushed_at":"2018-05-07T07:17:06Z","git_url":"git://github.com/yaacov/autoheal.git","ssh_url":"git@github.com:yaacov/autoheal.git","clone_url":"https://github.com/yaacov/autoheal.git","svn_url":"https://github.com/yaacov/autoheal","homepage":null,"size":24986,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"03017bc6ebc8ef79735298d8e2fcaebc99689c27","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars3.githubusercontent.com/u/792337?v=4","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":126371616,"name":"autoheal","full_name":"openshift/autoheal","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars3.githubusercontent.com/u/792337?v=4","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/autoheal","description":"Autoheals based on monitoring alerts","fork":false,"url":"https://api.github.com/repos/openshift/autoheal","forks_url":"https://api.github.com/repos/openshift/autoheal/forks","keys_url":"https://api.github.com/repos/openshift/autoheal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/autoheal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/autoheal/teams","hooks_url":"https://api.github.com/repos/openshift/autoheal/hooks","issue_events_url":"https://api.github.com/repos/openshift/autoheal/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/autoheal/events","assignees_url":"https://api.github.com/repos/openshift/autoheal/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/autoheal/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/autoheal/tags","blobs_url":"https://api.github.com/repos/openshift/autoheal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/autoheal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/autoheal/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/autoheal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/autoheal/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/autoheal/languages","stargazers_url":"https://api.github.com/repos/openshift/autoheal/stargazers","contributors_url":"https://api.github.com/repos/openshift/autoheal/contributors","subscribers_url":"https://api.github.com/repos/openshift/autoheal/subscribers","subscription_url":"https://api.github.com/repos/openshift/autoheal/subscription","commits_url":"https://api.github.com/repos/openshift/autoheal/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/autoheal/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/autoheal/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/autoheal/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/autoheal/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/autoheal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/autoheal/merges","archive_url":"https://api.github.com/repos/openshift/autoheal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/autoheal/downloads","issues_url":"https://api.github.com/repos/openshift/autoheal/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/autoheal/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/autoheal/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/autoheal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/autoheal/labels{/name}","releases_url":"https://api.github.com/repos/openshift/autoheal/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/autoheal/deployments","created_at":"2018-03-22T17:25:28Z","updated_at":"2018-05-04T21:17:40Z","pushed_at":"2018-05-07T07:17:07Z","git_url":"git://github.com/openshift/autoheal.git","ssh_url":"git@github.com:openshift/autoheal.git","clone_url":"https://github.com/openshift/autoheal.git","svn_url":"https://github.com/openshift/autoheal","homepage":null,"size":24975,"stargazers_count":12,"watchers_count":12,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":11,"open_issues":18,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/autoheal/pulls/93"},"html":{"href":"https://github.com/openshift/autoheal/pull/93"},"issue":{"href":"https://api.github.com/repos/openshift/autoheal/issues/93"},"comments":{"href":"https://api.github.com/repos/openshift/autoheal/issues/93/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/autoheal/pulls/93/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/autoheal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/autoheal/pulls/93/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/autoheal/statuses/d2cef68b3c4d9b889d58c9b143d67c14d2307932"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jhernand"}}