Skip to content
Snippets Groups Projects

Display `parent_ids` in merge request commits API response

Merged Vasilii Iakliushin requested to merge 496665-preload-commits-from-gitaly into master
All threads resolved!

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
Screenshot_2025-02-14_at_15.08.43 Screenshot_2025-02-14_at_15.08.58

How to set up and validate locally

  1. Enable feature flag

    Feature.enable(:commits_from_gitaly)
  2. Visit merge request commits API endpoint (http://gdk.test:3000/api/v4/projects/462/merge_requests/1/commits)

  3. parent_ids value should be defined for commits (when FF is disabled, it will be missing)

  4. Find a merge request diff version from this endpoint (http://gdk.test:3000/api/v4/projects/462/merge_requests/1/versions/)

  5. Visit merge request diff version page (http://gdk.test:3000/api/v4/projects/462/merge_requests/1/versions/2180)

  6. 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

Loading
Loading
  • 1 Message
    :book: 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 profile link current availability (UTC+8, 7 hours ahead of author) @avielle profile link current availability (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 :repeat: danger-review job that generated this comment.

    Generated by :no_entry_sign: Danger

    Edited by ****
  • Vasilii Iakliushin resolved all threads

    resolved all threads

  • added 1 commit

    • 189708e8 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • added groupsource code label and removed groupcode review label

  • added 1 commit

    • 521cddc2 - Display `parent_ids` in merge request commits API response

    Compare with previous version

  • 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.

    · Leave feedback
    Edited by GitLab Duo
  • GitLab Duo
  • GitLab Duo
  • Vasilii Iakliushin resolved all threads

    resolved all threads

  • Vasilii Iakliushin requested review from @kerrizor

    requested review from @kerrizor

  • Kerri Miller approved this merge request

    approved this merge request

  • 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.

  • Kerri Miller resolved all threads

    resolved all threads

  • Kerri Miller enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-cng: :white_check_mark: test report for 521cddc2

    expand 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: :white_check_mark: test report for 521cddc2

    expand 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 ****
  • merged

  • Kerri Miller mentioned in commit ef330313

    mentioned in commit ef330313

  • added workflowstaging label and removed workflowcanary label

  • Please register or sign in to reply
    Loading