Skip to content

Update work items traversal ids after group and project transfer

What does this MR do and why?

Add workers to handle updating work items traversal ids when transferring a project or a group.

More info on the namespace_traversal_ids initiative: https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/traversal_ids_on_issues/

Database Queries

References

Screenshots or screen recordings

A sub-group and its project gets moved to another group and the traversal IDs get updated:

Screen_Recording_2025-09-09_at_09.29.29

Before After

How to set up and validate locally

  1. Enable the feature flag Feature.enable(:update_work_item_traversal_ids_on_transfer)
  2. See the current traversal IDs of the group/project
    n = Namespace.find_by_path('YOUR_GROUP_PATH')
    n.traversal_ids # => [...]
  3. Likely the work items in that group don't have a traversal_ids set if they're older (we didn't backfill them yet). But you can query them via:
    n.work_items.first.namespace_traversal_ids
  4. Go to a group's or project's settings http://gdk.test:3000/groups/YOUR_GROUP_PATH/-/edit
  5. In the Advanced Section, select another group you want to transfer the project/group to
  6. Transfer it and then check the traversal IDs again (ensure that your Sidekiq jobs are working - a full restart when checking out the branch helps)
    n.work_items.first.namespace_traversal_ids # => should output the new traversal_ids

When you choose a group, it also updated the traversal_ids of the descendent namespaces.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #562317 (closed)

Edited by Nicolas Dular

Merge request reports

Loading