{"action":"created","comment":{"url":"https://api.github.com/repos/mendersoftware/mender/pulls/comments/69904443","id":69904443,"diff_hunk":"@@ -113,10 +115,16 @@ import (\n //                           (daemon exit)\n //\n \n+type StateContext struct {\n+\tctrl   Controller","path":"state.go","position":15,"original_position":15,"commit_id":"3111da56e33905886535fab5d8d0c2b76e3c1786","original_commit_id":"e3a72a8a0326f9b2fc7d1c7c82e8f6aeccd1b55d","user":{"login":"pasinskim","id":6329055,"avatar_url":"https://avatars.githubusercontent.com/u/6329055?v=3","gravatar_id":"","url":"https://api.github.com/users/pasinskim","html_url":"https://github.com/pasinskim","followers_url":"https://api.github.com/users/pasinskim/followers","following_url":"https://api.github.com/users/pasinskim/following{/other_user}","gists_url":"https://api.github.com/users/pasinskim/gists{/gist_id}","starred_url":"https://api.github.com/users/pasinskim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasinskim/subscriptions","organizations_url":"https://api.github.com/users/pasinskim/orgs","repos_url":"https://api.github.com/users/pasinskim/repos","events_url":"https://api.github.com/users/pasinskim/events{/privacy}","received_events_url":"https://api.github.com/users/pasinskim/received_events","type":"User","site_admin":false},"body":"Why do we need a Controller here? ","created_at":"2016-07-07T13:21:48Z","updated_at":"2016-07-07T13:21:48Z","html_url":"https://github.com/mendersoftware/mender/pull/82#discussion_r69904443","pull_request_url":"https://api.github.com/repos/mendersoftware/mender/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/mendersoftware/mender/pulls/comments/69904443"},"html":{"href":"https://github.com/mendersoftware/mender/pull/82#discussion_r69904443"},"pull_request":{"href":"https://api.github.com/repos/mendersoftware/mender/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/mendersoftware/mender/pulls/82","id":76553375,"html_url":"https://github.com/mendersoftware/mender/pull/82","diff_url":"https://github.com/mendersoftware/mender/pull/82.diff","patch_url":"https://github.com/mendersoftware/mender/pull/82.patch","issue_url":"https://api.github.com/repos/mendersoftware/mender/issues/82","number":82,"state":"open","locked":false,"title":"Preserve state data across reboots","user":{"login":"bboozzoo","id":41870,"avatar_url":"https://avatars.githubusercontent.com/u/41870?v=3","gravatar_id":"","url":"https://api.github.com/users/bboozzoo","html_url":"https://github.com/bboozzoo","followers_url":"https://api.github.com/users/bboozzoo/followers","following_url":"https://api.github.com/users/bboozzoo/following{/other_user}","gists_url":"https://api.github.com/users/bboozzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/bboozzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboozzoo/subscriptions","organizations_url":"https://api.github.com/users/bboozzoo/orgs","repos_url":"https://api.github.com/users/bboozzoo/repos","events_url":"https://api.github.com/users/bboozzoo/events{/privacy}","received_events_url":"https://api.github.com/users/bboozzoo/received_events","type":"User","site_admin":false},"body":"A proposal of a method for preserving state information across reboots. Update related actions such as reporting of log upload require information on the update that is applied. Since update will normally involve a reboot at some point, we need to capture and preserve update information across reboots, so that it's possible to report update progress after the system was restarted.\r\n\r\nThe series adds a new entry called `state` to client data store. The `state` file contains JSON serialized `StateData` structure, that captures both the update response and the last state ID. State data is stored when entering a state handler. Loading happens only when entering `UpdateCommitState`. The state entry is removed after an update has been committed.\r\n\r\nThere are still some open questions about what to do where a reboot happens mid update. For instance, when update is being installed. I expect that the state ID field will come in useful here. Since state data also captures the download URL, we should be able to resume from say, `UpdateFetchState` when needed. Anyways, I expect this to be a starting point for a longer discussion.","created_at":"2016-07-07T07:58:42Z","updated_at":"2016-07-07T13:21:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6afea1911bf6f945070b0b4f03452d7a5d484ab","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mendersoftware/mender/pulls/82/commits","review_comments_url":"https://api.github.com/repos/mendersoftware/mender/pulls/82/comments","review_comment_url":"https://api.github.com/repos/mendersoftware/mender/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mendersoftware/mender/issues/82/comments","statuses_url":"https://api.github.com/repos/mendersoftware/mender/statuses/3111da56e33905886535fab5d8d0c2b76e3c1786","head":{"label":"bboozzoo:bboozzoo/preserve-state-data","ref":"bboozzoo/preserve-state-data","sha":"3111da56e33905886535fab5d8d0c2b76e3c1786","user":{"login":"bboozzoo","id":41870,"avatar_url":"https://avatars.githubusercontent.com/u/41870?v=3","gravatar_id":"","url":"https://api.github.com/users/bboozzoo","html_url":"https://github.com/bboozzoo","followers_url":"https://api.github.com/users/bboozzoo/followers","following_url":"https://api.github.com/users/bboozzoo/following{/other_user}","gists_url":"https://api.github.com/users/bboozzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/bboozzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboozzoo/subscriptions","organizations_url":"https://api.github.com/users/bboozzoo/orgs","repos_url":"https://api.github.com/users/bboozzoo/repos","events_url":"https://api.github.com/users/bboozzoo/events{/privacy}","received_events_url":"https://api.github.com/users/bboozzoo/received_events","type":"User","site_admin":false},"repo":{"id":58195891,"name":"mender","full_name":"bboozzoo/mender","owner":{"login":"bboozzoo","id":41870,"avatar_url":"https://avatars.githubusercontent.com/u/41870?v=3","gravatar_id":"","url":"https://api.github.com/users/bboozzoo","html_url":"https://github.com/bboozzoo","followers_url":"https://api.github.com/users/bboozzoo/followers","following_url":"https://api.github.com/users/bboozzoo/following{/other_user}","gists_url":"https://api.github.com/users/bboozzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/bboozzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboozzoo/subscriptions","organizations_url":"https://api.github.com/users/bboozzoo/orgs","repos_url":"https://api.github.com/users/bboozzoo/repos","events_url":"https://api.github.com/users/bboozzoo/events{/privacy}","received_events_url":"https://api.github.com/users/bboozzoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bboozzoo/mender","description":"Mender over-the-air software updates.","fork":true,"url":"https://api.github.com/repos/bboozzoo/mender","forks_url":"https://api.github.com/repos/bboozzoo/mender/forks","keys_url":"https://api.github.com/repos/bboozzoo/mender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bboozzoo/mender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bboozzoo/mender/teams","hooks_url":"https://api.github.com/repos/bboozzoo/mender/hooks","issue_events_url":"https://api.github.com/repos/bboozzoo/mender/issues/events{/number}","events_url":"https://api.github.com/repos/bboozzoo/mender/events","assignees_url":"https://api.github.com/repos/bboozzoo/mender/assignees{/user}","branches_url":"https://api.github.com/repos/bboozzoo/mender/branches{/branch}","tags_url":"https://api.github.com/repos/bboozzoo/mender/tags","blobs_url":"https://api.github.com/repos/bboozzoo/mender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bboozzoo/mender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bboozzoo/mender/git/refs{/sha}","trees_url":"https://api.github.com/repos/bboozzoo/mender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bboozzoo/mender/statuses/{sha}","languages_url":"https://api.github.com/repos/bboozzoo/mender/languages","stargazers_url":"https://api.github.com/repos/bboozzoo/mender/stargazers","contributors_url":"https://api.github.com/repos/bboozzoo/mender/contributors","subscribers_url":"https://api.github.com/repos/bboozzoo/mender/subscribers","subscription_url":"https://api.github.com/repos/bboozzoo/mender/subscription","commits_url":"https://api.github.com/repos/bboozzoo/mender/commits{/sha}","git_commits_url":"https://api.github.com/repos/bboozzoo/mender/git/commits{/sha}","comments_url":"https://api.github.com/repos/bboozzoo/mender/comments{/number}","issue_comment_url":"https://api.github.com/repos/bboozzoo/mender/issues/comments{/number}","contents_url":"https://api.github.com/repos/bboozzoo/mender/contents/{+path}","compare_url":"https://api.github.com/repos/bboozzoo/mender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bboozzoo/mender/merges","archive_url":"https://api.github.com/repos/bboozzoo/mender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bboozzoo/mender/downloads","issues_url":"https://api.github.com/repos/bboozzoo/mender/issues{/number}","pulls_url":"https://api.github.com/repos/bboozzoo/mender/pulls{/number}","milestones_url":"https://api.github.com/repos/bboozzoo/mender/milestones{/number}","notifications_url":"https://api.github.com/repos/bboozzoo/mender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bboozzoo/mender/labels{/name}","releases_url":"https://api.github.com/repos/bboozzoo/mender/releases{/id}","deployments_url":"https://api.github.com/repos/bboozzoo/mender/deployments","created_at":"2016-05-06T09:20:01Z","updated_at":"2016-05-06T09:20:02Z","pushed_at":"2016-07-07T09:19:55Z","git_url":"git://github.com/bboozzoo/mender.git","ssh_url":"git@github.com:bboozzoo/mender.git","clone_url":"https://github.com/bboozzoo/mender.git","svn_url":"https://github.com/bboozzoo/mender","homepage":"https://mender.io","size":925,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mendersoftware:master","ref":"master","sha":"c5d6150ab0ffac3873123afedb6a99142737afc2","user":{"login":"mendersoftware","id":15040539,"avatar_url":"https://avatars.githubusercontent.com/u/15040539?v=3","gravatar_id":"","url":"https://api.github.com/users/mendersoftware","html_url":"https://github.com/mendersoftware","followers_url":"https://api.github.com/users/mendersoftware/followers","following_url":"https://api.github.com/users/mendersoftware/following{/other_user}","gists_url":"https://api.github.com/users/mendersoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/mendersoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendersoftware/subscriptions","organizations_url":"https://api.github.com/users/mendersoftware/orgs","repos_url":"https://api.github.com/users/mendersoftware/repos","events_url":"https://api.github.com/users/mendersoftware/events{/privacy}","received_events_url":"https://api.github.com/users/mendersoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":47542798,"name":"mender","full_name":"mendersoftware/mender","owner":{"login":"mendersoftware","id":15040539,"avatar_url":"https://avatars.githubusercontent.com/u/15040539?v=3","gravatar_id":"","url":"https://api.github.com/users/mendersoftware","html_url":"https://github.com/mendersoftware","followers_url":"https://api.github.com/users/mendersoftware/followers","following_url":"https://api.github.com/users/mendersoftware/following{/other_user}","gists_url":"https://api.github.com/users/mendersoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/mendersoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendersoftware/subscriptions","organizations_url":"https://api.github.com/users/mendersoftware/orgs","repos_url":"https://api.github.com/users/mendersoftware/repos","events_url":"https://api.github.com/users/mendersoftware/events{/privacy}","received_events_url":"https://api.github.com/users/mendersoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mendersoftware/mender","description":"Mender over-the-air software updates.","fork":false,"url":"https://api.github.com/repos/mendersoftware/mender","forks_url":"https://api.github.com/repos/mendersoftware/mender/forks","keys_url":"https://api.github.com/repos/mendersoftware/mender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mendersoftware/mender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mendersoftware/mender/teams","hooks_url":"https://api.github.com/repos/mendersoftware/mender/hooks","issue_events_url":"https://api.github.com/repos/mendersoftware/mender/issues/events{/number}","events_url":"https://api.github.com/repos/mendersoftware/mender/events","assignees_url":"https://api.github.com/repos/mendersoftware/mender/assignees{/user}","branches_url":"https://api.github.com/repos/mendersoftware/mender/branches{/branch}","tags_url":"https://api.github.com/repos/mendersoftware/mender/tags","blobs_url":"https://api.github.com/repos/mendersoftware/mender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mendersoftware/mender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mendersoftware/mender/git/refs{/sha}","trees_url":"https://api.github.com/repos/mendersoftware/mender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mendersoftware/mender/statuses/{sha}","languages_url":"https://api.github.com/repos/mendersoftware/mender/languages","stargazers_url":"https://api.github.com/repos/mendersoftware/mender/stargazers","contributors_url":"https://api.github.com/repos/mendersoftware/mender/contributors","subscribers_url":"https://api.github.com/repos/mendersoftware/mender/subscribers","subscription_url":"https://api.github.com/repos/mendersoftware/mender/subscription","commits_url":"https://api.github.com/repos/mendersoftware/mender/commits{/sha}","git_commits_url":"https://api.github.com/repos/mendersoftware/mender/git/commits{/sha}","comments_url":"https://api.github.com/repos/mendersoftware/mender/comments{/number}","issue_comment_url":"https://api.github.com/repos/mendersoftware/mender/issues/comments{/number}","contents_url":"https://api.github.com/repos/mendersoftware/mender/contents/{+path}","compare_url":"https://api.github.com/repos/mendersoftware/mender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mendersoftware/mender/merges","archive_url":"https://api.github.com/repos/mendersoftware/mender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mendersoftware/mender/downloads","issues_url":"https://api.github.com/repos/mendersoftware/mender/issues{/number}","pulls_url":"https://api.github.com/repos/mendersoftware/mender/pulls{/number}","milestones_url":"https://api.github.com/repos/mendersoftware/mender/milestones{/number}","notifications_url":"https://api.github.com/repos/mendersoftware/mender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mendersoftware/mender/labels{/name}","releases_url":"https://api.github.com/repos/mendersoftware/mender/releases{/id}","deployments_url":"https://api.github.com/repos/mendersoftware/mender/deployments","created_at":"2015-12-07T09:36:43Z","updated_at":"2016-05-11T10:44:26Z","pushed_at":"2016-07-07T13:15:45Z","git_url":"git://github.com/mendersoftware/mender.git","ssh_url":"git@github.com:mendersoftware/mender.git","clone_url":"https://github.com/mendersoftware/mender.git","svn_url":"https://github.com/mendersoftware/mender","homepage":"https://mender.io","size":971,"stargazers_count":10,"watchers_count":10,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":2,"forks":11,"open_issues":2,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mendersoftware/mender/pulls/82"},"html":{"href":"https://github.com/mendersoftware/mender/pull/82"},"issue":{"href":"https://api.github.com/repos/mendersoftware/mender/issues/82"},"comments":{"href":"https://api.github.com/repos/mendersoftware/mender/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/mendersoftware/mender/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/mendersoftware/mender/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mendersoftware/mender/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/mendersoftware/mender/statuses/3111da56e33905886535fab5d8d0c2b76e3c1786"}}}}
{"actor":{"display_login":"pasinskim"}}