Skip to content

Draft: Refactors for StuckMergeJobsService

What does this MR do and why?

This MR makes some refactors to the StuckMergeJobService and it's related spec. I recently created the service in !123209 (closed) by copying the logic out of the StuckMergeJobsWorker. In that specific MR, I tried to refactor as little as possible, because there were no behavioral changes being made and I wanted the code to look as similar as possible to verify the lack of change during review.

So this MR is a follow-up to fix some Rubocop violations and increase the readability of the spec file.

For Review

The first two commits are relatively straightforward:

  1. f980690e Adds a new spec to assert an important intergation. We will refactor this spec in the third commit.
  2. ab037d85 Uses some MergeRequest scopes to reduce the amount of Rubocop violation happening in that method.

The third commit cover most of a spec file, and so might be better reviewed as whole copies side-by-side:

  1. 72383951 The major pieces are that two merge requests are moved up to the top of the file as reusable let declarations, and the MR creation is removed from the tops of all the individual example blocks. Also, some of the example descriptions have been rewritten to be more explicitly descriptive of what's happening in them and what we expect.

MR acceptance checklist

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

Edited by drew stachon

Merge request reports