Repository navigation
Description
Is your feature request related to a problem? Please describe.
Suggestion from @p1-dta
Plumber currently analyzes CI/CD configuration and several GitLab project settings, but it does not provide controls for the configuration available under:
Settings > Merge requests
These settings define how merge requests can be merged and can have an important impact on repository consistency, CI enforcement, review workflow, and Git history.
In organizations managing many GitLab projects, these settings are often expected to follow a common policy.
However, projects can currently drift from these expected settings without being detected by Plumber.
The main settings that should be covered are:
- Merge method
- Merge options
- Squash commits when merging
- Merge checks
Describe the solution you'd like
Add dedicated GitLab controls for the main Merge Request project settings.
Each control should compare the current GitLab project configuration with the expected configuration defined in .plumber.yaml.
1. Merge method
Suggested control:
projectMergeMethodMustMatchPolicy
GitLab allows exactly one merge method to be selected:
merge— Merge commitrebase_merge— Merge commit with semi-linear historyff— Fast-forward merge
The Plumber configuration should therefore define a single expected value rather than a list of allowed values.
Example:
gitlab:
controls:
projectMergeMethodMustMatchPolicy:
enabled: true
method: ffA finding should be emitted when the configured GitLab merge method does not match the expected method.
For example:
Expected:
merge_method: ff
Actual:
merge_method: merge
Automatic rebase (only since GitLab 19.4)
For the following merge methods:
rebase_mergeff
GitLab also provides:
Enable automatic rebase prior to merge
This setting should be handled by the same control because it is directly associated with the selected merge method.
Example:
gitlab:
controls:
projectMergeMethodMustMatchPolicy:
enabled: true
method: rebase_merge
automaticRebase: trueor:
gitlab:
controls:
projectMergeMethodMustMatchPolicy:
enabled: true
method: ff
automaticRebase: falseautomaticRebase should only be evaluated when the selected merge method supports it.
For:
method: mergethe automaticRebase setting should either be ignored or rejected during configuration validation.
2. Merge options
Suggested control:
projectMergeOptionsMustMatchPolicy
GitLab currently exposes several independent options in the Merge options section.
The initial control should support the following three settings:
- Automatically resolve merge request diff threads when they become outdated
- Show link to create or view a merge request when pushing from the command line
- Enable "Delete source branch" option by default
Example configuration:
gitlab:
controls:
projectMergeOptionsMustMatchPolicy:
enabled: true
automaticallyResolveOutdatedDiffThreads: true
showMergeRequestLinkOnPush: true
deleteSourceBranchByDefault: trueEach option should be evaluated independently.
Only properties explicitly defined in .plumber.yaml should be checked.
For example:
projectMergeOptionsMustMatchPolicy:
enabled: true
deleteSourceBranchByDefault: truewould only enforce the Delete source branch default and would not impose any policy on the two other options.
A separate finding should preferably be emitted for each mismatch.
Example:
Merge option does not match policy
Setting:
deleteSourceBranchByDefault
Expected:
true
Actual:
false
3. Squash commits when merging
Suggested control:
projectSquashOptionMustMatchPolicy
GitLab exposes a dedicated policy for squashing commits when merging.
The control should ensure that the project's squash policy matches the configured expected value.
Example:
gitlab:
controls:
projectSquashOptionMustMatchPolicy:
enabled: true
option: alwaysPossible GitLab values include:
never
default_off
default_on
always
The configuration should expect a single value because a GitLab project can only have one squash policy configured at a time.
Example finding:
Expected:
squash_option: always
Actual:
squash_option: default_on
4. Merge checks
Suggested control:
projectMergeChecksMustMatchPolicy
The control should verify the independent settings available in the Merge checks section.
For example:
- Pipelines must succeed
- All threads must be resolved
- Skipped pipelines are considered successful
Example:
gitlab:
controls:
projectMergeChecksMustMatchPolicy:
enabled: true
pipelinesMustSucceed: true
allThreadsMustBeResolved: true
skippedPipelinesAreSuccessful: falseAs with Merge options, only explicitly configured values should be checked.
For example:
projectMergeChecksMustMatchPolicy:
enabled: true
pipelinesMustSucceed: truewould only verify that successful pipelines are required before merge.
Each non-compliant setting should produce its own finding.
Example complete configuration
gitlab:
controls:
projectMergeMethodMustMatchPolicy:
enabled: true
method: ff
automaticRebase: true
projectMergeOptionsMustMatchPolicy:
enabled: true
automaticallyResolveOutdatedDiffThreads: true
showMergeRequestLinkOnPush: true
deleteSourceBranchByDefault: true
projectSquashOptionMustMatchPolicy:
enabled: true
option: always
projectMergeChecksMustMatchPolicy:
enabled: true
pipelinesMustSucceed: true
allThreadsMustBeResolved: true
skippedPipelinesAreSuccessful: falseThis would allow an organization to define a complete Merge Request policy and detect projects whose GitLab configuration has drifted from it.
Implementation hints
All the proposed settings are exposed by the GitLab Projects API and can be retrieved from the project configuration.
Relevant fields are:
merge_method
automatic_rebase_enabled # Available for Ultimate only and appeared in GitLab 19.4
resolve_outdated_diff_discussions
printing_merge_request_link_enabled
remove_source_branch_after_merge
squash_option # Available for Ultimate/Premium only
only_allow_merge_if_pipeline_succeeds
only_allow_merge_if_all_discussions_are_resolved
allow_merge_on_skipped_pipelineThey map to the proposed controls as follows:
Merge method
├── merge_method
└── automatic_rebase_enabled
Merge options
├── resolve_outdated_diff_discussions
├── printing_merge_request_link_enabled
└── remove_source_branch_after_merge
Squash commits when merging
└── squash_option
Merge checks
├── only_allow_merge_if_pipeline_succeeds
├── only_allow_merge_if_all_discussions_are_resolved
└── allow_merge_on_skipped_pipeline
For controls containing multiple boolean settings, each mismatch should generate a separate finding.
This makes the result easier to understand and allows each configuration issue to be reported independently.
Why It's Valuable
Merge Request settings are part of a project's development and governance policy.
Adding these controls would allow Plumber to:
- Detect configuration drift across GitLab projects.
- Enforce a consistent merge strategy.
- Enforce automatic rebasing when required.
- Standardize source branch cleanup.
- Standardize Merge Request workflow options.
- Enforce squash policies.
- Ensure CI pipelines cannot be bypassed before merge.
- Ensure review discussions are resolved when required.
- Audit GitLab project settings alongside CI/CD configuration.
- Help organizations enforce repository governance consistently across many projects.
This would extend Plumber's GitLab project-level controls beyond CI configuration and provide better coverage of Merge Request governance.
Activity
p1-dta commentedon Sep 28, 2026
Thanks @Karine-Bauch for translating my thoughts into a great issue, great job.
I have a few feedback still:
About 4. Merge checks:
IMHO, there is also a missing control:
projectMergeRequestApprovals, where we should be able to define the default "Minimum required approvals" value (0 by gitlab default), and any additional rule.For example, I need to check that I have a rule names "Maintainer", the target branch (empty means all), a defined list of users and a define list of groups, and how many approvol are needed for this one.
We also need to control the following MR approval settings:
Approval settings controls
p1-dta commentedon Sep 28, 2026
And yes, this might be a meta issue that should be split into many smaller ones ^^ sorry about that !
Karine-Bauch commentedon Sep 29, 2026
Thanks for your help and for adding settings I don't have accès (I'm not on premium or ultimate plan).
p1-dta commentedon Sep 29, 2026
@Karine-Bauch there is already many of those controls implemented in the CLI :
plumber/.plumber.yaml
Lines 222 to 228 in 4a1e7a3
p1-dta commentedon Sep 29, 2026
Same for other controls:
plumber/.plumber.yaml
Lines 238 to 247 in 4a1e7a3
Karine-Bauch commentedon Oct 1, 2026
@p1-dta Could you check which controls are needed on premium/ultimate plans ?
I'll check for the free plan.
p1-dta commentedon Oct 12, 2026
@Karine-Bauch I can't say which one is which, I have everything enabled, I can't tell which one come from premium or ultimate