Fix Bitbucket Server Importer enqueued job count
What does this MR do and why?
When BitbucketServerImport::Stage::PullRequestsWorker and BitbucketServerImport::Stage::ImportNotesWorker job are retried,
the jobs_remaining counter is incorrectly incremented for both processed
and unprocessed pull requests and comments, leading to inaccurate job counts.
This fix ensures jobs_remaining is only incremented for records that
haven't been processed yet, preventing the miscount during retries and prevents stage workers from not progressing
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Follow the Import and Integration guide to set up a local Bitbucket Server instance.
- In the Bitbucket Server instance, create a repo and a PR with comments.
- In GitLab:
- Visit
/admin/application_settings/networkand enable local requests. - Visit
/projects/new#import_project. - Choose Bitbucket Server.
- Enter your server details, and click List your Bitbucket Server repositories.
- Next to one of your BitBucket repositories, click Import.
- Visit
- During the import of activities (notes), stop Sidekiq
- Restart Sidekiq
- The migration should finish successfully
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Rodrigo Tomonari