Bitbucket Importer will fail on retry because it does not check for labels existing
ZD ticket: https://gitlab.zendesk.com/agent/tickets/115527
Repro steps:
- Import a bitbucket repo with issues enabled
- Get the import to fail
- Sidekiq will retry the import, but will fail with an error like:
Error importing repository https://*****:*****@bitbucket.org into NAMESPACE - Failed to create label \"bug\" for PROJECT. Please try again."
Solution: https://gitlab.com/gitlab-org/gitlab-ce/blob/v11.8.0/lib/gitlab/bitbucket_import/importer.rb#L138-147 needs to check if the labels already exist for that project, and if so don't create them.
This is also related to our error handling efforts, gitlab-com/support/support-team-meta#1259 (closed) in that the error is just "failed" but "failed because already exists" which would make debugging this 2x faster.