{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/lantern/pulls/comments/58505631","id":58505631,"diff_hunk":"@@ -40,41 +40,99 @@ describe('#calculateRealtimeIndices', () => {\n \n describe('#calculateIndices', () => {\n \n-  beforeEach(()=> {\n-    process.env.ES_INDEX_ROOT = ES_INDEX;\n+  it('should return an explicit list of daily indices when the difference between from and to is less than 28 days', () => {\n+    const query = {\n+      dateFrom: ('2015-01-01'),\n+      dateTo: ('2015-01-15')\n+    }\n+\n+    const mFrom = moment(query.dateFrom);\n+    const mTo = moment(query.dateTo);\n+\n+    const start = mFrom.clone();\n+    const indices = [];\n+    while(start <= mTo) {\n+      indices.push(ES_INDEX + start.format(\"YYYY-MM-DD\"))\n+      start.add(1, 'day');\n+    }","path":"test/utils/calculateIndices.spec.js","position":34,"original_position":34,"commit_id":"e9ec7115133d8c284251cd8faf67345710e47c4f","original_commit_id":"e9ec7115133d8c284251cd8faf67345710e47c4f","user":{"login":"jonathan-best","id":1691942,"avatar_url":"https://avatars.githubusercontent.com/u/1691942?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathan-best","html_url":"https://github.com/jonathan-best","followers_url":"https://api.github.com/users/jonathan-best/followers","following_url":"https://api.github.com/users/jonathan-best/following{/other_user}","gists_url":"https://api.github.com/users/jonathan-best/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathan-best/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathan-best/subscriptions","organizations_url":"https://api.github.com/users/jonathan-best/orgs","repos_url":"https://api.github.com/users/jonathan-best/repos","events_url":"https://api.github.com/users/jonathan-best/events{/privacy}","received_events_url":"https://api.github.com/users/jonathan-best/received_events","type":"User","site_admin":false},"body":"![jvedtqd](https://cloud.githubusercontent.com/assets/1691942/14276281/d281d088-fb15-11e5-9ddd-b9e7b2041a04.jpg)\r\n","created_at":"2016-04-05T09:05:32Z","updated_at":"2016-04-05T09:05:33Z","html_url":"https://github.com/Financial-Times/lantern/pull/599#discussion_r58505631","pull_request_url":"https://api.github.com/repos/Financial-Times/lantern/pulls/599","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/lantern/pulls/comments/58505631"},"html":{"href":"https://github.com/Financial-Times/lantern/pull/599#discussion_r58505631"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/lantern/pulls/599"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/lantern/pulls/599","id":65157303,"html_url":"https://github.com/Financial-Times/lantern/pull/599","diff_url":"https://github.com/Financial-Times/lantern/pull/599.diff","patch_url":"https://github.com/Financial-Times/lantern/pull/599.patch","issue_url":"https://api.github.com/repos/Financial-Times/lantern/issues/599","number":599,"state":"open","locked":false,"title":"better calculateIndices calculation","user":{"login":"radiodario","id":780409,"avatar_url":"https://avatars.githubusercontent.com/u/780409?v=3","gravatar_id":"","url":"https://api.github.com/users/radiodario","html_url":"https://github.com/radiodario","followers_url":"https://api.github.com/users/radiodario/followers","following_url":"https://api.github.com/users/radiodario/following{/other_user}","gists_url":"https://api.github.com/users/radiodario/gists{/gist_id}","starred_url":"https://api.github.com/users/radiodario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radiodario/subscriptions","organizations_url":"https://api.github.com/users/radiodario/orgs","repos_url":"https://api.github.com/users/radiodario/repos","events_url":"https://api.github.com/users/radiodario/events{/privacy}","received_events_url":"https://api.github.com/users/radiodario/received_events","type":"User","site_admin":false},"body":"doing it better. doing it right.","created_at":"2016-04-04T14:47:17Z","updated_at":"2016-04-05T09:05:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5fce502efae57a76ee0350b4b73d8053328248ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/lantern/pulls/599/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/lantern/pulls/599/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/lantern/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/lantern/issues/599/comments","statuses_url":"https://api.github.com/repos/Financial-Times/lantern/statuses/e9ec7115133d8c284251cd8faf67345710e47c4f","head":{"label":"Financial-Times:improve-calculate-indices","ref":"improve-calculate-indices","sha":"e9ec7115133d8c284251cd8faf67345710e47c4f","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":41102534,"name":"lantern","full_name":"Financial-Times/lantern","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/lantern","description":"Analytics for the discerning FT employee","fork":false,"url":"https://api.github.com/repos/Financial-Times/lantern","forks_url":"https://api.github.com/repos/Financial-Times/lantern/forks","keys_url":"https://api.github.com/repos/Financial-Times/lantern/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/lantern/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/lantern/teams","hooks_url":"https://api.github.com/repos/Financial-Times/lantern/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/lantern/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/lantern/events","assignees_url":"https://api.github.com/repos/Financial-Times/lantern/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/lantern/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/lantern/tags","blobs_url":"https://api.github.com/repos/Financial-Times/lantern/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/lantern/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/lantern/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/lantern/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/lantern/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/lantern/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/lantern/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/lantern/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/lantern/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/lantern/subscription","commits_url":"https://api.github.com/repos/Financial-Times/lantern/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/lantern/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/lantern/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/lantern/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/lantern/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/lantern/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/lantern/merges","archive_url":"https://api.github.com/repos/Financial-Times/lantern/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/lantern/downloads","issues_url":"https://api.github.com/repos/Financial-Times/lantern/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/lantern/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/lantern/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/lantern/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/lantern/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/lantern/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/lantern/deployments","created_at":"2015-08-20T15:10:25Z","updated_at":"2016-03-17T19:17:27Z","pushed_at":"2016-04-04T15:19:04Z","git_url":"git://github.com/Financial-Times/lantern.git","ssh_url":"git@github.com:Financial-Times/lantern.git","clone_url":"https://github.com/Financial-Times/lantern.git","svn_url":"https://github.com/Financial-Times/lantern","homepage":null,"size":2582,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":5,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"bc046393932d8bef80ec1738fcd2f14c94ec2e64","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":41102534,"name":"lantern","full_name":"Financial-Times/lantern","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/lantern","description":"Analytics for the discerning FT employee","fork":false,"url":"https://api.github.com/repos/Financial-Times/lantern","forks_url":"https://api.github.com/repos/Financial-Times/lantern/forks","keys_url":"https://api.github.com/repos/Financial-Times/lantern/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/lantern/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/lantern/teams","hooks_url":"https://api.github.com/repos/Financial-Times/lantern/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/lantern/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/lantern/events","assignees_url":"https://api.github.com/repos/Financial-Times/lantern/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/lantern/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/lantern/tags","blobs_url":"https://api.github.com/repos/Financial-Times/lantern/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/lantern/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/lantern/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/lantern/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/lantern/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/lantern/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/lantern/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/lantern/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/lantern/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/lantern/subscription","commits_url":"https://api.github.com/repos/Financial-Times/lantern/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/lantern/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/lantern/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/lantern/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/lantern/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/lantern/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/lantern/merges","archive_url":"https://api.github.com/repos/Financial-Times/lantern/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/lantern/downloads","issues_url":"https://api.github.com/repos/Financial-Times/lantern/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/lantern/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/lantern/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/lantern/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/lantern/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/lantern/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/lantern/deployments","created_at":"2015-08-20T15:10:25Z","updated_at":"2016-03-17T19:17:27Z","pushed_at":"2016-04-04T15:19:04Z","git_url":"git://github.com/Financial-Times/lantern.git","ssh_url":"git@github.com:Financial-Times/lantern.git","clone_url":"https://github.com/Financial-Times/lantern.git","svn_url":"https://github.com/Financial-Times/lantern","homepage":null,"size":2582,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/lantern/pulls/599"},"html":{"href":"https://github.com/Financial-Times/lantern/pull/599"},"issue":{"href":"https://api.github.com/repos/Financial-Times/lantern/issues/599"},"comments":{"href":"https://api.github.com/repos/Financial-Times/lantern/issues/599/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/lantern/pulls/599/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/lantern/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/lantern/pulls/599/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/lantern/statuses/e9ec7115133d8c284251cd8faf67345710e47c4f"}}}}