Include all commits in web hook
Zendesk: https://gitlab.zendesk.com/agent/tickets/86246
Web hook payloads currently only include stats about the last 20 commits pushed to a branch. In the code at https://gitlab.com/gitlab-org/gitlab-ce/blob/2cbb2d0eceaed0f31c92d4eed8932e98f4f74559/lib/gitlab/data_builder/push.rb#L65 it mentions that this is for performance reasons.
Why is this needed?
Customer uses web hooks to interact with a deployment system. The system needs to know which commits are pushed to master in order to build a changeset and deploy the proper files. When more than 20 commits are pushed at once, certain things are missing from the deployment.
Representatives from the product the customer are using to deploy mention that they integrate this way with all of the Git-based tools out there and all our competitors include all commits in the web hook payload. If they can, why can't we?
Benchmarks
I ran some crude benchmarks on my local system to see if there was any credence to the performance claim. When pushing 100 commits I found that there is a noticeable difference in time it takes to get the commit stats for 20 commits vs. 100. However, since this is a background task is it that bad? I'm guessing this would be a tad slower on certain filesystems, too, since I have SSD on my workstation. All the same, it may be acceptable in the grand scheme.
20 commits: 0.290000 0.030000 0.320000 ( 0.487273)
100 commits: 0.280000 0.030000 0.310000 ( 1.688079)
Alternative options
As an alternative, could we add an option to include a simple set of commits in the web hook payload rather than extended stats? The customer only really needs the SHAs but we're loading up all kind of other info, too, which is what takes time.
@stanhu @DouweM What do you think? Is there a background on performance issues with this that I'm not aware of? Any other ways to improve?