[go: up one dir, main page]

Skip to content

PullRequestImporter should not use deprecated assignee_id column

It has been discovered during gitlab-foss!31284 (comment 199213061):

Gitlab::GithubImport::Importer::PullRequestImporter is using create_merge_request_without_hooks method which bulk inserts in the database and bypasses the hooks which create merge request assignees instead of setting assignee_id

I've tried the following query on production:

SELECT merge_requests.* FROM merge_requests
    WHERE (NOT EXISTS (SELECT 1 FROM merge_request_assignees WHERE merge_request_assignees.merge_request_id = merge_requests.id))
    AND assignee_id IS NOT NULL AND id < 50000000 AND id > 40000000

and received 13913 results. I believe it shouldn't return any results

We need to get rid of any direct writing to assignee_id column (in PullRequestImporter or any other place). The records in the merge_request_assignees database should be created instead according to #2004 (closed)

After all these usages are eliminated, we can migrate existing data for merge requests with assignee_id but without merge requests assignees and ignore/remove MergeRequest#assignee_id column: #30535