{"action":"created","comment":{"url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/comments/213857135","pull_request_review_id":150780604,"id":213857135,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzg1NzEzNQ==","diff_hunk":"@@ -146,3 +146,60 @@ func VersionPrefix(query *datastore.Query, fieldName, versionPrefix string, desc\n \t\tFilter(fieldName+\" >=\", fmt.Sprintf(\"%s.\", versionPrefix)).\n \t\tFilter(fieldName+\" <=\", fmt.Sprintf(\"%s.%c\", versionPrefix, '9'+1))\n }\n+\n+// GetCompleteRunSHAs returns an array of the SHA[0:10] for runs that\n+// exists for all initially-loaded browser names (see GetDefaultBrowserNames),\n+// ordered by most-recent.\n+func GetCompleteRunSHAs(ctx context.Context, from, to *time.Time, limit *int) (shas []string, err error) {\n+\tquery := datastore.\n+\t\tNewQuery(\"TestRun\").\n+\t\tOrder(\"-TimeStart\")\n+\n+\t// TODO(lukebjerring): Pass in products.\n+\tproducts := GetDefaultProducts()\n+\n+\tif from != nil {\n+\t\tquery = query.Filter(\"TimeStart >=\", *from)\n+\t}\n+\tif to != nil {\n+\t\tquery = query.Filter(\"TimeStart <\", *to)\n+\t}\n+\n+\tbySHA := make(map[string]mapset.Set)\n+\tdone := mapset.NewSet()\n+\tit := query.Run(ctx)\n+\tfor {\n+\t\tvar testRun TestRun\n+\t\tvar matchingProduct *ProductSpec\n+\t\t_, err := it.Next(&testRun)\n+\t\tif err == datastore.Done {\n+\t\t\tbreak\n+\t\t} else if err != nil {\n+\t\t\treturn nil, err\n+\t\t} else {\n+\t\t\tfor _, product := range products {\n+\t\t\t\tif product.Matches(testRun) {\n+\t\t\t\t\tmatchingProduct = &product\n+\t\t\t\t\tbreak\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t\tif matchingProduct == nil {\n+\t\t\tcontinue\n+\t\t}\n+\t\tset, ok := bySHA[testRun.Revision]\n+\t\tif !ok {\n+\t\t\tbySHA[testRun.Revision] = mapset.NewSetWith(*matchingProduct)","path":"shared/datastore.go","position":47,"original_position":47,"commit_id":"886bf0a724f85c15b2cd302aa8b68506dbc6b2e1","original_commit_id":"886bf0a724f85c15b2cd302aa8b68506dbc6b2e1","user":{"login":"Hexcles","id":1436812,"node_id":"MDQ6VXNlcjE0MzY4MTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1436812?v=4","gravatar_id":"","url":"https://api.github.com/users/Hexcles","html_url":"https://github.com/Hexcles","followers_url":"https://api.github.com/users/Hexcles/followers","following_url":"https://api.github.com/users/Hexcles/following{/other_user}","gists_url":"https://api.github.com/users/Hexcles/gists{/gist_id}","starred_url":"https://api.github.com/users/Hexcles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hexcles/subscriptions","organizations_url":"https://api.github.com/users/Hexcles/orgs","repos_url":"https://api.github.com/users/Hexcles/repos","events_url":"https://api.github.com/users/Hexcles/events{/privacy}","received_events_url":"https://api.github.com/users/Hexcles/received_events","type":"User","site_admin":false},"body":"I think we can simply store pointers in the mapset. Not sure if it'd be cheaper.","created_at":"2018-08-29T22:42:01Z","updated_at":"2018-08-29T22:46:07Z","html_url":"https://github.com/web-platform-tests/wpt.fyi/pull/489#discussion_r213857135","pull_request_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/489","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/comments/213857135"},"html":{"href":"https://github.com/web-platform-tests/wpt.fyi/pull/489#discussion_r213857135"},"pull_request":{"href":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/489"}}},"pull_request":{"url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/489","id":211864391,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExODY0Mzkx","html_url":"https://github.com/web-platform-tests/wpt.fyi/pull/489","diff_url":"https://github.com/web-platform-tests/wpt.fyi/pull/489.diff","patch_url":"https://github.com/web-platform-tests/wpt.fyi/pull/489.patch","issue_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues/489","number":489,"state":"open","locked":false,"title":"Refactor the way 'complete' is implemented","user":{"login":"lukebjerring","id":777956,"node_id":"MDQ6VXNlcjc3Nzk1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/777956?v=4","gravatar_id":"","url":"https://api.github.com/users/lukebjerring","html_url":"https://github.com/lukebjerring","followers_url":"https://api.github.com/users/lukebjerring/followers","following_url":"https://api.github.com/users/lukebjerring/following{/other_user}","gists_url":"https://api.github.com/users/lukebjerring/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebjerring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebjerring/subscriptions","organizations_url":"https://api.github.com/users/lukebjerring/orgs","repos_url":"https://api.github.com/users/lukebjerring/repos","events_url":"https://api.github.com/users/lukebjerring/events{/privacy}","received_events_url":"https://api.github.com/users/lukebjerring/received_events","type":"User","site_admin":false},"body":"## Description\r\nMigrates the `getCompleteSHAs` code to the shared codebase, and re-jigs it a bit, such that we grab the default products set, and find (any) product that matches the run. Since the default product specs are versionless, this is a no-op, intended to be followed up with actual changes in another PR.\r\n\r\n## Review Information\r\nIn particular, review the code for `ProductSpec.Matches(TestRun)`","created_at":"2018-08-29T19:39:35Z","updated_at":"2018-08-29T22:46:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a146a939ce3ef14c5bbd1e58267c746d50eb59c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/489/commits","review_comments_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/489/comments","review_comment_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues/489/comments","statuses_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/statuses/886bf0a724f85c15b2cd302aa8b68506dbc6b2e1","head":{"label":"web-platform-tests:complete","ref":"complete","sha":"886bf0a724f85c15b2cd302aa8b68506dbc6b2e1","user":{"login":"web-platform-tests","id":37226233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MjI2MjMz","avatar_url":"https://avatars0.githubusercontent.com/u/37226233?v=4","gravatar_id":"","url":"https://api.github.com/users/web-platform-tests","html_url":"https://github.com/web-platform-tests","followers_url":"https://api.github.com/users/web-platform-tests/followers","following_url":"https://api.github.com/users/web-platform-tests/following{/other_user}","gists_url":"https://api.github.com/users/web-platform-tests/gists{/gist_id}","starred_url":"https://api.github.com/users/web-platform-tests/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-platform-tests/subscriptions","organizations_url":"https://api.github.com/users/web-platform-tests/orgs","repos_url":"https://api.github.com/users/web-platform-tests/repos","events_url":"https://api.github.com/users/web-platform-tests/events{/privacy}","received_events_url":"https://api.github.com/users/web-platform-tests/received_events","type":"Organization","site_admin":false},"repo":{"id":128905889,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg5MDU4ODk=","name":"wpt.fyi","full_name":"web-platform-tests/wpt.fyi","owner":{"login":"web-platform-tests","id":37226233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MjI2MjMz","avatar_url":"https://avatars0.githubusercontent.com/u/37226233?v=4","gravatar_id":"","url":"https://api.github.com/users/web-platform-tests","html_url":"https://github.com/web-platform-tests","followers_url":"https://api.github.com/users/web-platform-tests/followers","following_url":"https://api.github.com/users/web-platform-tests/following{/other_user}","gists_url":"https://api.github.com/users/web-platform-tests/gists{/gist_id}","starred_url":"https://api.github.com/users/web-platform-tests/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-platform-tests/subscriptions","organizations_url":"https://api.github.com/users/web-platform-tests/orgs","repos_url":"https://api.github.com/users/web-platform-tests/repos","events_url":"https://api.github.com/users/web-platform-tests/events{/privacy}","received_events_url":"https://api.github.com/users/web-platform-tests/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/web-platform-tests/wpt.fyi","description":"web-platform-tests dashboard","fork":false,"url":"https://api.github.com/repos/web-platform-tests/wpt.fyi","forks_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/forks","keys_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/teams","hooks_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/hooks","issue_events_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues/events{/number}","events_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/events","assignees_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/assignees{/user}","branches_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/branches{/branch}","tags_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/tags","blobs_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/refs{/sha}","trees_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/statuses/{sha}","languages_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/languages","stargazers_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/stargazers","contributors_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/contributors","subscribers_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/subscribers","subscription_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/subscription","commits_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/commits{/sha}","git_commits_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/commits{/sha}","comments_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/comments{/number}","issue_comment_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues/comments{/number}","contents_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/contents/{+path}","compare_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/merges","archive_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/downloads","issues_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues{/number}","pulls_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls{/number}","milestones_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/milestones{/number}","notifications_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/labels{/name}","releases_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/releases{/id}","deployments_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/deployments","created_at":"2018-04-10T09:12:55Z","updated_at":"2018-08-29T22:23:41Z","pushed_at":"2018-08-29T22:27:36Z","git_url":"git://github.com/web-platform-tests/wpt.fyi.git","ssh_url":"git@github.com:web-platform-tests/wpt.fyi.git","clone_url":"https://github.com/web-platform-tests/wpt.fyi.git","svn_url":"https://github.com/web-platform-tests/wpt.fyi","homepage":"https://wpt.fyi/","size":14392,"stargazers_count":9,"watchers_count":9,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":109,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":9,"open_issues":109,"watchers":9,"default_branch":"master"}},"base":{"label":"web-platform-tests:master","ref":"master","sha":"9fc0a08bd56a7d928bd20eb39c4939ee859976c3","user":{"login":"web-platform-tests","id":37226233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MjI2MjMz","avatar_url":"https://avatars0.githubusercontent.com/u/37226233?v=4","gravatar_id":"","url":"https://api.github.com/users/web-platform-tests","html_url":"https://github.com/web-platform-tests","followers_url":"https://api.github.com/users/web-platform-tests/followers","following_url":"https://api.github.com/users/web-platform-tests/following{/other_user}","gists_url":"https://api.github.com/users/web-platform-tests/gists{/gist_id}","starred_url":"https://api.github.com/users/web-platform-tests/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-platform-tests/subscriptions","organizations_url":"https://api.github.com/users/web-platform-tests/orgs","repos_url":"https://api.github.com/users/web-platform-tests/repos","events_url":"https://api.github.com/users/web-platform-tests/events{/privacy}","received_events_url":"https://api.github.com/users/web-platform-tests/received_events","type":"Organization","site_admin":false},"repo":{"id":128905889,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg5MDU4ODk=","name":"wpt.fyi","full_name":"web-platform-tests/wpt.fyi","owner":{"login":"web-platform-tests","id":37226233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MjI2MjMz","avatar_url":"https://avatars0.githubusercontent.com/u/37226233?v=4","gravatar_id":"","url":"https://api.github.com/users/web-platform-tests","html_url":"https://github.com/web-platform-tests","followers_url":"https://api.github.com/users/web-platform-tests/followers","following_url":"https://api.github.com/users/web-platform-tests/following{/other_user}","gists_url":"https://api.github.com/users/web-platform-tests/gists{/gist_id}","starred_url":"https://api.github.com/users/web-platform-tests/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-platform-tests/subscriptions","organizations_url":"https://api.github.com/users/web-platform-tests/orgs","repos_url":"https://api.github.com/users/web-platform-tests/repos","events_url":"https://api.github.com/users/web-platform-tests/events{/privacy}","received_events_url":"https://api.github.com/users/web-platform-tests/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/web-platform-tests/wpt.fyi","description":"web-platform-tests dashboard","fork":false,"url":"https://api.github.com/repos/web-platform-tests/wpt.fyi","forks_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/forks","keys_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/teams","hooks_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/hooks","issue_events_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues/events{/number}","events_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/events","assignees_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/assignees{/user}","branches_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/branches{/branch}","tags_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/tags","blobs_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/refs{/sha}","trees_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/statuses/{sha}","languages_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/languages","stargazers_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/stargazers","contributors_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/contributors","subscribers_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/subscribers","subscription_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/subscription","commits_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/commits{/sha}","git_commits_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/git/commits{/sha}","comments_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/comments{/number}","issue_comment_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues/comments{/number}","contents_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/contents/{+path}","compare_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/merges","archive_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/downloads","issues_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues{/number}","pulls_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls{/number}","milestones_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/milestones{/number}","notifications_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/labels{/name}","releases_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/releases{/id}","deployments_url":"https://api.github.com/repos/web-platform-tests/wpt.fyi/deployments","created_at":"2018-04-10T09:12:55Z","updated_at":"2018-08-29T22:23:41Z","pushed_at":"2018-08-29T22:27:36Z","git_url":"git://github.com/web-platform-tests/wpt.fyi.git","ssh_url":"git@github.com:web-platform-tests/wpt.fyi.git","clone_url":"https://github.com/web-platform-tests/wpt.fyi.git","svn_url":"https://github.com/web-platform-tests/wpt.fyi","homepage":"https://wpt.fyi/","size":14392,"stargazers_count":9,"watchers_count":9,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":109,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":9,"open_issues":109,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/489"},"html":{"href":"https://github.com/web-platform-tests/wpt.fyi/pull/489"},"issue":{"href":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues/489"},"comments":{"href":"https://api.github.com/repos/web-platform-tests/wpt.fyi/issues/489/comments"},"review_comments":{"href":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/489/comments"},"review_comment":{"href":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/web-platform-tests/wpt.fyi/pulls/489/commits"},"statuses":{"href":"https://api.github.com/repos/web-platform-tests/wpt.fyi/statuses/886bf0a724f85c15b2cd302aa8b68506dbc6b2e1"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Hexcles"}}