Display `parent_ids` in merge request commits API response
What does this MR do and why?
Contributes to #496665 (closed)
Problem
Merge request commits are stored in the database without information about their parent_ids. As a result, commits created from DB records are missing this data.
Solution
Load commit content from Gitaly to have access to full commit information.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
-
Enable feature flag
Feature.enable(:commits_from_gitaly) -
Visit merge request commits API endpoint (http://gdk.test:3000/api/v4/projects/462/merge_requests/1/commits)
-
parent_idsvalue should be defined for commits (when FF is disabled, it will be missing) -
Find a merge request diff version from this endpoint (http://gdk.test:3000/api/v4/projects/462/merge_requests/1/versions/)
-
Visit merge request diff version page (http://gdk.test:3000/api/v4/projects/462/merge_requests/1/versions/2180)
-
parent_idsvalue should be defined for commits (when FF is disabled, it will be missing. Note endpoint response is cached)
Related to #496665 (closed)

