Research Report: GitLab MR Epic Issue Relationship

Original Research Query

How does gitlab-org/gitlab!188711 (merged) relate to gitlab-org&12260 and gitlab-org/gitlab#423958 (closed)?

Research Report

This report details the relationships between Merge Request gitlab-org/gitlab!188711+, Epic gitlab-org&12260+, and Issue gitlab-org/gitlab#423958+.

Executive Summary

Merge Request gitlab-org/gitlab!188711 ("Fix project transfer not prioritizing exact matches") addresses a problem in project transfers where the search for a destination namespace did not prioritize exact matches. This issue is analogous to a previously reported and fixed problem for group transfers, which was detailed in Issue gitlab-org/gitlab#423958 ("Transfer locations API should prioritize exact paths in search").

Both the problem described in Issue gitlab-org/gitlab#423958 (for group transfers) and the fix implemented in Merge Request gitlab-org/gitlab!188711 (for project transfers) contribute to the overarching goals of Epic gitlab-org&12260 ("Group and project transfer improvements"). This Epic serves as a central collection point for efforts to enhance the functionality and user experience of transferring groups and projects within GitLab.

In essence, gitlab-org/gitlab!188711 is a subsequent fix for a recurring pattern of an issue, applied to a different context (projects vs. groups), and both the original issue and this new fix align with the strategic improvements tracked by Epic gitlab-org&12260.

Item Details and Relationships

1. Epic: gitlab-org&12260 - Group and project transfer improvements

  • Title: Group and project transfer improvements
  • URL: https://gitlab.com/groups/gitlab-org/-/epics/12260+
  • Created At: 2023-12-15T14:58:03Z
  • Author: lohrc
  • Description:
    This epic collects issues relating to the group and project transfer.
  • Purpose: This Epic is the primary tracker for all initiatives aimed at enhancing the group and project transfer processes within GitLab. It encompasses various aspects, including usability, performance, and reliability of these features.

2. Issue: gitlab-org/gitlab#423958 - Transfer locations API should prioritize exact paths in search

  • Title: Transfer locations API should prioritize exact paths in search
  • URL: https://gitlab.com/gitlab-org/gitlab/-/issues/423958+
  • Created At: 2023-09-01T05:22:00Z
  • Author: stanhu
  • State: Closed
  • Description Snippet: The issue reported by stanhu described a problem encountered when trying to transfer a group (e.g., fulfillment-group into gitlab-org). The API endpoint https://gitlab.com/api/v4/groups/:id/transfer_locations?search=gitlab-org returned a long list of irrelevant projects, making it difficult to select the exact target group.
    I'm trying to transfer a https://gitlab.com/fulfillment-group into the `gitlab-org` group, but `https://gitlab.com/api/v4/groups/:id/transfer_locations?search=gitlab-org` is providing me an endless list of irrelevant projects:
    
    ![image](/uploads/1062dc9856571c2f6c44f12f33b5d852/image.png)
    
    It looks like `AcceptingGroupTransfersFinder` in https://gitlab.com/gitlab-org/gitlab/-/blob/02c11f82e950c247c627f5d63eaa10db5a37dd36/app/finders/groups/accepting_group_transfers_finder.rb#L17 calls `items.by_search`.
  • Resolution: This issue, specific to group transfers, was addressed by Merge Request gitlab-org/gitlab!130773 ("Put exact matches first when searching for groups to transfer"). This MR modified the ::Groups::AcceptingGroupTransfersFinder.

3. Merge Request: gitlab-org/gitlab!188711 - Fix project transfer not prioritizing exact matches

  • Title: Fix project transfer not prioritizing exact matches
  • URL: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/188711+
  • Created At: 2025-04-18T19:36:16Z
  • Author: stanhu
  • Merged At: 2025-04-23T09:38:06Z
  • Description Snippet: This MR addresses a similar problem to gitlab-org/gitlab#423958, but for project transfers.
    ## What does this MR do and why?
    
    In https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130773 we
    fixed the problem where it was impossible to transfer one subgroup
    to another group when there were many similar matches.
    
    However, a similar problem exists when trying to transfer a project
    to another group.
    
    The underlying issue appears that the `transfer_locations` API work
    slightly differently. The groups `transfer_locations` API uses
    `::Groups::AcceptingGroupTransfersFinder`, while the projects
    `transfer_locations` API uses `Groups::UserGroupsFinder`.
    
    The latter appears to have logic around permission checking for
    project creation, transfers, and imports.
    
    To give priority for exact matches, we add an `exact_matches_first`
    argument behind the `exact_matches_first_project_transfer` feature
    flag.
    
    In theory the `sorted_by_similarity_desc` could also prioritize exact
    matches, but to be consistent with
    `::Groups::AcceptingGroupTransfersFinder` we use the same approach.
  • Related Issue: This MR directly fixes gitlab-org/gitlab#536745 ("Transfer locations API not prioritizing exact paths in search for project transfers").

Detailed Relationships

Relationship between gitlab-org/gitlab!188711 and gitlab-org/gitlab#423958

