[go: up one dir, main page]

Skip to content

Provide integration tests for Import/Export Members Mapper

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Why are we doing this work

During the discussion from !71867 (merged) we found out that specs are not failing if we remove very important property from import_export.yml file for users: id:

I wonder why user id was included in this list to begin with since we filter out all occurrences of id 🤔 Are we certain it's not used anywhere?

I checked members mapper and its actually used there https://gitlab.com/gitlab-org/gitlab/blob/ae74ea54daa39fd2c5941a8b4da8daf14fd82abc/lib/gitlab/import_export/members_mapper.rb#L21-L21 We need this id in order to build a map of member user ids old_user_id -> new_user_id in order for the member mapping to work correctly.

The reason it works is because members mapper runs as a one of the first steps in the import process, before cleaner/permitter filters it out https://gitlab.com/gitlab-org/gitlab/blob/ae74ea54daa39fd2c5941a8b4da8daf14fd82abc/lib/gitlab/import_export/project/tree_restorer.rb#L31-L31

We need to add additional specs to make sure this is tested and that the ID will not be removed by accident from that file.

Implementation plan

  • backend add additional spec that will export a project with few user members and import it as a new project and verify if users are properly mapped,
Edited by 🤖 GitLab Bot 🤖