Improve maintainability of ready_to_merge.vue
Description
Identified in Refactor ready_to_merge widget tests to be user... (#235744 - closed) and in this discussion
FWIW, I think we're suffering from poor testability and maintainability in
ready_to_merge.vue, which means we should strongly consider refactoringready_to_merge.vuewith testability in mind.
The component ready_to_merge.vue is:
- Hard to test.
- The existing unit tests are often hyper focused on component internals rather than component behavior and often aren't behaving the way they intend to (see relevant comment).
- Hard to maintain.
- It manages a lot of state (some of which is duplicated) from
mrprop,stateinternal data, and other internal state. - Part of it's behavior is implemented in a separate mixin.
- The template is large and has a number of conditionals.
- There's some methods (e.g.
initiateRemoveSourceBranchPollingwhich seem unreferenced - The
handleMergeButtonClickmethod is very complex
- It manages a lot of state (some of which is duplicated) from
Investigation
There's an existing new_ready_to_merge.vue component. Is that intended to replace the ready_to_merge.vue?
Edited by Payton Burdette