Skip to content

Bitbucket importer: fix undefined method `key'

Madelein van Niekerk requested to merge 433139-fix-bug into master

What does this MR do and why?

Closes Bitbucket importer: investigate undefined metho... (#433139 - closed) which fixes the following error:

undefined method `key' for #<ImportFailure id: 14821814, relation_index: nil, project_id: 52480416, created_at: "2023-11-24 08:57:01.206710208 +0000", relation_key: nil, exception_class: "OAuth2::Error", correlation_id_value: "0d78abdc9e2528e634d9af5017da41a0", exception_message: "#<SnakyHash::StringKeyed message=\"You may not have...", retry_count: nil, group_id: nil, source: "Gitlab::BitbucketImport::Importers::IssuesImporter", external_identifiers: {}, user_id: nil>

This happens when an error is raised from some import stages and it returns an ImportFailure object instead of JobWaiter. To fix this, we always return job_waiter.

Also updates specs to test that a JobWaiter is returned.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #433139 (closed)

Merge request reports