Import from gitlab.com to CE fails with multiple assignees issues
Summary
Project import fails on GitLab CE for a repo coming from Gitlab.com
Steps to reproduce
- Create a repo on Gitlab.com
- Create an issue with 2 assignees
- Import to your gitlab CE
What is the current bug behavior?
Import fails with:
Error importing repository into vates/xoa-support - PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_issue_assignees_on_issue_id_and_user_id"
DETAIL: Key (issue_id, user_id)=(216, 1) already exists.
: INSERT INTO "issue_assignees" ("user_id", "issue_id") VALUES ($1, $2)
Note that issue ID number will correlate the issue number in your gitlab.com repo (and this issue got more than 1 assignee)
What is the expected correct behavior?
Best case: This should block the import. Probably displays 2 assignees, without the ability to add others. I suppose it's blocked in CE, but after the import, it doesn't really matter, the API/UI should block the possibility to have more than 1 anyway, no? Remove the constraint at database level.
Worst case: remove automatically assignees until one left only.
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.1.0 Redis Version: 3.2.5 Git Version: 2.13.6 Sidekiq Version:5.0.4 Go Version: unknown
GitLab information Version: 10.1.4 Revision: c887c03 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://git.vates.fr HTTP Clone URL: https://git.vates.fr/some-group/some-project.git SSH Clone URL: git@git.vates.fr:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers: github
GitLab Shell Version: 5.9.3 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Possible fixes
Remove constraint in DB?