Merge Request gitlab-org/gitlab!188711 is conceptually linked to Issue gitlab-org/gitlab#423958.

  • Issue gitlab-org/gitlab#423958 highlighted the problem of the transfer locations API not prioritizing exact path matches during group transfers. This was fixed by gitlab-org/gitlab!130773 by modifying ::Groups::AcceptingGroupTransfersFinder.
  • Later, a similar issue was observed for project transfers. This was reported in Issue gitlab-org/gitlab#536745. The description of #536745 explicitly states:

    https://gitlab.com/gitlab-org/gitlab/-/issues/423958 is happening again.

  • Merge Request gitlab-org/gitlab!188711 was created to fix this recurrence of the problem, specifically for project transfers, as detailed in gitlab-org/gitlab#536745. The MR description for !188711 acknowledges the previous fix (!130773) for group transfers and explains that project transfers use a different finder (Groups::UserGroupsFinder), necessitating a separate but similar solution.

Therefore, gitlab-org/gitlab!188711 addresses the same underlying usability problem as gitlab-org/gitlab#423958 but in the context of project transfers rather than group transfers.

Relationship between gitlab-org/gitlab!188711 and Epic gitlab-org&12260

Merge Request gitlab-org/gitlab!188711 directly contributes to the goals of Epic gitlab-org&12260 ("Group and project transfer improvements").

  • The Epic aims to collect and track all improvements related to group and project transfers.
  • By fixing the issue where exact matches are not prioritized in the project transfer locations API, gitlab-org/gitlab!188711 enhances the usability and reliability of the project transfer feature. This is a clear improvement that falls under the scope of the Epic.

Relationship between gitlab-org/gitlab#423958 and Epic gitlab-org&12260

Issue gitlab-org/gitlab#423958 is also directly related to Epic gitlab-org&12260.

  • The Epic's purpose is to improve both group and project transfers.
  • Issue gitlab-org/gitlab#423958 identified a significant usability problem in the group transfer process. Addressing this problem (which was done via gitlab-org/gitlab!130773) is a key improvement to group transfers and thus aligns with the objectives of Epic gitlab-org&12260. The Epic gitlab-org&12260 is listed as a related epic for gitlab-org/gitlab#423958.

Supporting Evidence

Key Technical Difference Highlighted in gitlab-org/gitlab!188711

The description of gitlab-org/gitlab!188711 points out a crucial difference in implementation that necessitated a new MR for project transfers:

The underlying issue appears that the transfer_locations API work slightly differently. The groups transfer_locations API uses ::Groups::AcceptingGroupTransfersFinder, while the projects transfer_locations API uses Groups::UserGroupsFinder.

Solution Approach in gitlab-org/gitlab!188711

To address the project transfer issue, gitlab-org/gitlab!188711 adopted a similar strategy to the one used for group transfers:

To give priority for exact matches, we add an exact_matches_first argument behind the exact_matches_first_project_transfer feature flag.

Relevant Code Changes in gitlab-org/gitlab!188711

The MR gitlab-org/gitlab!188711 involved changes to the following files to implement the fix:

  • app/finders/groups/user_groups_finder.rb: Modified to include the logic for prioritizing exact matches.
  • config/feature_flags/gitlab_com_derisk/exact_matches_first_project_transfer.yml: Introduced the feature flag for this change.
  • lib/api/projects.rb: Updated to pass the exact_matches_first parameter.
  • spec/finders/groups/user_groups_finder_spec.rb: Added tests for the new functionality.

Comments

  • Comment from gitlab-org/gitlab#536745 by stanhu (Author of the issue, 2025-04-18T17:19:16Z):

    https://gitlab.com/gitlab-org/gitlab/-/issues/423958 is happening again. I am trying to transfer the following projects to `gitlab-org`:
    
    * https://gitlab.com/gitlab-org/code-creation/knowledge-graph
    * https://gitlab.com/gitlab-org/code-creation/gitlab-code-parser
    
    I am just seeing:
    
    ![image](/uploads/f45e448a37a8368c45a2f2a948f7ca94/image.png)
    
    My browser is calling GET `https://gitlab.com/api/v4/projects/69095239/transfer_locations?per_page=20&page=1&search=gitlab-org`, and it's not returning exact matches for some reason.

    This comment explicitly links the project transfer problem to the previously solved group transfer problem (gitlab-org/gitlab#423958).

  • Comment from gitlab-org/gitlab!188711 by stanhu (Author of the MR, 2025-04-18T19:36:16Z - part of the MR description):

    In https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130773 we
    fixed the problem where it was impossible to transfer one subgroup
    to another group when there were many similar matches.
    
    However, a similar problem exists when trying to transfer a project
    to another group.

    This reiterates the connection to the previous fix and the recurrence of the issue in a different context.

Conclusion

The Merge Request gitlab-org/gitlab!188711 is a direct fix for an issue (gitlab-org/gitlab#536745) where project transfers did not prioritize exact matches in the destination search. This issue was a recurrence of a problem previously identified and fixed for group transfers in gitlab-org/gitlab#423958 (fixed by gitlab-org/gitlab!130773). Both the original issue concerning group transfers and the subsequent Merge Request improving project transfers are integral to the objectives of Epic gitlab-org&12260, which aims to broadly enhance group and project transfer functionalities within GitLab. The work done in gitlab-org/gitlab!188711 ensures consistency in user experience and functionality between group and project transfers regarding destination selection.


This issue was automatically created from a research report generated on 2025-05-26T15:42:55.148Z