Skip to content
Snippets Groups Projects

Add commit stats

Merged username-removed-526579 requested to merge dixpac/gitlab-ce:add_commit_stats into master

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?

#20307 (closed)

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
78 78 expect(json_response['title']).to eq(project.repository.commit.title)
79 79 end
80 80
81 it "returns commit stats" do
  • Added 29 commits:

  • Added 46 commits:

  • 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)
  • Added 1 commit:

    • 7fa38229 - Add commit stats to commit api response
  • Please also update the documentation for that feature.

  • 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 for RepoCommitStats and only expose additions, deletions, total in stats attribute. I don't have a lot experience with grape, WDYT is it ok ?

  • @dixpac Perfect, thank you!

  • username-removed-128633 Status changed to merged

    Status changed to merged

  • mentioned in commit a88a4e85

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading