Verified Solution[gitlab-org/gitlab] Auto-merge (MWCP) does not respect "Skipped pipelines are considered successful" project setting
Sponsored Content
### ROOT CAUSE
The auto-merge condition in the `MergeWhenPipelineSucceeds` class does not properly account for the project setting "Skipped pipelines are considered successful". Specifically, it fails to check if a pipeline is skipped and the setting is enabled before considering it successful. This causes auto-merge to not trigger even when the pipeline is skipped and the setting is enabled.
### CODE FIX
```ruby
class MergeWhenPipelineSucceeds
def should_merge?(pipeline)
return true if pipeline.success?
if pipeline.skipped?
project = pipeline.project
return true if project.settings["ci_skipped_pipelines_are_successful"]
end
# ... existing code ...
end
end
```
This change adds a condition to check if the pipeline is skipped and if the project setting is enabled before considering it successful. This ensures the auto-merge condition respects the project setting.
Deploy on DigitalOcean ($200 Credit)
Related Fixes
[rust-lang/rust] [ICE]: duplicate copy of DefId in lctx.children
[tensorflow/tensorflow] TensorFlow CUDA repository redist link update
[StackOverflow/python] How to avoid X11 race condition when multithreading with PyAutoGUI?