{"action":"created","comment":{"url":"https://api.github.com/repos/water-hole/ansible-operator/pulls/comments/211611777","pull_request_review_id":148067462,"id":211611777,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTYxMTc3Nw==","diff_hunk":"@@ -1,18 +1,22 @@\n-package runner\n+package handler\n+\n+import (\n+\t\"github.com/water-hole/ansible-operator/pkg/runner\"\n+)\n \n const (\n \thost = \"localhost\"\n )\n \n type Status struct {\n-\tOk               int       `json:\"ok\"`\n-\tChanged          int       `json:\"changed\"`\n-\tSkipped          int       `json:\"skipped\"`\n-\tFailures         int       `json:\"failures\"`\n-\tTimeOfCompletion EventTime `json:\"completion\"`\n+\tOk               int              `json:\"ok\"`\n+\tChanged          int              `json:\"changed\"`\n+\tSkipped          int              `json:\"skipped\"`\n+\tFailures         int              `json:\"failures\"`\n+\tTimeOfCompletion runner.EventTime `json:\"completion\"`","path":"pkg/handler/types.go","position":22,"original_position":22,"commit_id":"da9e0cd8183ef9a9cd24aafc485fee861629aec6","original_commit_id":"da9e0cd8183ef9a9cd24aafc485fee861629aec6","user":{"login":"mhrivnak","id":53091,"node_id":"MDQ6VXNlcjUzMDkx","avatar_url":"https://avatars2.githubusercontent.com/u/53091?v=4","gravatar_id":"","url":"https://api.github.com/users/mhrivnak","html_url":"https://github.com/mhrivnak","followers_url":"https://api.github.com/users/mhrivnak/followers","following_url":"https://api.github.com/users/mhrivnak/following{/other_user}","gists_url":"https://api.github.com/users/mhrivnak/gists{/gist_id}","starred_url":"https://api.github.com/users/mhrivnak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhrivnak/subscriptions","organizations_url":"https://api.github.com/users/mhrivnak/orgs","repos_url":"https://api.github.com/users/mhrivnak/repos","events_url":"https://api.github.com/users/mhrivnak/events{/privacy}","received_events_url":"https://api.github.com/users/mhrivnak/received_events","type":"User","site_admin":false},"body":"Leaving it in `runner/` generally seems reasonable if the custom serialization is there to match what ansible does. Although I'm not sure it's worth making a package for just this. Do you think putting it in `runner/time` is better than leaving it in `runner/`? Either seems fine to me.","created_at":"2018-08-21T13:48:49Z","updated_at":"2018-08-21T13:48:49Z","html_url":"https://github.com/water-hole/ansible-operator/pull/35#discussion_r211611777","pull_request_url":"https://api.github.com/repos/water-hole/ansible-operator/pulls/35","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/water-hole/ansible-operator/pulls/comments/211611777"},"html":{"href":"https://github.com/water-hole/ansible-operator/pull/35#discussion_r211611777"},"pull_request":{"href":"https://api.github.com/repos/water-hole/ansible-operator/pulls/35"}},"in_reply_to_id":211402207},"pull_request":{"url":"https://api.github.com/repos/water-hole/ansible-operator/pulls/35","id":209638107,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5NjM4MTA3","html_url":"https://github.com/water-hole/ansible-operator/pull/35","diff_url":"https://github.com/water-hole/ansible-operator/pull/35.diff","patch_url":"https://github.com/water-hole/ansible-operator/pull/35.patch","issue_url":"https://api.github.com/repos/water-hole/ansible-operator/issues/35","number":35,"state":"open","locked":false,"title":"Moves ResourceStatus and related code to the handler package.","user":{"login":"mhrivnak","id":53091,"node_id":"MDQ6VXNlcjUzMDkx","avatar_url":"https://avatars2.githubusercontent.com/u/53091?v=4","gravatar_id":"","url":"https://api.github.com/users/mhrivnak","html_url":"https://github.com/mhrivnak","followers_url":"https://api.github.com/users/mhrivnak/followers","following_url":"https://api.github.com/users/mhrivnak/following{/other_user}","gists_url":"https://api.github.com/users/mhrivnak/gists{/gist_id}","starred_url":"https://api.github.com/users/mhrivnak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhrivnak/subscriptions","organizations_url":"https://api.github.com/users/mhrivnak/orgs","repos_url":"https://api.github.com/users/mhrivnak/repos","events_url":"https://api.github.com/users/mhrivnak/events{/privacy}","received_events_url":"https://api.github.com/users/mhrivnak/received_events","type":"User","site_admin":false},"body":"ResourceStatus represents the Status field on a CR. Everything in types.go\r\nrelates to the CR's status, and not directly to the act of running ansible.\r\nCode in runner/types.go was *only* being used from within handler/handler.go,\r\nwhich is a good indicator that the code should be moved.\r\n\r\nA reasonable boundary is to let the runner package handle execution of ansible,\r\nand let it return information about that run (in the form of a StatusJobEvent).\r\nThe caller (which is in the handler package) can then take that information and\r\ndo whatever is appropriate with it.","created_at":"2018-08-20T20:43:56Z","updated_at":"2018-08-21T13:48:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50fa1e08f07095c9f7e74d2c8af5d93760eded97","assignee":null,"assignees":[],"requested_reviewers":[{"login":"shawn-hurley","id":1891063,"node_id":"MDQ6VXNlcjE4OTEwNjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1891063?v=4","gravatar_id":"","url":"https://api.github.com/users/shawn-hurley","html_url":"https://github.com/shawn-hurley","followers_url":"https://api.github.com/users/shawn-hurley/followers","following_url":"https://api.github.com/users/shawn-hurley/following{/other_user}","gists_url":"https://api.github.com/users/shawn-hurley/gists{/gist_id}","starred_url":"https://api.github.com/users/shawn-hurley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawn-hurley/subscriptions","organizations_url":"https://api.github.com/users/shawn-hurley/orgs","repos_url":"https://api.github.com/users/shawn-hurley/repos","events_url":"https://api.github.com/users/shawn-hurley/events{/privacy}","received_events_url":"https://api.github.com/users/shawn-hurley/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/water-hole/ansible-operator/pulls/35/commits","review_comments_url":"https://api.github.com/repos/water-hole/ansible-operator/pulls/35/comments","review_comment_url":"https://api.github.com/repos/water-hole/ansible-operator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/water-hole/ansible-operator/issues/35/comments","statuses_url":"https://api.github.com/repos/water-hole/ansible-operator/statuses/da9e0cd8183ef9a9cd24aafc485fee861629aec6","head":{"label":"mhrivnak:move-status","ref":"move-status","sha":"da9e0cd8183ef9a9cd24aafc485fee861629aec6","user":{"login":"mhrivnak","id":53091,"node_id":"MDQ6VXNlcjUzMDkx","avatar_url":"https://avatars2.githubusercontent.com/u/53091?v=4","gravatar_id":"","url":"https://api.github.com/users/mhrivnak","html_url":"https://github.com/mhrivnak","followers_url":"https://api.github.com/users/mhrivnak/followers","following_url":"https://api.github.com/users/mhrivnak/following{/other_user}","gists_url":"https://api.github.com/users/mhrivnak/gists{/gist_id}","starred_url":"https://api.github.com/users/mhrivnak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhrivnak/subscriptions","organizations_url":"https://api.github.com/users/mhrivnak/orgs","repos_url":"https://api.github.com/users/mhrivnak/repos","events_url":"https://api.github.com/users/mhrivnak/events{/privacy}","received_events_url":"https://api.github.com/users/mhrivnak/received_events","type":"User","site_admin":false},"repo":{"id":140586689,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA1ODY2ODk=","name":"ansible-operator","full_name":"mhrivnak/ansible-operator","owner":{"login":"mhrivnak","id":53091,"node_id":"MDQ6VXNlcjUzMDkx","avatar_url":"https://avatars2.githubusercontent.com/u/53091?v=4","gravatar_id":"","url":"https://api.github.com/users/mhrivnak","html_url":"https://github.com/mhrivnak","followers_url":"https://api.github.com/users/mhrivnak/followers","following_url":"https://api.github.com/users/mhrivnak/following{/other_user}","gists_url":"https://api.github.com/users/mhrivnak/gists{/gist_id}","starred_url":"https://api.github.com/users/mhrivnak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhrivnak/subscriptions","organizations_url":"https://api.github.com/users/mhrivnak/orgs","repos_url":"https://api.github.com/users/mhrivnak/repos","events_url":"https://api.github.com/users/mhrivnak/events{/privacy}","received_events_url":"https://api.github.com/users/mhrivnak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mhrivnak/ansible-operator","description":"POC Code for the operator backed by ansible ","fork":true,"url":"https://api.github.com/repos/mhrivnak/ansible-operator","forks_url":"https://api.github.com/repos/mhrivnak/ansible-operator/forks","keys_url":"https://api.github.com/repos/mhrivnak/ansible-operator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mhrivnak/ansible-operator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mhrivnak/ansible-operator/teams","hooks_url":"https://api.github.com/repos/mhrivnak/ansible-operator/hooks","issue_events_url":"https://api.github.com/repos/mhrivnak/ansible-operator/issues/events{/number}","events_url":"https://api.github.com/repos/mhrivnak/ansible-operator/events","assignees_url":"https://api.github.com/repos/mhrivnak/ansible-operator/assignees{/user}","branches_url":"https://api.github.com/repos/mhrivnak/ansible-operator/branches{/branch}","tags_url":"https://api.github.com/repos/mhrivnak/ansible-operator/tags","blobs_url":"https://api.github.com/repos/mhrivnak/ansible-operator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mhrivnak/ansible-operator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mhrivnak/ansible-operator/git/refs{/sha}","trees_url":"https://api.github.com/repos/mhrivnak/ansible-operator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mhrivnak/ansible-operator/statuses/{sha}","languages_url":"https://api.github.com/repos/mhrivnak/ansible-operator/languages","stargazers_url":"https://api.github.com/repos/mhrivnak/ansible-operator/stargazers","contributors_url":"https://api.github.com/repos/mhrivnak/ansible-operator/contributors","subscribers_url":"https://api.github.com/repos/mhrivnak/ansible-operator/subscribers","subscription_url":"https://api.github.com/repos/mhrivnak/ansible-operator/subscription","commits_url":"https://api.github.com/repos/mhrivnak/ansible-operator/commits{/sha}","git_commits_url":"https://api.github.com/repos/mhrivnak/ansible-operator/git/commits{/sha}","comments_url":"https://api.github.com/repos/mhrivnak/ansible-operator/comments{/number}","issue_comment_url":"https://api.github.com/repos/mhrivnak/ansible-operator/issues/comments{/number}","contents_url":"https://api.github.com/repos/mhrivnak/ansible-operator/contents/{+path}","compare_url":"https://api.github.com/repos/mhrivnak/ansible-operator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mhrivnak/ansible-operator/merges","archive_url":"https://api.github.com/repos/mhrivnak/ansible-operator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mhrivnak/ansible-operator/downloads","issues_url":"https://api.github.com/repos/mhrivnak/ansible-operator/issues{/number}","pulls_url":"https://api.github.com/repos/mhrivnak/ansible-operator/pulls{/number}","milestones_url":"https://api.github.com/repos/mhrivnak/ansible-operator/milestones{/number}","notifications_url":"https://api.github.com/repos/mhrivnak/ansible-operator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mhrivnak/ansible-operator/labels{/name}","releases_url":"https://api.github.com/repos/mhrivnak/ansible-operator/releases{/id}","deployments_url":"https://api.github.com/repos/mhrivnak/ansible-operator/deployments","created_at":"2018-07-11T14:25:50Z","updated_at":"2018-08-09T20:40:00Z","pushed_at":"2018-08-20T20:42:52Z","git_url":"git://github.com/mhrivnak/ansible-operator.git","ssh_url":"git@github.com:mhrivnak/ansible-operator.git","clone_url":"https://github.com/mhrivnak/ansible-operator.git","svn_url":"https://github.com/mhrivnak/ansible-operator","homepage":null,"size":40282,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"water-hole:master","ref":"master","sha":"8e06c2fb7ca0b36cb601c42d86a37edebd404bf5","user":{"login":"water-hole","id":41925489,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxOTI1NDg5","avatar_url":"https://avatars0.githubusercontent.com/u/41925489?v=4","gravatar_id":"","url":"https://api.github.com/users/water-hole","html_url":"https://github.com/water-hole","followers_url":"https://api.github.com/users/water-hole/followers","following_url":"https://api.github.com/users/water-hole/following{/other_user}","gists_url":"https://api.github.com/users/water-hole/gists{/gist_id}","starred_url":"https://api.github.com/users/water-hole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/water-hole/subscriptions","organizations_url":"https://api.github.com/users/water-hole/orgs","repos_url":"https://api.github.com/users/water-hole/repos","events_url":"https://api.github.com/users/water-hole/events{/privacy}","received_events_url":"https://api.github.com/users/water-hole/received_events","type":"Organization","site_admin":false},"repo":{"id":137922565,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc5MjI1NjU=","name":"ansible-operator","full_name":"water-hole/ansible-operator","owner":{"login":"water-hole","id":41925489,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxOTI1NDg5","avatar_url":"https://avatars0.githubusercontent.com/u/41925489?v=4","gravatar_id":"","url":"https://api.github.com/users/water-hole","html_url":"https://github.com/water-hole","followers_url":"https://api.github.com/users/water-hole/followers","following_url":"https://api.github.com/users/water-hole/following{/other_user}","gists_url":"https://api.github.com/users/water-hole/gists{/gist_id}","starred_url":"https://api.github.com/users/water-hole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/water-hole/subscriptions","organizations_url":"https://api.github.com/users/water-hole/orgs","repos_url":"https://api.github.com/users/water-hole/repos","events_url":"https://api.github.com/users/water-hole/events{/privacy}","received_events_url":"https://api.github.com/users/water-hole/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/water-hole/ansible-operator","description":"POC Code for the operator backed by ansible ","fork":false,"url":"https://api.github.com/repos/water-hole/ansible-operator","forks_url":"https://api.github.com/repos/water-hole/ansible-operator/forks","keys_url":"https://api.github.com/repos/water-hole/ansible-operator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/water-hole/ansible-operator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/water-hole/ansible-operator/teams","hooks_url":"https://api.github.com/repos/water-hole/ansible-operator/hooks","issue_events_url":"https://api.github.com/repos/water-hole/ansible-operator/issues/events{/number}","events_url":"https://api.github.com/repos/water-hole/ansible-operator/events","assignees_url":"https://api.github.com/repos/water-hole/ansible-operator/assignees{/user}","branches_url":"https://api.github.com/repos/water-hole/ansible-operator/branches{/branch}","tags_url":"https://api.github.com/repos/water-hole/ansible-operator/tags","blobs_url":"https://api.github.com/repos/water-hole/ansible-operator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/water-hole/ansible-operator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/water-hole/ansible-operator/git/refs{/sha}","trees_url":"https://api.github.com/repos/water-hole/ansible-operator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/water-hole/ansible-operator/statuses/{sha}","languages_url":"https://api.github.com/repos/water-hole/ansible-operator/languages","stargazers_url":"https://api.github.com/repos/water-hole/ansible-operator/stargazers","contributors_url":"https://api.github.com/repos/water-hole/ansible-operator/contributors","subscribers_url":"https://api.github.com/repos/water-hole/ansible-operator/subscribers","subscription_url":"https://api.github.com/repos/water-hole/ansible-operator/subscription","commits_url":"https://api.github.com/repos/water-hole/ansible-operator/commits{/sha}","git_commits_url":"https://api.github.com/repos/water-hole/ansible-operator/git/commits{/sha}","comments_url":"https://api.github.com/repos/water-hole/ansible-operator/comments{/number}","issue_comment_url":"https://api.github.com/repos/water-hole/ansible-operator/issues/comments{/number}","contents_url":"https://api.github.com/repos/water-hole/ansible-operator/contents/{+path}","compare_url":"https://api.github.com/repos/water-hole/ansible-operator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/water-hole/ansible-operator/merges","archive_url":"https://api.github.com/repos/water-hole/ansible-operator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/water-hole/ansible-operator/downloads","issues_url":"https://api.github.com/repos/water-hole/ansible-operator/issues{/number}","pulls_url":"https://api.github.com/repos/water-hole/ansible-operator/pulls{/number}","milestones_url":"https://api.github.com/repos/water-hole/ansible-operator/milestones{/number}","notifications_url":"https://api.github.com/repos/water-hole/ansible-operator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/water-hole/ansible-operator/labels{/name}","releases_url":"https://api.github.com/repos/water-hole/ansible-operator/releases{/id}","deployments_url":"https://api.github.com/repos/water-hole/ansible-operator/deployments","created_at":"2018-06-19T17:16:45Z","updated_at":"2018-08-17T13:37:54Z","pushed_at":"2018-08-20T20:43:56Z","git_url":"git://github.com/water-hole/ansible-operator.git","ssh_url":"git@github.com:water-hole/ansible-operator.git","clone_url":"https://github.com/water-hole/ansible-operator.git","svn_url":"https://github.com/water-hole/ansible-operator","homepage":null,"size":33841,"stargazers_count":11,"watchers_count":11,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":13,"license":null,"forks":12,"open_issues":13,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/water-hole/ansible-operator/pulls/35"},"html":{"href":"https://github.com/water-hole/ansible-operator/pull/35"},"issue":{"href":"https://api.github.com/repos/water-hole/ansible-operator/issues/35"},"comments":{"href":"https://api.github.com/repos/water-hole/ansible-operator/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/water-hole/ansible-operator/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/water-hole/ansible-operator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/water-hole/ansible-operator/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/water-hole/ansible-operator/statuses/da9e0cd8183ef9a9cd24aafc485fee861629aec6"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mhrivnak"}}