GitHub PullRequestReviewCommentEvent at 2014-09-11 10:25:01
Repository: support-api
Actor: tekin
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/support-api/pulls/comments/17413898","id":17413898,"diff_hunk":"@@ -0,0 +1,44 @@\n+require 'rails_helper'\n+require 'time'\n+require 'support/requests/anonymous/deduplication_worker'\n+\n+describe \"de-duplication\" do\n+  it \"flags and removes duplicate service feedback from results\" do\n+    Timecop.travel Time.parse(\"2013-01-15 12:00:00\")\n+\n+    create(:service_feedback,\n+      service_satisfaction_rating: 5,\n+      details: \"this service is great\",\n+      slug: \"some-tx\",\n+      url: \"https://www.gov.uk/done/some-tx\"\n+    )\n+\n+    create(:service_feedback,\n+      service_satisfaction_rating: 3,\n+      details: \"this service is meh\",\n+      slug: \"some-tx\",\n+      url: \"https://www.gov.uk/done/some-tx\"\n+    )\n+\n+    Timecop.travel Time.parse(\"2013-01-15 12:00:01\")\n+\n+    create(:service_feedback,\n+      service_satisfaction_rating: 3,\n+      details: \"this service is meh\",\n+      slug: \"some-tx\",\n+      url: \"https://www.gov.uk/done/some-tx\"\n+    )\n+\n+    expect(Support::Requests::Anonymous::AnonymousContact.only_actionable.count).to eq(3)\n+\n+    # deduplicate\n+    Timecop.travel Time.parse(\"2013-01-16 00:30:00\")\n+    Support::Requests::Anonymous::DeduplicationWorker.start_deduplication_for_yesterday\n+\n+    expect(Support::Requests::Anonymous::AnonymousContact.only_actionable.count).to eq(2)","path":"spec/integration/deduplication_spec.rb","position":38,"original_position":38,"commit_id":"92432ae46c0ebcbdd1d198ef5b663957baf11fe4","original_commit_id":"92432ae46c0ebcbdd1d198ef5b663957baf11fe4","user":{"login":"tekin","id":3687,"avatar_url":"https://avatars.githubusercontent.com/u/3687?v=2","gravatar_id":"73f812133e01dac8eb9b67746fe27393","url":"https://api.github.com/users/tekin","html_url":"https://github.com/tekin","followers_url":"https://api.github.com/users/tekin/followers","following_url":"https://api.github.com/users/tekin/following{/other_user}","gists_url":"https://api.github.com/users/tekin/gists{/gist_id}","starred_url":"https://api.github.com/users/tekin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tekin/subscriptions","organizations_url":"https://api.github.com/users/tekin/orgs","repos_url":"https://api.github.com/users/tekin/repos","events_url":"https://api.github.com/users/tekin/events{/privacy}","received_events_url":"https://api.github.com/users/tekin/received_events","type":"User","site_admin":false},"body":"I would say it's also worth verifying the expected two bits of feedback are present.","created_at":"2014-09-11T10:25:01Z","updated_at":"2014-09-11T10:25:01Z","html_url":"https://github.com/alphagov/support-api/pull/11#discussion_r17413898","pull_request_url":"https://api.github.com/repos/alphagov/support-api/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/alphagov/support-api/pulls/comments/17413898"},"html":{"href":"https://github.com/alphagov/support-api/pull/11#discussion_r17413898"},"pull_request":{"href":"https://api.github.com/repos/alphagov/support-api/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/support-api/pulls/11","id":20726452,"html_url":"https://github.com/alphagov/support-api/pull/11","diff_url":"https://github.com/alphagov/support-api/pull/11.diff","patch_url":"https://github.com/alphagov/support-api/pull/11.patch","issue_url":"https://api.github.com/repos/alphagov/support-api/issues/11","number":11,"state":"open","locked":false,"title":"Move deduplication across from support","user":{"login":"benilovj","id":23801,"avatar_url":"https://avatars.githubusercontent.com/u/23801?v=2","gravatar_id":"4c204de448ddb0150beca236c591d240","url":"https://api.github.com/users/benilovj","html_url":"https://github.com/benilovj","followers_url":"https://api.github.com/users/benilovj/followers","following_url":"https://api.github.com/users/benilovj/following{/other_user}","gists_url":"https://api.github.com/users/benilovj/gists{/gist_id}","starred_url":"https://api.github.com/users/benilovj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benilovj/subscriptions","organizations_url":"https://api.github.com/users/benilovj/orgs","repos_url":"https://api.github.com/users/benilovj/repos","events_url":"https://api.github.com/users/benilovj/events{/privacy}","received_events_url":"https://api.github.com/users/benilovj/received_events","type":"User","site_admin":false},"body":"Anonymous feedback coming through the user satisfaction\r\nand report-a-problem mechanisms is sometimes submitted twice. While\r\nthere are browser-side mechanisms to prevent double submissions, they can't\r\nbe prevented entirely. This change enables running cron tasks that remove duplicates.\r\n\r\nThe nightly deduplication functionality currently exists in the `support` app, but moved here as part of the app split and will be removed from `support` when this change is live. \r\n\r\nThis PR also adds a worker for frequent deduping (every 5 minutes) so that today's feedback is deduped as it comes in. In theory, that makes the nightly deduping unnecessary but the nightly job is still there to sweep up any dupes in case the frequently run worker didn't run successfully at the specified time (eg due to MySQL issues).","created_at":"2014-09-04T07:32:37Z","updated_at":"2014-09-11T10:25:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5fdd3cdc0c7b70c25395465c1a598df42855327e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/support-api/pulls/11/commits","review_comments_url":"https://api.github.com/repos/alphagov/support-api/pulls/11/comments","review_comment_url":"https://api.github.com/repos/alphagov/support-api/pulls/comments/{number}","comments_url":"https://api.github.com/repos/alphagov/support-api/issues/11/comments","statuses_url":"https://api.github.com/repos/alphagov/support-api/statuses/92432ae46c0ebcbdd1d198ef5b663957baf11fe4","head":{"label":"alphagov:move-deduplication-across-from-support","ref":"move-deduplication-across-from-support","sha":"92432ae46c0ebcbdd1d198ef5b663957baf11fe4","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=2","gravatar_id":"5618b843830194a2475a6e48823f7455","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":20967866,"name":"support-api","full_name":"alphagov/support-api","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=2","gravatar_id":"5618b843830194a2475a6e48823f7455","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/support-api","description":"An API for processing GOV.UK named requests and anonymous feedback","fork":false,"url":"https://api.github.com/repos/alphagov/support-api","forks_url":"https://api.github.com/repos/alphagov/support-api/forks","keys_url":"https://api.github.com/repos/alphagov/support-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/support-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/support-api/teams","hooks_url":"https://api.github.com/repos/alphagov/support-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/support-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/support-api/events","assignees_url":"https://api.github.com/repos/alphagov/support-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/support-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/support-api/tags","blobs_url":"https://api.github.com/repos/alphagov/support-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/support-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/support-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/support-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/support-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/support-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/support-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/support-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/support-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/support-api/subscription","commits_url":"https://api.github.com/repos/alphagov/support-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/support-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/support-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/support-api/issues/comments/{number}","contents_url":"https://api.github.com/repos/alphagov/support-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/support-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/support-api/merges","archive_url":"https://api.github.com/repos/alphagov/support-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/support-api/downloads","issues_url":"https://api.github.com/repos/alphagov/support-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/support-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/support-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/support-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/support-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/support-api/releases{/id}","created_at":"2014-06-18T15:43:38Z","updated_at":"2014-09-02T10:38:15Z","pushed_at":"2014-09-11T10:08:43Z","git_url":"git://github.com/alphagov/support-api.git","ssh_url":"git@github.com:alphagov/support-api.git","clone_url":"https://github.com/alphagov/support-api.git","svn_url":"https://github.com/alphagov/support-api","homepage":"","size":868,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"fd640cdaa07c7fe65fdba6c9f2b556a452cacc28","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=2","gravatar_id":"5618b843830194a2475a6e48823f7455","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":20967866,"name":"support-api","full_name":"alphagov/support-api","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=2","gravatar_id":"5618b843830194a2475a6e48823f7455","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/support-api","description":"An API for processing GOV.UK named requests and anonymous feedback","fork":false,"url":"https://api.github.com/repos/alphagov/support-api","forks_url":"https://api.github.com/repos/alphagov/support-api/forks","keys_url":"https://api.github.com/repos/alphagov/support-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/support-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/support-api/teams","hooks_url":"https://api.github.com/repos/alphagov/support-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/support-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/support-api/events","assignees_url":"https://api.github.com/repos/alphagov/support-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/support-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/support-api/tags","blobs_url":"https://api.github.com/repos/alphagov/support-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/support-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/support-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/support-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/support-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/support-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/support-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/support-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/support-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/support-api/subscription","commits_url":"https://api.github.com/repos/alphagov/support-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/support-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/support-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/support-api/issues/comments/{number}","contents_url":"https://api.github.com/repos/alphagov/support-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/support-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/support-api/merges","archive_url":"https://api.github.com/repos/alphagov/support-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/support-api/downloads","issues_url":"https://api.github.com/repos/alphagov/support-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/support-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/support-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/support-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/support-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/support-api/releases{/id}","created_at":"2014-06-18T15:43:38Z","updated_at":"2014-09-02T10:38:15Z","pushed_at":"2014-09-11T10:08:43Z","git_url":"git://github.com/alphagov/support-api.git","ssh_url":"git@github.com:alphagov/support-api.git","clone_url":"https://github.com/alphagov/support-api.git","svn_url":"https://github.com/alphagov/support-api","homepage":"","size":868,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/support-api/pulls/11"},"html":{"href":"https://github.com/alphagov/support-api/pull/11"},"issue":{"href":"https://api.github.com/repos/alphagov/support-api/issues/11"},"comments":{"href":"https://api.github.com/repos/alphagov/support-api/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/support-api/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/support-api/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/alphagov/support-api/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/support-api/statuses/92432ae46c0ebcbdd1d198ef5b663957baf11fe4"}}}}