{"action":"created","issue":{"url":"https://api.github.com/repos/zulip/zulip/issues/3968","repository_url":"https://api.github.com/repos/zulip/zulip","labels_url":"https://api.github.com/repos/zulip/zulip/issues/3968/labels{/name}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/3968/comments","events_url":"https://api.github.com/repos/zulip/zulip/issues/3968/events","html_url":"https://github.com/zulip/zulip/issues/3968","id":212605490,"number":3968,"title":"integrations: Improve github (and other version control) messages.","user":{"login":"rishig","id":890911,"avatar_url":"https://avatars1.githubusercontent.com/u/890911?v=3","gravatar_id":"","url":"https://api.github.com/users/rishig","html_url":"https://github.com/rishig","followers_url":"https://api.github.com/users/rishig/followers","following_url":"https://api.github.com/users/rishig/following{/other_user}","gists_url":"https://api.github.com/users/rishig/gists{/gist_id}","starred_url":"https://api.github.com/users/rishig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rishig/subscriptions","organizations_url":"https://api.github.com/users/rishig/orgs","repos_url":"https://api.github.com/users/rishig/repos","events_url":"https://api.github.com/users/rishig/events{/privacy}","received_events_url":"https://api.github.com/users/rishig/received_events","type":"User","site_admin":false},"labels":[{"id":265733123,"url":"https://api.github.com/repos/zulip/zulip/labels/area:%20integrations","name":"area: integrations","color":"bfd4f2","default":false},{"id":273621476,"url":"https://api.github.com/repos/zulip/zulip/labels/bite%20size","name":"bite size","color":"bfe5bf","default":false},{"id":265216831,"url":"https://api.github.com/repos/zulip/zulip/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-03-08T00:51:15Z","updated_at":"2017-03-23T18:57:19Z","closed_at":null,"body":"Github (and other version control) messages currently look like this:\r\n![image](https://cloud.githubusercontent.com/assets/890911/23684748/84f6708c-0355-11e7-9784-7afeba11f0e4.png)\r\n\r\nA few improvements could be made:\r\n* We currently show 10 commits before doing the \"and N more commits\". The limit should be 20 instead of 10, since 10+ commits is not uncommon.\r\n* The commit links should move to the end. So \"integrations: Add foo to bar. (1234567)\"\r\n* The `timabbott pushed to branch master` should change to the following.\r\n  * If all the commits are from timabbott, then \"timabbott pushed 15 commits to branch master:\"\r\n  * else if there are at most 3 authors, then \"timabbott pushed 8 commits to branch master. Commits by rishig (5), octocat (2), and timabbott (1):\" \r\n  * else \"timabbott pushed 13 commits to branch master. Commits by rishig (4), octocat (2), and others (7):\"\r\n\r\nAuthors can be in decreasing order by number of commits, breaking ties alphabetically. \r\n\r\nAdding a picture of what it would look like:\r\n![image](https://cloud.githubusercontent.com/assets/890911/23686333/e1aa54e4-035d-11e7-982d-c5d051fd5263.png)\r\n\r\n@TomaszKolek, since this is possibly a fast change for you.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zulip/zulip/issues/comments/288826087","html_url":"https://github.com/zulip/zulip/issues/3968#issuecomment-288826087","issue_url":"https://api.github.com/repos/zulip/zulip/issues/3968","id":288826087,"user":{"login":"wizsid11","id":13391351,"avatar_url":"https://avatars1.githubusercontent.com/u/13391351?v=3","gravatar_id":"","url":"https://api.github.com/users/wizsid11","html_url":"https://github.com/wizsid11","followers_url":"https://api.github.com/users/wizsid11/followers","following_url":"https://api.github.com/users/wizsid11/following{/other_user}","gists_url":"https://api.github.com/users/wizsid11/gists{/gist_id}","starred_url":"https://api.github.com/users/wizsid11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wizsid11/subscriptions","organizations_url":"https://api.github.com/users/wizsid11/orgs","repos_url":"https://api.github.com/users/wizsid11/repos","events_url":"https://api.github.com/users/wizsid11/events{/privacy}","received_events_url":"https://api.github.com/users/wizsid11/received_events","type":"User","site_admin":false},"created_at":"2017-03-23T18:57:19Z","updated_at":"2017-03-23T18:57:19Z","body":"Hi @rishig,\r\nTomasz helped be break this into 3 steps.\r\nStep 1 : Change limit of commits shown to 20 for push notifications.\r\nStep 2 : Change push commits message to show url at the end.\r\nStep 3 : Show names of all the committers along with their number of commits.\r\n\r\nStep 1 and Step 2 have been completed and merged.\r\nYou can check that here https://github.com/zulip/zulip/pull/4006\r\n\r\nFor implementing Step 3 I came up with the following idea-\r\nhave a function named `get_all_committers` in `git.py` which would extract names of committers and their number of commits from the payload and then store them in a dictionary.\r\nI felt making a change in `views.py` which for all git like integrations would help me do that.\r\nIt is possible to do it for git and gitlab.\r\nWith bitbucket there is a difference in the payload in the `bitbucket_v2_push.json` and `bitbucket_v2_push_commits_above_limit.json`\r\nLike for `bitbucket_v2_push.json` we collect commiters name with payload['commits']['author']['username']\r\nand there is no username in `bitbucket_v2_push_commits_above_limit.json`\r\nthere is something like payload['commits']['author']['raw'] which is not the same as username.\r\nSo i am trying to figure something out maybe i need to separate  bitbucket_v2 from using `git.py` and instead have a `bitbucket_v2.py`\r\n"}}
{"actor":{"display_login":"wizsid11"}}