{"action":"created","comment":{"url":"https://api.github.com/repos/zulip/zulip/pulls/comments/73576427","id":73576427,"diff_hunk":"@@ -155,7 +156,8 @@ def handle(self, **options):\n                 for type_id in recipient_streams[:int(len(recipient_streams) *\n                                                       float(i)/len(profiles)) + 1]:\n                     r = Recipient.objects.get(type=Recipient.STREAM, type_id=type_id)\n-                    s = Subscription(recipient=r, user_profile=profile)\n+                    s = Subscription(recipient=r, user_profile=profile, color=\"#%06x\" % random.randint(0, 0xFFFFFF))\n+","path":"zilencer/management/commands/populate_db.py","position":19,"original_position":19,"commit_id":"bccf0b0c3f91f038907c75e54357b8c77f658b07","original_commit_id":"bccf0b0c3f91f038907c75e54357b8c77f658b07","user":{"login":"timabbott","id":2746074,"avatar_url":"https://avatars.githubusercontent.com/u/2746074?v=3","gravatar_id":"","url":"https://api.github.com/users/timabbott","html_url":"https://github.com/timabbott","followers_url":"https://api.github.com/users/timabbott/followers","following_url":"https://api.github.com/users/timabbott/following{/other_user}","gists_url":"https://api.github.com/users/timabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/timabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timabbott/subscriptions","organizations_url":"https://api.github.com/users/timabbott/orgs","repos_url":"https://api.github.com/users/timabbott/repos","events_url":"https://api.github.com/users/timabbott/events{/privacy}","received_events_url":"https://api.github.com/users/timabbott/received_events","type":"User","site_admin":false},"body":"Cool, I think it'd be good to make the stream color selection more deterministic and consistent with what would happen if you actually subscribed to the streams.  The basic story for how to do that is that we should reuse the `stream_assignment_colors` structure defined in `zerver/lib/actions.py`, and just select streams in order.\r\n\r\nE.g. `color=stream_assignment_colors[j]` where this is the `j`th Subscription object made for that user in this function.\r\n\r\n(and we can use the same algorithm where we set stream colors below as well)","created_at":"2016-08-04T18:24:33Z","updated_at":"2016-08-04T18:24:33Z","html_url":"https://github.com/zulip/zulip/pull/1538#discussion_r73576427","pull_request_url":"https://api.github.com/repos/zulip/zulip/pulls/1538","_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments/73576427"},"html":{"href":"https://github.com/zulip/zulip/pull/1538#discussion_r73576427"},"pull_request":{"href":"https://api.github.com/repos/zulip/zulip/pulls/1538"}}},"pull_request":{"url":"https://api.github.com/repos/zulip/zulip/pulls/1538","id":79984920,"html_url":"https://github.com/zulip/zulip/pull/1538","diff_url":"https://github.com/zulip/zulip/pull/1538.diff","patch_url":"https://github.com/zulip/zulip/pull/1538.patch","issue_url":"https://api.github.com/repos/zulip/zulip/issues/1538","number":1538,"state":"open","locked":false,"title":"Add colors to streams on dev.","user":{"login":"TomaszKolek","id":5993758,"avatar_url":"https://avatars.githubusercontent.com/u/5993758?v=3","gravatar_id":"","url":"https://api.github.com/users/TomaszKolek","html_url":"https://github.com/TomaszKolek","followers_url":"https://api.github.com/users/TomaszKolek/followers","following_url":"https://api.github.com/users/TomaszKolek/following{/other_user}","gists_url":"https://api.github.com/users/TomaszKolek/gists{/gist_id}","starred_url":"https://api.github.com/users/TomaszKolek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomaszKolek/subscriptions","organizations_url":"https://api.github.com/users/TomaszKolek/orgs","repos_url":"https://api.github.com/users/TomaszKolek/repos","events_url":"https://api.github.com/users/TomaszKolek/events{/privacy}","received_events_url":"https://api.github.com/users/TomaszKolek/received_events","type":"User","site_admin":false},"body":"Add colors for streams in populate_db.py.\r\n\r\nFixes: #1454.","created_at":"2016-08-03T21:46:14Z","updated_at":"2016-08-04T18:24:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d94b37dc7dddc774c35eb19e2e94be1c0b08e04","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zulip/zulip/pulls/1538/commits","review_comments_url":"https://api.github.com/repos/zulip/zulip/pulls/1538/comments","review_comment_url":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/1538/comments","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/bccf0b0c3f91f038907c75e54357b8c77f658b07","head":{"label":"TomaszKolek:add-colors-to-dev-streams","ref":"add-colors-to-dev-streams","sha":"bccf0b0c3f91f038907c75e54357b8c77f658b07","user":{"login":"TomaszKolek","id":5993758,"avatar_url":"https://avatars.githubusercontent.com/u/5993758?v=3","gravatar_id":"","url":"https://api.github.com/users/TomaszKolek","html_url":"https://github.com/TomaszKolek","followers_url":"https://api.github.com/users/TomaszKolek/followers","following_url":"https://api.github.com/users/TomaszKolek/following{/other_user}","gists_url":"https://api.github.com/users/TomaszKolek/gists{/gist_id}","starred_url":"https://api.github.com/users/TomaszKolek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomaszKolek/subscriptions","organizations_url":"https://api.github.com/users/TomaszKolek/orgs","repos_url":"https://api.github.com/users/TomaszKolek/repos","events_url":"https://api.github.com/users/TomaszKolek/events{/privacy}","received_events_url":"https://api.github.com/users/TomaszKolek/received_events","type":"User","site_admin":false},"repo":{"id":53679793,"name":"zulip","full_name":"TomaszKolek/zulip","owner":{"login":"TomaszKolek","id":5993758,"avatar_url":"https://avatars.githubusercontent.com/u/5993758?v=3","gravatar_id":"","url":"https://api.github.com/users/TomaszKolek","html_url":"https://github.com/TomaszKolek","followers_url":"https://api.github.com/users/TomaszKolek/followers","following_url":"https://api.github.com/users/TomaszKolek/following{/other_user}","gists_url":"https://api.github.com/users/TomaszKolek/gists{/gist_id}","starred_url":"https://api.github.com/users/TomaszKolek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomaszKolek/subscriptions","organizations_url":"https://api.github.com/users/TomaszKolek/orgs","repos_url":"https://api.github.com/users/TomaszKolek/repos","events_url":"https://api.github.com/users/TomaszKolek/events{/privacy}","received_events_url":"https://api.github.com/users/TomaszKolek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TomaszKolek/zulip","description":"Zulip server - powerful open source group chat","fork":true,"url":"https://api.github.com/repos/TomaszKolek/zulip","forks_url":"https://api.github.com/repos/TomaszKolek/zulip/forks","keys_url":"https://api.github.com/repos/TomaszKolek/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TomaszKolek/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TomaszKolek/zulip/teams","hooks_url":"https://api.github.com/repos/TomaszKolek/zulip/hooks","issue_events_url":"https://api.github.com/repos/TomaszKolek/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/TomaszKolek/zulip/events","assignees_url":"https://api.github.com/repos/TomaszKolek/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/TomaszKolek/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/TomaszKolek/zulip/tags","blobs_url":"https://api.github.com/repos/TomaszKolek/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TomaszKolek/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TomaszKolek/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/TomaszKolek/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TomaszKolek/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/TomaszKolek/zulip/languages","stargazers_url":"https://api.github.com/repos/TomaszKolek/zulip/stargazers","contributors_url":"https://api.github.com/repos/TomaszKolek/zulip/contributors","subscribers_url":"https://api.github.com/repos/TomaszKolek/zulip/subscribers","subscription_url":"https://api.github.com/repos/TomaszKolek/zulip/subscription","commits_url":"https://api.github.com/repos/TomaszKolek/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/TomaszKolek/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/TomaszKolek/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/TomaszKolek/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/TomaszKolek/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/TomaszKolek/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TomaszKolek/zulip/merges","archive_url":"https://api.github.com/repos/TomaszKolek/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TomaszKolek/zulip/downloads","issues_url":"https://api.github.com/repos/TomaszKolek/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/TomaszKolek/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/TomaszKolek/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/TomaszKolek/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TomaszKolek/zulip/labels{/name}","releases_url":"https://api.github.com/repos/TomaszKolek/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/TomaszKolek/zulip/deployments","created_at":"2016-03-11T16:16:19Z","updated_at":"2016-03-11T16:16:26Z","pushed_at":"2016-08-03T22:12:56Z","git_url":"git://github.com/TomaszKolek/zulip.git","ssh_url":"git@github.com:TomaszKolek/zulip.git","clone_url":"https://github.com/TomaszKolek/zulip.git","svn_url":"https://github.com/TomaszKolek/zulip","homepage":"","size":114129,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"zulip:master","ref":"master","sha":"1d6ebd2b3d3d69acdd5ceed1da9da3f0c44b6dfb","user":{"login":"zulip","id":4921959,"avatar_url":"https://avatars.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"repo":{"id":43160685,"name":"zulip","full_name":"zulip/zulip","owner":{"login":"zulip","id":4921959,"avatar_url":"https://avatars.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zulip/zulip","description":"Zulip server - powerful open source group chat","fork":false,"url":"https://api.github.com/repos/zulip/zulip","forks_url":"https://api.github.com/repos/zulip/zulip/forks","keys_url":"https://api.github.com/repos/zulip/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zulip/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zulip/zulip/teams","hooks_url":"https://api.github.com/repos/zulip/zulip/hooks","issue_events_url":"https://api.github.com/repos/zulip/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/zulip/zulip/events","assignees_url":"https://api.github.com/repos/zulip/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/zulip/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/zulip/zulip/tags","blobs_url":"https://api.github.com/repos/zulip/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zulip/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zulip/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/zulip/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/zulip/zulip/languages","stargazers_url":"https://api.github.com/repos/zulip/zulip/stargazers","contributors_url":"https://api.github.com/repos/zulip/zulip/contributors","subscribers_url":"https://api.github.com/repos/zulip/zulip/subscribers","subscription_url":"https://api.github.com/repos/zulip/zulip/subscription","commits_url":"https://api.github.com/repos/zulip/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/zulip/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/zulip/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/zulip/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/zulip/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/zulip/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zulip/zulip/merges","archive_url":"https://api.github.com/repos/zulip/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zulip/zulip/downloads","issues_url":"https://api.github.com/repos/zulip/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/zulip/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/zulip/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/zulip/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zulip/zulip/labels{/name}","releases_url":"https://api.github.com/repos/zulip/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/zulip/zulip/deployments","created_at":"2015-09-25T16:37:25Z","updated_at":"2016-08-04T02:43:38Z","pushed_at":"2016-08-04T17:50:13Z","git_url":"git://github.com/zulip/zulip.git","ssh_url":"git@github.com:zulip/zulip.git","clone_url":"https://github.com/zulip/zulip.git","svn_url":"https://github.com/zulip/zulip","homepage":"","size":120701,"stargazers_count":3980,"watchers_count":3980,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":635,"mirror_url":null,"open_issues_count":496,"forks":635,"open_issues":496,"watchers":3980,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/1538"},"html":{"href":"https://github.com/zulip/zulip/pull/1538"},"issue":{"href":"https://api.github.com/repos/zulip/zulip/issues/1538"},"comments":{"href":"https://api.github.com/repos/zulip/zulip/issues/1538/comments"},"review_comments":{"href":"https://api.github.com/repos/zulip/zulip/pulls/1538/comments"},"review_comment":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zulip/zulip/pulls/1538/commits"},"statuses":{"href":"https://api.github.com/repos/zulip/zulip/statuses/bccf0b0c3f91f038907c75e54357b8c77f658b07"}}}}
{"actor":{"display_login":"timabbott"}}