[go: up one dir, main page]

Skip to content

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 refactoring ready_to_merge.vue with 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 mr prop, state internal 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 handleMergeButtonClick method is very complex

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