Display `parent_ids` in merge request commits API response
What does this MR do and why?
Contributes to #496665
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_ids
value 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_ids
value should be defined for commits (when FF is disabled, it will be missing. Note endpoint response is cached)
Related to #496665
Merge request reports
Activity
assigned to @vyaklushin
changed milestone to %17.10
added pipelinetier-1 label
mentioned in issue #496665
added feature flag label
- Resolved by Vasilii Iakliushin
1 Message CHANGELOG missing: If this merge request needs a changelog entry, add the
Changelog
trailer to the commit message you want to add to the changelog.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
Reviewer roulette
Category Reviewer Maintainer backend @smaglangit
(UTC+8, 7 hours ahead of author)
@avielle
(UTC+1, same timezone as author)
Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
DangerEdited by ****added groupsource code label and removed groupcode review label
added 1 commit
- 521cddc2 - Display `parent_ids` in merge request commits API response
assigned to @GitLabDuo
unassigned @GitLabDuo
requested review from @GitLabDuo
I have reviewed the merge request and left both questions and recommendations. The review covers the implementation of a feature flag for loading commits from Gitaly and potential issues with pagination handling. I estimate there is a decent amount of work required to address the concerns raised, including proper feature flag implementation, thorough testing, and improvements to pagination logic.
Edited by GitLab Duo- Resolved by Vasilii Iakliushin
- Resolved by Vasilii Iakliushin
- Resolved by Kerri Miller
Hi @kerrizor!
Can you please review this bug? Please see an additional context: https://gitlab.com/gitlab-org/gitlab/-/issues/517497#note_2348670002.
requested review from @kerrizor
added pipeline:mr-approved label
added pipelinetier-3 pipeline:run-e2e-omnibus-once labels and removed pipelinetier-1 label
Before you set this MR to auto-merge
This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3. We will trigger a new pipeline for each transition to a higher tier.
Before you set this MR to auto-merge, please check the following:
- You are the last maintainer of this merge request
- The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
- This pipeline is recent enough (created in the last 8 hours)
If all the criteria above apply, please set auto-merge for this merge request.
See pipeline tiers and merging a merge request for more details.
E2E Test Result Summary
allure-report-publisher
generated test report!e2e-test-on-cng:
test report for 521cddc2expand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Verify | 52 | 0 | 20 | 0 | 72 | ✅ | | Create | 140 | 0 | 22 | 0 | 162 | ✅ | | Govern | 84 | 0 | 10 | 0 | 94 | ✅ | | Data Stores | 33 | 0 | 10 | 0 | 43 | ✅ | | Plan | 86 | 0 | 8 | 0 | 94 | ✅ | | Release | 5 | 0 | 1 | 0 | 6 | ✅ | | Package | 29 | 0 | 15 | 0 | 44 | ✅ | | Fulfillment | 2 | 0 | 7 | 0 | 9 | ✅ | | Monitor | 8 | 0 | 12 | 0 | 20 | ✅ | | Manage | 1 | 0 | 9 | 0 | 10 | ✅ | | Configure | 0 | 0 | 3 | 0 | 3 | ➖ | | Secure | 3 | 0 | 5 | 0 | 8 | ✅ | | Analytics | 2 | 0 | 0 | 0 | 2 | ✅ | | ModelOps | 0 | 0 | 1 | 0 | 1 | ➖ | | Ai-powered | 0 | 0 | 2 | 0 | 2 | ➖ | | Growth | 0 | 0 | 2 | 0 | 2 | ➖ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 445 | 0 | 127 | 0 | 572 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
e2e-test-on-gdk:
test report for 521cddc2expand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Plan | 164 | 0 | 16 | 0 | 180 | ✅ | | Create | 270 | 0 | 46 | 0 | 316 | ✅ | | Verify | 102 | 0 | 42 | 0 | 144 | ✅ | | Data Stores | 66 | 0 | 20 | 0 | 86 | ✅ | | Govern | 158 | 0 | 26 | 0 | 184 | ✅ | | Package | 48 | 0 | 28 | 0 | 76 | ✅ | | Fulfillment | 4 | 0 | 14 | 0 | 18 | ✅ | | Secure | 10 | 0 | 6 | 0 | 16 | ✅ | | Monitor | 16 | 0 | 24 | 0 | 40 | ✅ | | Manage | 2 | 0 | 18 | 0 | 20 | ✅ | | Ai-powered | 0 | 0 | 4 | 0 | 4 | ➖ | | Analytics | 4 | 0 | 0 | 0 | 4 | ✅ | | Configure | 0 | 0 | 6 | 0 | 6 | ➖ | | Release | 10 | 0 | 2 | 0 | 12 | ✅ | | ModelOps | 0 | 0 | 2 | 0 | 2 | ➖ | | Growth | 0 | 0 | 4 | 0 | 4 | ➖ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 854 | 0 | 258 | 0 | 1112 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
Edited by ****started a merge train
mentioned in commit ef330313
added workflowstaging-canary label and removed workflowin review label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
added releasedpublished label