"Delete source branch" is not updated when "Merge when pipeline succeeds" / "Set to Auto-Merge"
Summary
- In merge request: When "Delete source branch" checkbox gets deactivated and pressing "Merge when pipeline succeeds", the information shown is still "Source branch will be deleted".
- Only a visual bug (source branch will not be deleted)
- Refreshing the page does not fix the problem either (see gif)
Steps to reproduce
Example Project
What is the current bug behavior?
Message says "Source branch will be deleted"
What is the expected correct behavior?
Message says "Source branch will not be deleted"
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)
Implementation Guide
- Add a
setRemoveSourceBranchfunction in https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js#L382 after thesetApprovalsfunction - Create specs for the above in
- Change the checkbox component behavior from
v-modelto use the@changeevent instead https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue#L585 - When the event mentioned above is emitted, the
removeSourceBranchmust be updated and thesetRemoveSourceBranchmust be called to update the store - Update any failing RSpec tests
Edited by Caroline Simpson
