Frontend: Users cannot re-add merge request to a merge train when "pipeline must succeed" is enabled
Summary
In a particular case, users will lose a way to re-add a merge request to a merge train.
Steps to reproduce
- A user adds a merge request to a merge train
- The system creates a pipeline for merge train and it starts running
- A user accidentally removes the merge request from a merge train
- A user enables "Add to merge train when pipeline succeeds" on the merge request
Example Project
What is the current bug behavior?
- User sees disabled Merge button with the text "The pipeline for this merge request failed. Please retry the job or push a new commit to fix the failure". This is because the project enables "Pipeline must succeed" option.
- User doesn't have a way to re-add the merge request to a merge train because of that.
- Since the merge request has already been dropped from a merge train,
the pipeline will fail by
fatal: Couldn't find remote ref
. This is an expected behavior.
Workaround:
- The quickest workaround is disabling "Pipeline must succeed" option, because it's technically covered by merge train's functionality already.
- if you do not want to disable the option, here is another workaround.
- Click "Run pipeline" button in "Pipelines" tab in the merge request
- Enables "Add to merge train when pipeline succeeds"
- add a comment to the MR using the
/merge
action keyword. That re-adds the MR to the merge train and merges if the pipeline succeeded.
What is the expected correct behavior?
Users should be able to easily add the merge request back to the train without leaving the overview page- from the merge widget itself.
Proposal
- Backend - An MR to enable the following in the backend:#336799 (closed)
we need backend to return the
pipeline.merge_request_event_type
to the frontend (either via GraphQL or REST serializer, depending which one is used today)
- Frontend - Implement the mentioned table in the frontend
Pipeline event | Pipeline status | Button | Message |
---|---|---|---|
merge train pipeline | failed | Add to merge train | The merge train pipeline failed. Please address the spec, failure or re-add the merge request to the train. |
merge train pipeline | canceled | Add to merge train | The merge train pipeline failed. Please re-add the merge request to the train. |
merge train pipeline | running | no button / disabled | N/A |
merge train pipeline | success | N/A (MR being merged) | N/A |
merge request pipeline | canceled or failed | disabled Merge button | existing message, since a MR cannot be added on train if the user-triggered pipeline is non successful |
merge request pipeline | success | Add to merge train | whatever we display today |
Design proposal added to the design management section.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Reference
gitlab-com/www-gitlab-com!33508 (merged)<!--- Please read this!
Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "type::bug" label:
- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression
- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=type::bug
and verify the issue you're about to submit isn't a duplicate.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.