bujjibabukatta opened a new pull request, #8928:
URL: https://github.com/apache/devlake/pull/8928
## Problem
GitLab MR size is incorrectly inflated when a branch has multiple
sequential PRs. The `changes_count` field from GitLab's API returns
cumulative line changes across all commits on the branch including
previous PRs, not just the current MR's diff.
## Root Cause
GitLab's `changes_count` sums all commits on the source branch.
For multi-part PRs this means PR #3 shows 9292 lines changed
instead of the actual 6523 lines in that PR alone.
## Fix
Use GitLab's `diff_stats` field (via `include_diff_stats=true`
query param) which returns additions/deletions relative to the
merge base — only what this PR itself introduces.
## Changes
- `backend/plugins/gitlab/tasks/mr_extractor.go` — added `DiffStats`
struct to `MergeRequestRes` and mapped `Additions`/`Deletions`
in `convertMergeRequest`
- `backend/plugins/gitlab/models/mr.go` — added `Additions` and
`Deletions` fields to `GitlabMergeRequest`
- `backend/plugins/gitlab/tasks/shared.go` — added
`include_diff_stats=true` query param to `GetQuery`
- `backend/plugins/gitlab/models/migrationscripts/` — added migration
script and registered it
Fixes #8888
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]