{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/Portus/pulls/comments/62982357","id":62982357,"diff_hunk":"@@ -0,0 +1,82 @@\n+require \"rails_helper\"\n+\n+RSpec.describe WebhookHeadersController, type: :controller do\n+  let(:valid_session) { {} }\n+  let(:registry) { create(:registry) }\n+  let(:user) { create(:user) }\n+  let(:viewer) { create(:user) }\n+  let(:contributor) { create(:user) }\n+  let(:owner) { create(:user) }\n+  let(:team) do\n+    create(:team,\n+           owners:       [owner],\n+           viewers:      [user, viewer],\n+           contributors: [contributor])\n+  end\n+  let(:namespace) do\n+    create(\n+      :namespace,\n+      team:        team,\n+      description: \"short test description\",\n+      registry:    registry)\n+  end\n+  let(:webhook) { create(:webhook, namespace: namespace) }\n+\n+  before :each do\n+    # trigger creation of registry\n+    registry","path":"spec/controllers/webhook_headers_controller_spec.rb","position":27,"original_position":27,"commit_id":"ba95bb594eb949360ecf7027f7e94e98193ce99d","original_commit_id":"ba95bb594eb949360ecf7027f7e94e98193ce99d","user":{"login":"mssola","id":767943,"avatar_url":"https://avatars.githubusercontent.com/u/767943?v=3","gravatar_id":"","url":"https://api.github.com/users/mssola","html_url":"https://github.com/mssola","followers_url":"https://api.github.com/users/mssola/followers","following_url":"https://api.github.com/users/mssola/following{/other_user}","gists_url":"https://api.github.com/users/mssola/gists{/gist_id}","starred_url":"https://api.github.com/users/mssola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mssola/subscriptions","organizations_url":"https://api.github.com/users/mssola/orgs","repos_url":"https://api.github.com/users/mssola/repos","events_url":"https://api.github.com/users/mssola/events{/privacy}","received_events_url":"https://api.github.com/users/mssola/received_events","type":"User","site_admin":false},"body":"Just don't :smile:. Simply create the registry with `let!` instead of `let` previously. The same should go for the rest of the variables defined in `let` blocks. For what I've seen in other places in our own tests, using `let` ends up with \"funny surprises\". For this, I prefer using `let!` as much as possible, even if it's slower than `let`.","created_at":"2016-05-12T08:30:28Z","updated_at":"2016-05-12T08:30:28Z","html_url":"https://github.com/SUSE/Portus/pull/823#discussion_r62982357","pull_request_url":"https://api.github.com/repos/SUSE/Portus/pulls/823","_links":{"self":{"href":"https://api.github.com/repos/SUSE/Portus/pulls/comments/62982357"},"html":{"href":"https://github.com/SUSE/Portus/pull/823#discussion_r62982357"},"pull_request":{"href":"https://api.github.com/repos/SUSE/Portus/pulls/823"}}},"pull_request":{"url":"https://api.github.com/repos/SUSE/Portus/pulls/823","id":66806952,"html_url":"https://github.com/SUSE/Portus/pull/823","diff_url":"https://github.com/SUSE/Portus/pull/823.diff","patch_url":"https://github.com/SUSE/Portus/pull/823.patch","issue_url":"https://api.github.com/repos/SUSE/Portus/issues/823","number":823,"state":"open","locked":false,"title":"Webhook integration","user":{"login":"tboerger","id":156964,"avatar_url":"https://avatars.githubusercontent.com/u/156964?v=3","gravatar_id":"","url":"https://api.github.com/users/tboerger","html_url":"https://github.com/tboerger","followers_url":"https://api.github.com/users/tboerger/followers","following_url":"https://api.github.com/users/tboerger/following{/other_user}","gists_url":"https://api.github.com/users/tboerger/gists{/gist_id}","starred_url":"https://api.github.com/users/tboerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tboerger/subscriptions","organizations_url":"https://api.github.com/users/tboerger/orgs","repos_url":"https://api.github.com/users/tboerger/repos","events_url":"https://api.github.com/users/tboerger/events{/privacy}","received_events_url":"https://api.github.com/users/tboerger/received_events","type":"User","site_admin":false},"body":"**This is a replacement for https://github.com/SUSE/Portus/pull/814 so that somebody else can takeover this feature**\r\n\r\nI have started to integrate the webhook implementation, this PR is work in progress, I just created this to gather feedback as soon as possible.\r\n\r\nThings that still needs to be done:\r\n\r\n* [x] Backend that triggers the defined webhooks on event\r\n* [x] Fix activities for deleted webhooks\r\n* [x] Webhook delete button fixed\r\n* [x] Listing of webhook deliveries\r\n* [x] Retrigger webhook functionality\r\n* [x] Write full specs","created_at":"2016-04-18T07:03:40Z","updated_at":"2016-05-12T08:30:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33140c02b00bcba8c7568fe469b6d153d04ac0cc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/Portus/pulls/823/commits","review_comments_url":"https://api.github.com/repos/SUSE/Portus/pulls/823/comments","review_comment_url":"https://api.github.com/repos/SUSE/Portus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SUSE/Portus/issues/823/comments","statuses_url":"https://api.github.com/repos/SUSE/Portus/statuses/ba95bb594eb949360ecf7027f7e94e98193ce99d","head":{"label":"SUSE:feature/webhooks","ref":"feature/webhooks","sha":"ba95bb594eb949360ecf7027f7e94e98193ce99d","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":33866783,"name":"Portus","full_name":"SUSE/Portus","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/Portus","description":"Authorization service and frontend for Docker registry (v2)","fork":false,"url":"https://api.github.com/repos/SUSE/Portus","forks_url":"https://api.github.com/repos/SUSE/Portus/forks","keys_url":"https://api.github.com/repos/SUSE/Portus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/Portus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/Portus/teams","hooks_url":"https://api.github.com/repos/SUSE/Portus/hooks","issue_events_url":"https://api.github.com/repos/SUSE/Portus/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/Portus/events","assignees_url":"https://api.github.com/repos/SUSE/Portus/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/Portus/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/Portus/tags","blobs_url":"https://api.github.com/repos/SUSE/Portus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/Portus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/Portus/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/Portus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/Portus/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/Portus/languages","stargazers_url":"https://api.github.com/repos/SUSE/Portus/stargazers","contributors_url":"https://api.github.com/repos/SUSE/Portus/contributors","subscribers_url":"https://api.github.com/repos/SUSE/Portus/subscribers","subscription_url":"https://api.github.com/repos/SUSE/Portus/subscription","commits_url":"https://api.github.com/repos/SUSE/Portus/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/Portus/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/Portus/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/Portus/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/Portus/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/Portus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/Portus/merges","archive_url":"https://api.github.com/repos/SUSE/Portus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/Portus/downloads","issues_url":"https://api.github.com/repos/SUSE/Portus/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/Portus/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/Portus/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/Portus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/Portus/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/Portus/releases{/id}","deployments_url":"https://api.github.com/repos/SUSE/Portus/deployments","created_at":"2015-04-13T12:18:20Z","updated_at":"2016-05-11T13:08:48Z","pushed_at":"2016-05-11T14:04:40Z","git_url":"git://github.com/SUSE/Portus.git","ssh_url":"git@github.com:SUSE/Portus.git","clone_url":"https://github.com/SUSE/Portus.git","svn_url":"https://github.com/SUSE/Portus","homepage":"http://port.us.org/","size":19463,"stargazers_count":767,"watchers_count":767,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":138,"mirror_url":null,"open_issues_count":111,"forks":138,"open_issues":111,"watchers":767,"default_branch":"master"}},"base":{"label":"SUSE:master","ref":"master","sha":"8d075c06c16f98d281083c499b84916fdd1e232a","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":33866783,"name":"Portus","full_name":"SUSE/Portus","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/Portus","description":"Authorization service and frontend for Docker registry (v2)","fork":false,"url":"https://api.github.com/repos/SUSE/Portus","forks_url":"https://api.github.com/repos/SUSE/Portus/forks","keys_url":"https://api.github.com/repos/SUSE/Portus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/Portus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/Portus/teams","hooks_url":"https://api.github.com/repos/SUSE/Portus/hooks","issue_events_url":"https://api.github.com/repos/SUSE/Portus/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/Portus/events","assignees_url":"https://api.github.com/repos/SUSE/Portus/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/Portus/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/Portus/tags","blobs_url":"https://api.github.com/repos/SUSE/Portus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/Portus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/Portus/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/Portus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/Portus/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/Portus/languages","stargazers_url":"https://api.github.com/repos/SUSE/Portus/stargazers","contributors_url":"https://api.github.com/repos/SUSE/Portus/contributors","subscribers_url":"https://api.github.com/repos/SUSE/Portus/subscribers","subscription_url":"https://api.github.com/repos/SUSE/Portus/subscription","commits_url":"https://api.github.com/repos/SUSE/Portus/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/Portus/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/Portus/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/Portus/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/Portus/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/Portus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/Portus/merges","archive_url":"https://api.github.com/repos/SUSE/Portus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/Portus/downloads","issues_url":"https://api.github.com/repos/SUSE/Portus/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/Portus/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/Portus/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/Portus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/Portus/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/Portus/releases{/id}","deployments_url":"https://api.github.com/repos/SUSE/Portus/deployments","created_at":"2015-04-13T12:18:20Z","updated_at":"2016-05-11T13:08:48Z","pushed_at":"2016-05-11T14:04:40Z","git_url":"git://github.com/SUSE/Portus.git","ssh_url":"git@github.com:SUSE/Portus.git","clone_url":"https://github.com/SUSE/Portus.git","svn_url":"https://github.com/SUSE/Portus","homepage":"http://port.us.org/","size":19463,"stargazers_count":767,"watchers_count":767,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":138,"mirror_url":null,"open_issues_count":111,"forks":138,"open_issues":111,"watchers":767,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/Portus/pulls/823"},"html":{"href":"https://github.com/SUSE/Portus/pull/823"},"issue":{"href":"https://api.github.com/repos/SUSE/Portus/issues/823"},"comments":{"href":"https://api.github.com/repos/SUSE/Portus/issues/823/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/Portus/pulls/823/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/Portus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SUSE/Portus/pulls/823/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/Portus/statuses/ba95bb594eb949360ecf7027f7e94e98193ce99d"}}}}