{"action":"created","comment":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/comments/76433260","id":76433260,"diff_hunk":"@@ -153,13 +150,19 @@ func (m *HookManager) doRunHook(task *state.Task, tomb *tomb.Tomb) error {\n \n \thandler := handlers[0]\n \n+\tcontext, err := m.activeHandlers.addHandler(handler)","path":"overlord/hookstate/hookmgr.go","position":66,"original_position":66,"commit_id":"7b19c44c78ed2abccdbe9750dc604cf2d863f85b","original_commit_id":"7b19c44c78ed2abccdbe9750dc604cf2d863f85b","user":{"login":"niemeyer","id":378683,"avatar_url":"https://avatars.githubusercontent.com/u/378683?v=3","gravatar_id":"","url":"https://api.github.com/users/niemeyer","html_url":"https://github.com/niemeyer","followers_url":"https://api.github.com/users/niemeyer/followers","following_url":"https://api.github.com/users/niemeyer/following{/other_user}","gists_url":"https://api.github.com/users/niemeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/niemeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niemeyer/subscriptions","organizations_url":"https://api.github.com/users/niemeyer/orgs","repos_url":"https://api.github.com/users/niemeyer/repos","events_url":"https://api.github.com/users/niemeyer/events{/privacy}","received_events_url":"https://api.github.com/users/niemeyer/received_events","type":"User","site_admin":false},"body":"There's a bit of terminology confusion here which would be good to avoid. What we have here is not the context. It's the context ID, and the actual context is in line 142 above:\r\n```\r\nhandlers := m.repository.generateHandlers(&Context{task: task, setup: setup})\r\n```\r\nThat value being created inline and passed as a parameter is the actual context, and we should probably get it with NewContext(task, setup) so it has a chance to generate its own ID internally. We can then:\r\n```\r\nm.context[context.ID()] = context\r\n```\r\nSo, map of context, a context ID, and the context.","created_at":"2016-08-26T14:59:42Z","updated_at":"2016-08-26T14:59:42Z","html_url":"https://github.com/snapcore/snapd/pull/1718#discussion_r76433260","pull_request_url":"https://api.github.com/repos/snapcore/snapd/pulls/1718","_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments/76433260"},"html":{"href":"https://github.com/snapcore/snapd/pull/1718#discussion_r76433260"},"pull_request":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1718"}}},"pull_request":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/1718","id":82234024,"html_url":"https://github.com/snapcore/snapd/pull/1718","diff_url":"https://github.com/snapcore/snapd/pull/1718.diff","patch_url":"https://github.com/snapcore/snapd/pull/1718.patch","issue_url":"https://api.github.com/repos/snapcore/snapd/issues/1718","number":1718,"state":"open","locked":false,"title":"daemon,overlord: add subcommand handling to snapctl.","user":{"login":"kyrofa","id":946674,"avatar_url":"https://avatars.githubusercontent.com/u/946674?v=3","gravatar_id":"","url":"https://api.github.com/users/kyrofa","html_url":"https://github.com/kyrofa","followers_url":"https://api.github.com/users/kyrofa/followers","following_url":"https://api.github.com/users/kyrofa/following{/other_user}","gists_url":"https://api.github.com/users/kyrofa/gists{/gist_id}","starred_url":"https://api.github.com/users/kyrofa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyrofa/subscriptions","organizations_url":"https://api.github.com/users/kyrofa/orgs","repos_url":"https://api.github.com/users/kyrofa/repos","events_url":"https://api.github.com/users/kyrofa/events{/privacy}","received_events_url":"https://api.github.com/users/kyrofa/received_events","type":"User","site_admin":false},"body":"Make some more progress on LP: [#1586465](https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1586465) by adding some more logic and subcommands to `snapctl`. Stub out initial `set` command. This should allow other subcommands to be easily added (e.g. for interface hooks).","created_at":"2016-08-22T17:52:59Z","updated_at":"2016-08-26T14:59:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9876bdaac653c764d41081471692a0720d24f5d6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/snapcore/snapd/pulls/1718/commits","review_comments_url":"https://api.github.com/repos/snapcore/snapd/pulls/1718/comments","review_comment_url":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snapcore/snapd/issues/1718/comments","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/7b19c44c78ed2abccdbe9750dc604cf2d863f85b","head":{"label":"kyrofa:feature/1586465/hookmanager_snapctl","ref":"feature/1586465/hookmanager_snapctl","sha":"7b19c44c78ed2abccdbe9750dc604cf2d863f85b","user":{"login":"kyrofa","id":946674,"avatar_url":"https://avatars.githubusercontent.com/u/946674?v=3","gravatar_id":"","url":"https://api.github.com/users/kyrofa","html_url":"https://github.com/kyrofa","followers_url":"https://api.github.com/users/kyrofa/followers","following_url":"https://api.github.com/users/kyrofa/following{/other_user}","gists_url":"https://api.github.com/users/kyrofa/gists{/gist_id}","starred_url":"https://api.github.com/users/kyrofa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyrofa/subscriptions","organizations_url":"https://api.github.com/users/kyrofa/orgs","repos_url":"https://api.github.com/users/kyrofa/repos","events_url":"https://api.github.com/users/kyrofa/events{/privacy}","received_events_url":"https://api.github.com/users/kyrofa/received_events","type":"User","site_admin":false},"repo":{"id":59755219,"name":"snapd","full_name":"kyrofa/snapd","owner":{"login":"kyrofa","id":946674,"avatar_url":"https://avatars.githubusercontent.com/u/946674?v=3","gravatar_id":"","url":"https://api.github.com/users/kyrofa","html_url":"https://github.com/kyrofa","followers_url":"https://api.github.com/users/kyrofa/followers","following_url":"https://api.github.com/users/kyrofa/following{/other_user}","gists_url":"https://api.github.com/users/kyrofa/gists{/gist_id}","starred_url":"https://api.github.com/users/kyrofa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyrofa/subscriptions","organizations_url":"https://api.github.com/users/kyrofa/orgs","repos_url":"https://api.github.com/users/kyrofa/repos","events_url":"https://api.github.com/users/kyrofa/events{/privacy}","received_events_url":"https://api.github.com/users/kyrofa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kyrofa/snapd","description":"The snapd and snap tools enable systems to work with .snap files.","fork":true,"url":"https://api.github.com/repos/kyrofa/snapd","forks_url":"https://api.github.com/repos/kyrofa/snapd/forks","keys_url":"https://api.github.com/repos/kyrofa/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kyrofa/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kyrofa/snapd/teams","hooks_url":"https://api.github.com/repos/kyrofa/snapd/hooks","issue_events_url":"https://api.github.com/repos/kyrofa/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/kyrofa/snapd/events","assignees_url":"https://api.github.com/repos/kyrofa/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/kyrofa/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/kyrofa/snapd/tags","blobs_url":"https://api.github.com/repos/kyrofa/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kyrofa/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kyrofa/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/kyrofa/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kyrofa/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/kyrofa/snapd/languages","stargazers_url":"https://api.github.com/repos/kyrofa/snapd/stargazers","contributors_url":"https://api.github.com/repos/kyrofa/snapd/contributors","subscribers_url":"https://api.github.com/repos/kyrofa/snapd/subscribers","subscription_url":"https://api.github.com/repos/kyrofa/snapd/subscription","commits_url":"https://api.github.com/repos/kyrofa/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/kyrofa/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/kyrofa/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/kyrofa/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/kyrofa/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/kyrofa/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kyrofa/snapd/merges","archive_url":"https://api.github.com/repos/kyrofa/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kyrofa/snapd/downloads","issues_url":"https://api.github.com/repos/kyrofa/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/kyrofa/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/kyrofa/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/kyrofa/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kyrofa/snapd/labels{/name}","releases_url":"https://api.github.com/repos/kyrofa/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/kyrofa/snapd/deployments","created_at":"2016-05-26T14:05:43Z","updated_at":"2016-05-26T14:05:46Z","pushed_at":"2016-08-26T02:02:09Z","git_url":"git://github.com/kyrofa/snapd.git","ssh_url":"git@github.com:kyrofa/snapd.git","clone_url":"https://github.com/kyrofa/snapd.git","svn_url":"https://github.com/kyrofa/snapd","homepage":"","size":34495,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"snapcore:master","ref":"master","sha":"0e05068fc99995251a04810e74c536a4966b383e","user":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"repo":{"id":44672744,"name":"snapd","full_name":"snapcore/snapd","owner":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/snapcore/snapd","description":"The snapd and snap tools enable systems to work with .snap files.","fork":false,"url":"https://api.github.com/repos/snapcore/snapd","forks_url":"https://api.github.com/repos/snapcore/snapd/forks","keys_url":"https://api.github.com/repos/snapcore/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snapcore/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snapcore/snapd/teams","hooks_url":"https://api.github.com/repos/snapcore/snapd/hooks","issue_events_url":"https://api.github.com/repos/snapcore/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/snapcore/snapd/events","assignees_url":"https://api.github.com/repos/snapcore/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/snapcore/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/snapcore/snapd/tags","blobs_url":"https://api.github.com/repos/snapcore/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snapcore/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snapcore/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/snapcore/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/snapcore/snapd/languages","stargazers_url":"https://api.github.com/repos/snapcore/snapd/stargazers","contributors_url":"https://api.github.com/repos/snapcore/snapd/contributors","subscribers_url":"https://api.github.com/repos/snapcore/snapd/subscribers","subscription_url":"https://api.github.com/repos/snapcore/snapd/subscription","commits_url":"https://api.github.com/repos/snapcore/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/snapcore/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/snapcore/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/snapcore/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/snapcore/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/snapcore/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snapcore/snapd/merges","archive_url":"https://api.github.com/repos/snapcore/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snapcore/snapd/downloads","issues_url":"https://api.github.com/repos/snapcore/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/snapcore/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/snapcore/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/snapcore/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snapcore/snapd/labels{/name}","releases_url":"https://api.github.com/repos/snapcore/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/snapcore/snapd/deployments","created_at":"2015-10-21T11:51:46Z","updated_at":"2016-08-18T19:55:32Z","pushed_at":"2016-08-26T14:23:34Z","git_url":"git://github.com/snapcore/snapd.git","ssh_url":"git@github.com:snapcore/snapd.git","clone_url":"https://github.com/snapcore/snapd.git","svn_url":"https://github.com/snapcore/snapd","homepage":"","size":36340,"stargazers_count":378,"watchers_count":378,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":96,"mirror_url":null,"open_issues_count":25,"forks":96,"open_issues":25,"watchers":378,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1718"},"html":{"href":"https://github.com/snapcore/snapd/pull/1718"},"issue":{"href":"https://api.github.com/repos/snapcore/snapd/issues/1718"},"comments":{"href":"https://api.github.com/repos/snapcore/snapd/issues/1718/comments"},"review_comments":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1718/comments"},"review_comment":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1718/commits"},"statuses":{"href":"https://api.github.com/repos/snapcore/snapd/statuses/7b19c44c78ed2abccdbe9750dc604cf2d863f85b"}}}}
{"actor":{"display_login":"niemeyer"}}