Add commit stats
What does this MR do?
When getting commit by SHA in api it returns commit stats
Are there points in the code the reviewer needs to double check?
Not sure about test I added do we need separate test or we can just shove stats assertion in test above
Why was this MR needed?
So api users/clients can get statistics on single commit
What are the relevant issue numbers?
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together
Merge request reports
Activity
Added 1 commit:
- d6161c7d - Add commit stats to commit api response
@zj can you take a look when available :)
Thanks for your work, it looks good to me. Usually we have an entity for sub resources, but IMO in this case, with there being only one place this is used it should be fine. Although Ill let @rymai decide.
Reassigned to @rymai
Milestone changed to %8.11
78 78 expect(json_response['title']).to eq(project.repository.commit.title) 79 79 end 80 80 81 it "returns commit stats" do We can directly test this inside https://gitlab.com/gitlab-org/gitlab-ce/blob/d6161c7db0fd552fe9d2375c911d05fbd49df45b/spec/requests/api/commits_spec.rb#L74. I think there is no need for a second test with the same request.
Yes, I almost suggested that actually. Let's do this @dixpac please. :)
@razer6 @rymai thanks for the review...yea I also wasn't sure about wether to make second test or just assert in existing one....as I noted in description https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5517#are-there-points-in-the-code-the-reviewer-needs-to-double-check..:)....no probs I will fix it :)
Added 29 commits:
-
d6161c7d...ac7f3e6a - 28 commits from branch
gitlab-org:master
- 6d19455a - Add commit stats to commit api response
-
d6161c7d...ac7f3e6a - 28 commits from branch
Added 46 commits:
-
6d19455a...17be364d - 45 commits from branch
gitlab-org:master
- fb649300 - Add commit stats to commit api response
-
6d19455a...17be364d - 45 commits from branch
47 47 - Fix a bug where forking a project from a repository storage to another would fail. !5509 48 48 - Fix missing schema update for `20160722221922`. !5512 49 49 - Update `gitlab-shell` version to 3.2.1 in the 8.9->8.10 update guide. !5516 50 - Add commit stats in commit api. !5517 (dixpac) @razer6 done :) !
Added 1 commit:
- 7fa38229 - Add commit stats to commit api response
Added 1 commit:
- a4bb9993 - Add commit stats to commit api response
Marked the task Documentation created/updated as completed
@razer6 when updating documentation I notice that commit hash has duplicate
id of commit in it
, so I decided to make new presenter forRepoCommitStats
and only exposeadditions, deletions, total
instats
attribute. I don't have a lot experience withgrape
, WDYT is it ok ?@dixpac Perfect, thank you!
mentioned in commit a88a4e85