MR widget: add loading state with state transition on pipeline status
This is a follow-up to MVC delivered in #216048 (closed); the scope of this issue is item 2 in comment #216048 (comment 368874529).
Problem to solve
When a merge request (MR) is submitted, there is no loading state that has transitions logic for the combination of scenarios based on these conditions:
- Is the setting
Pipeline must succeed
checked/enabled? - Does the project have a pipeline configured (whether as external file or .gitlab-ci.yml)?
- How should the pipeline status impact merge request?
Proposal
If no pipeline is found after X amount of time, then transition to a new state with appropriate message that replaces the message previously implemented in gitlab #216048.
New state should handle these scenarios:
“Pipelines must succeed” | Pipeline exists (hasCi) | Pipeline status | Proposed text (expected UX) |
---|---|---|---|
enabled | yes (true) | succeeded | (no change to existing text) |
enabled | yes (true) | not started/finished, failed, cancelled | Merge is only allowed once the pipeline has passed |
enabled | no (false) | not found | Merge is only allowed once the pipeline has passed |
disabled | no (false) | not found | (no change to existing text) |
Possible solutions
(Summarized below is suggestion of comment from gitlab #216048)
When Pipeline must succeed
is checked and hasCi
is false
, show a generic message Unable to merge till pipeline succeeds
and link to explanation text that reason could be there is no CI, because external CI hasn't contacted us or because we are waiting for the runner to start the pipeline.