{"action":"created","comment":{"url":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/comments/223058422","pull_request_review_id":162100592,"id":223058422,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzA1ODQyMg==","diff_hunk":"@@ -0,0 +1,47 @@\n+defmodule NervesHub.Client do\n+  @moduledoc \"\"\"\n+  Responsible for determining if an update should be applied.\n+  \"\"\"\n+  require Logger\n+\n+  @typedoc \"Update that comes over a socket.\"\n+  @type update_data :: map()\n+\n+  @callback update_available(update_data) :: :apply | :ignore | {:reschedule, pos_integer()}\n+\n+  @callback reboot_required() :: :apply | :ignore | {:reschedule, pos_integer()}\n+\n+  def update_available(client, data) do\n+    case apply(client, :update_available, [data]) do","path":"lib/nerves_hub/client.ex","position":null,"original_position":15,"commit_id":"ee8a610c73a37e64ce9fff9a4e652e26ec99723d","original_commit_id":"26bbd4f47ff8e36bdef38db1dc5009ed937425e9","user":{"login":"ConnorRigby","id":21150830,"node_id":"MDQ6VXNlcjIxMTUwODMw","avatar_url":"https://avatars3.githubusercontent.com/u/21150830?v=4","gravatar_id":"","url":"https://api.github.com/users/ConnorRigby","html_url":"https://github.com/ConnorRigby","followers_url":"https://api.github.com/users/ConnorRigby/followers","following_url":"https://api.github.com/users/ConnorRigby/following{/other_user}","gists_url":"https://api.github.com/users/ConnorRigby/gists{/gist_id}","starred_url":"https://api.github.com/users/ConnorRigby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ConnorRigby/subscriptions","organizations_url":"https://api.github.com/users/ConnorRigby/orgs","repos_url":"https://api.github.com/users/ConnorRigby/repos","events_url":"https://api.github.com/users/ConnorRigby/events{/privacy}","received_events_url":"https://api.github.com/users/ConnorRigby/received_events","type":"User","site_admin":false},"body":"@fhunleth I chose to do this in case a device has a bad \"client\" implementation, it would allow the update to be applied. It _can_ be removed if we want though. ","created_at":"2018-10-05T15:58:28Z","updated_at":"2018-10-05T15:58:28Z","html_url":"https://github.com/nerves-hub/nerves_hub/pull/19#discussion_r223058422","pull_request_url":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/19","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/comments/223058422"},"html":{"href":"https://github.com/nerves-hub/nerves_hub/pull/19#discussion_r223058422"},"pull_request":{"href":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/19"}},"in_reply_to_id":221723572},"pull_request":{"url":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/19","id":215063143,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MDYzMTQz","html_url":"https://github.com/nerves-hub/nerves_hub/pull/19","diff_url":"https://github.com/nerves-hub/nerves_hub/pull/19.diff","patch_url":"https://github.com/nerves-hub/nerves_hub/pull/19.patch","issue_url":"https://api.github.com/repos/nerves-hub/nerves_hub/issues/19","number":19,"state":"open","locked":false,"title":"Add behaviour for conditional update application.","user":{"login":"ConnorRigby","id":21150830,"node_id":"MDQ6VXNlcjIxMTUwODMw","avatar_url":"https://avatars3.githubusercontent.com/u/21150830?v=4","gravatar_id":"","url":"https://api.github.com/users/ConnorRigby","html_url":"https://github.com/ConnorRigby","followers_url":"https://api.github.com/users/ConnorRigby/followers","following_url":"https://api.github.com/users/ConnorRigby/following{/other_user}","gists_url":"https://api.github.com/users/ConnorRigby/gists{/gist_id}","starred_url":"https://api.github.com/users/ConnorRigby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ConnorRigby/subscriptions","organizations_url":"https://api.github.com/users/ConnorRigby/orgs","repos_url":"https://api.github.com/users/ConnorRigby/repos","events_url":"https://api.github.com/users/ConnorRigby/events{/privacy}","received_events_url":"https://api.github.com/users/ConnorRigby/received_events","type":"User","site_admin":false},"body":"I'm not super happy with the name of this behaviour. Open to\r\nsuggestions.\r\n\r\nfixes #18.","created_at":"2018-09-12T19:00:44Z","updated_at":"2018-10-05T15:58:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c978cb9c96c832065b1b96209032de7da3bd66f","assignee":{"login":"fhunleth","id":64669,"node_id":"MDQ6VXNlcjY0NjY5","avatar_url":"https://avatars0.githubusercontent.com/u/64669?v=4","gravatar_id":"","url":"https://api.github.com/users/fhunleth","html_url":"https://github.com/fhunleth","followers_url":"https://api.github.com/users/fhunleth/followers","following_url":"https://api.github.com/users/fhunleth/following{/other_user}","gists_url":"https://api.github.com/users/fhunleth/gists{/gist_id}","starred_url":"https://api.github.com/users/fhunleth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhunleth/subscriptions","organizations_url":"https://api.github.com/users/fhunleth/orgs","repos_url":"https://api.github.com/users/fhunleth/repos","events_url":"https://api.github.com/users/fhunleth/events{/privacy}","received_events_url":"https://api.github.com/users/fhunleth/received_events","type":"User","site_admin":false},"assignees":[{"login":"fhunleth","id":64669,"node_id":"MDQ6VXNlcjY0NjY5","avatar_url":"https://avatars0.githubusercontent.com/u/64669?v=4","gravatar_id":"","url":"https://api.github.com/users/fhunleth","html_url":"https://github.com/fhunleth","followers_url":"https://api.github.com/users/fhunleth/followers","following_url":"https://api.github.com/users/fhunleth/following{/other_user}","gists_url":"https://api.github.com/users/fhunleth/gists{/gist_id}","starred_url":"https://api.github.com/users/fhunleth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhunleth/subscriptions","organizations_url":"https://api.github.com/users/fhunleth/orgs","repos_url":"https://api.github.com/users/fhunleth/repos","events_url":"https://api.github.com/users/fhunleth/events{/privacy}","received_events_url":"https://api.github.com/users/fhunleth/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/19/commits","review_comments_url":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/19/comments","review_comment_url":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nerves-hub/nerves_hub/issues/19/comments","statuses_url":"https://api.github.com/repos/nerves-hub/nerves_hub/statuses/ee8a610c73a37e64ce9fff9a4e652e26ec99723d","head":{"label":"nerves-hub:add-conditional-update-handler","ref":"add-conditional-update-handler","sha":"ee8a610c73a37e64ce9fff9a4e652e26ec99723d","user":{"login":"nerves-hub","id":39568345,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NTY4MzQ1","avatar_url":"https://avatars1.githubusercontent.com/u/39568345?v=4","gravatar_id":"","url":"https://api.github.com/users/nerves-hub","html_url":"https://github.com/nerves-hub","followers_url":"https://api.github.com/users/nerves-hub/followers","following_url":"https://api.github.com/users/nerves-hub/following{/other_user}","gists_url":"https://api.github.com/users/nerves-hub/gists{/gist_id}","starred_url":"https://api.github.com/users/nerves-hub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerves-hub/subscriptions","organizations_url":"https://api.github.com/users/nerves-hub/orgs","repos_url":"https://api.github.com/users/nerves-hub/repos","events_url":"https://api.github.com/users/nerves-hub/events{/privacy}","received_events_url":"https://api.github.com/users/nerves-hub/received_events","type":"Organization","site_admin":false},"repo":{"id":134645783,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ2NDU3ODM=","name":"nerves_hub","full_name":"nerves-hub/nerves_hub","private":false,"owner":{"login":"nerves-hub","id":39568345,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NTY4MzQ1","avatar_url":"https://avatars1.githubusercontent.com/u/39568345?v=4","gravatar_id":"","url":"https://api.github.com/users/nerves-hub","html_url":"https://github.com/nerves-hub","followers_url":"https://api.github.com/users/nerves-hub/followers","following_url":"https://api.github.com/users/nerves-hub/following{/other_user}","gists_url":"https://api.github.com/users/nerves-hub/gists{/gist_id}","starred_url":"https://api.github.com/users/nerves-hub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerves-hub/subscriptions","organizations_url":"https://api.github.com/users/nerves-hub/orgs","repos_url":"https://api.github.com/users/nerves-hub/repos","events_url":"https://api.github.com/users/nerves-hub/events{/privacy}","received_events_url":"https://api.github.com/users/nerves-hub/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nerves-hub/nerves_hub","description":"NervesHub client","fork":false,"url":"https://api.github.com/repos/nerves-hub/nerves_hub","forks_url":"https://api.github.com/repos/nerves-hub/nerves_hub/forks","keys_url":"https://api.github.com/repos/nerves-hub/nerves_hub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nerves-hub/nerves_hub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nerves-hub/nerves_hub/teams","hooks_url":"https://api.github.com/repos/nerves-hub/nerves_hub/hooks","issue_events_url":"https://api.github.com/repos/nerves-hub/nerves_hub/issues/events{/number}","events_url":"https://api.github.com/repos/nerves-hub/nerves_hub/events","assignees_url":"https://api.github.com/repos/nerves-hub/nerves_hub/assignees{/user}","branches_url":"https://api.github.com/repos/nerves-hub/nerves_hub/branches{/branch}","tags_url":"https://api.github.com/repos/nerves-hub/nerves_hub/tags","blobs_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/refs{/sha}","trees_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nerves-hub/nerves_hub/statuses/{sha}","languages_url":"https://api.github.com/repos/nerves-hub/nerves_hub/languages","stargazers_url":"https://api.github.com/repos/nerves-hub/nerves_hub/stargazers","contributors_url":"https://api.github.com/repos/nerves-hub/nerves_hub/contributors","subscribers_url":"https://api.github.com/repos/nerves-hub/nerves_hub/subscribers","subscription_url":"https://api.github.com/repos/nerves-hub/nerves_hub/subscription","commits_url":"https://api.github.com/repos/nerves-hub/nerves_hub/commits{/sha}","git_commits_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/commits{/sha}","comments_url":"https://api.github.com/repos/nerves-hub/nerves_hub/comments{/number}","issue_comment_url":"https://api.github.com/repos/nerves-hub/nerves_hub/issues/comments{/number}","contents_url":"https://api.github.com/repos/nerves-hub/nerves_hub/contents/{+path}","compare_url":"https://api.github.com/repos/nerves-hub/nerves_hub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nerves-hub/nerves_hub/merges","archive_url":"https://api.github.com/repos/nerves-hub/nerves_hub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nerves-hub/nerves_hub/downloads","issues_url":"https://api.github.com/repos/nerves-hub/nerves_hub/issues{/number}","pulls_url":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls{/number}","milestones_url":"https://api.github.com/repos/nerves-hub/nerves_hub/milestones{/number}","notifications_url":"https://api.github.com/repos/nerves-hub/nerves_hub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nerves-hub/nerves_hub/labels{/name}","releases_url":"https://api.github.com/repos/nerves-hub/nerves_hub/releases{/id}","deployments_url":"https://api.github.com/repos/nerves-hub/nerves_hub/deployments","created_at":"2018-05-24T01:42:17Z","updated_at":"2018-10-03T21:25:58Z","pushed_at":"2018-10-02T19:05:20Z","git_url":"git://github.com/nerves-hub/nerves_hub.git","ssh_url":"git@github.com:nerves-hub/nerves_hub.git","clone_url":"https://github.com/nerves-hub/nerves_hub.git","svn_url":"https://github.com/nerves-hub/nerves_hub","homepage":"","size":107,"stargazers_count":21,"watchers_count":21,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":3,"open_issues":6,"watchers":21,"default_branch":"master"}},"base":{"label":"nerves-hub:master","ref":"master","sha":"4b45604046634e2c8948c60b83f4507184fa0293","user":{"login":"nerves-hub","id":39568345,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NTY4MzQ1","avatar_url":"https://avatars1.githubusercontent.com/u/39568345?v=4","gravatar_id":"","url":"https://api.github.com/users/nerves-hub","html_url":"https://github.com/nerves-hub","followers_url":"https://api.github.com/users/nerves-hub/followers","following_url":"https://api.github.com/users/nerves-hub/following{/other_user}","gists_url":"https://api.github.com/users/nerves-hub/gists{/gist_id}","starred_url":"https://api.github.com/users/nerves-hub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerves-hub/subscriptions","organizations_url":"https://api.github.com/users/nerves-hub/orgs","repos_url":"https://api.github.com/users/nerves-hub/repos","events_url":"https://api.github.com/users/nerves-hub/events{/privacy}","received_events_url":"https://api.github.com/users/nerves-hub/received_events","type":"Organization","site_admin":false},"repo":{"id":134645783,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ2NDU3ODM=","name":"nerves_hub","full_name":"nerves-hub/nerves_hub","private":false,"owner":{"login":"nerves-hub","id":39568345,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NTY4MzQ1","avatar_url":"https://avatars1.githubusercontent.com/u/39568345?v=4","gravatar_id":"","url":"https://api.github.com/users/nerves-hub","html_url":"https://github.com/nerves-hub","followers_url":"https://api.github.com/users/nerves-hub/followers","following_url":"https://api.github.com/users/nerves-hub/following{/other_user}","gists_url":"https://api.github.com/users/nerves-hub/gists{/gist_id}","starred_url":"https://api.github.com/users/nerves-hub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerves-hub/subscriptions","organizations_url":"https://api.github.com/users/nerves-hub/orgs","repos_url":"https://api.github.com/users/nerves-hub/repos","events_url":"https://api.github.com/users/nerves-hub/events{/privacy}","received_events_url":"https://api.github.com/users/nerves-hub/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nerves-hub/nerves_hub","description":"NervesHub client","fork":false,"url":"https://api.github.com/repos/nerves-hub/nerves_hub","forks_url":"https://api.github.com/repos/nerves-hub/nerves_hub/forks","keys_url":"https://api.github.com/repos/nerves-hub/nerves_hub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nerves-hub/nerves_hub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nerves-hub/nerves_hub/teams","hooks_url":"https://api.github.com/repos/nerves-hub/nerves_hub/hooks","issue_events_url":"https://api.github.com/repos/nerves-hub/nerves_hub/issues/events{/number}","events_url":"https://api.github.com/repos/nerves-hub/nerves_hub/events","assignees_url":"https://api.github.com/repos/nerves-hub/nerves_hub/assignees{/user}","branches_url":"https://api.github.com/repos/nerves-hub/nerves_hub/branches{/branch}","tags_url":"https://api.github.com/repos/nerves-hub/nerves_hub/tags","blobs_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/refs{/sha}","trees_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nerves-hub/nerves_hub/statuses/{sha}","languages_url":"https://api.github.com/repos/nerves-hub/nerves_hub/languages","stargazers_url":"https://api.github.com/repos/nerves-hub/nerves_hub/stargazers","contributors_url":"https://api.github.com/repos/nerves-hub/nerves_hub/contributors","subscribers_url":"https://api.github.com/repos/nerves-hub/nerves_hub/subscribers","subscription_url":"https://api.github.com/repos/nerves-hub/nerves_hub/subscription","commits_url":"https://api.github.com/repos/nerves-hub/nerves_hub/commits{/sha}","git_commits_url":"https://api.github.com/repos/nerves-hub/nerves_hub/git/commits{/sha}","comments_url":"https://api.github.com/repos/nerves-hub/nerves_hub/comments{/number}","issue_comment_url":"https://api.github.com/repos/nerves-hub/nerves_hub/issues/comments{/number}","contents_url":"https://api.github.com/repos/nerves-hub/nerves_hub/contents/{+path}","compare_url":"https://api.github.com/repos/nerves-hub/nerves_hub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nerves-hub/nerves_hub/merges","archive_url":"https://api.github.com/repos/nerves-hub/nerves_hub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nerves-hub/nerves_hub/downloads","issues_url":"https://api.github.com/repos/nerves-hub/nerves_hub/issues{/number}","pulls_url":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls{/number}","milestones_url":"https://api.github.com/repos/nerves-hub/nerves_hub/milestones{/number}","notifications_url":"https://api.github.com/repos/nerves-hub/nerves_hub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nerves-hub/nerves_hub/labels{/name}","releases_url":"https://api.github.com/repos/nerves-hub/nerves_hub/releases{/id}","deployments_url":"https://api.github.com/repos/nerves-hub/nerves_hub/deployments","created_at":"2018-05-24T01:42:17Z","updated_at":"2018-10-03T21:25:58Z","pushed_at":"2018-10-02T19:05:20Z","git_url":"git://github.com/nerves-hub/nerves_hub.git","ssh_url":"git@github.com:nerves-hub/nerves_hub.git","clone_url":"https://github.com/nerves-hub/nerves_hub.git","svn_url":"https://github.com/nerves-hub/nerves_hub","homepage":"","size":107,"stargazers_count":21,"watchers_count":21,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":3,"open_issues":6,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/19"},"html":{"href":"https://github.com/nerves-hub/nerves_hub/pull/19"},"issue":{"href":"https://api.github.com/repos/nerves-hub/nerves_hub/issues/19"},"comments":{"href":"https://api.github.com/repos/nerves-hub/nerves_hub/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nerves-hub/nerves_hub/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/nerves-hub/nerves_hub/statuses/ee8a610c73a37e64ce9fff9a4e652e26ec99723d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ConnorRigby"}}