Skip to content

Feat/add gitlab mr approval settings control - #426

Merged
Joseph94m merged 3 commits into
mainfrom
feat/add-gitlab-mr-approval-settings-control
Aug 26, 2026
Merged

Feat/add gitlab mr approval settings control#426
Joseph94m merged 3 commits into
mainfrom
feat/add-gitlab-mr-approval-settings-control

Conversation

@Joseph94m

@Joseph94m Joseph94m commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Needs #423

Closes #415
Cloes #416

@thomasboni

Copy link
Copy Markdown
Contributor

@Joseph94m Reviewed + tested e2e by Claude (real binary against a mock GitLab API):

Blockers

  1. StatusFor has no branch for mergeRequestSettingsMustBeCompliant, producing a false pass. Reproduced e2e: a non-403/404 error on the approval-rules endpoint aborts the protection collection, ProtectionData stays nil, and the JSON reports mrSettingsResult: "passed" with exit 0 while ISSUE-503 correctly reports error on the same run. The control never saw any data. Add the same guard as the 503 branch: ProtectionData == nil || ProtectionData.MRSettings == nil => StatusError, before the CI-file checks (this control is CI-file independent too).
  2. The shipped default config breaks the "unset = not checked" contract. defaultConfig/.plumber.yaml ships all 8 ISSUE-506 expectations and the 503 surface populated. Any user config with extends: plumber:default (the normal path) that enables the control inherits every one of those opinions and cannot unset them (an overlay can override a value, not remove it). Reproduced e2e: with only mergeMethod/squashOption/trains/pipelines/removeSourceBranch configured, the run still flagged resolveOutdatedDiffDiscussions, which I never set. Issues Migrate platform control: MR approval settings must be compliant (ISSUE-503) #415/Migrate platform control: MR settings must be compliant (ISSUE-506) #416 specify "a setting left unset is not checked". Fix: comment out the per-field expectations in the shipped default (keep enabled: false and the docs), so enabling the control enforces only what the operator explicitly sets.
  3. control/mrcomment.go writeIssueDetails is missing all four MR controls. Neither mergeRequestApprovalSettingsMustBeCompliant / mergeRequestSettingsMustBeCompliant (this PR) nor mergeRequestApprovalRulesMustRequireMinimumApprovals / ...MustCoverAllProtectedBranches (Feat/add gitlab mr approval controls #423, slipped through that review too) are in the hand-written order list, so their findings are silently dropped from the MR comment body (the control shows failed with zero detail lines). Same bug class as the Feat/add gitlab variables controls #422 fix. Since this branch is stacked on Feat/add gitlab mr approval controls #423, adding all four here works.
  4. Conflicts should be resolved and branch rebased

Should fix

  • Terminal caveat for an unreadable approvals listing. On the 403 run, ISSUE-503 shows as a bare green check under "Passed Controls" (and counts toward the score) while JSON says error. Feat/add gitlab mr approval controls #423's fix round added approvalRulesUnreadableCaveat for exactly this; after the rebase, reuse it (or a sibling) for the 503 stat-builder case.

@Joseph94m
Joseph94m force-pushed the feat/add-gitlab-mr-approval-settings-control branch from c317186 to 02e7934 Compare August 25, 2026 09:25
…rent-vs-expected and add a Premium/Ultimate tier caveat when no protections are in effect
…ith a conditional Premium/Ultimate caveat for merge-train and merged-pipeline expectations
@Joseph94m
Joseph94m force-pushed the feat/add-gitlab-mr-approval-settings-control branch from 02e7934 to 6642e7b Compare August 25, 2026 09:26
@Joseph94m
Joseph94m marked this pull request as ready for review August 25, 2026 09:52
Comment thread control/status.go
Comment thread control/status.go
Comment thread gitlab/gitlab_ir.go
Comment thread cmd/legacy_json.go
Comment thread control/status.go
@Joseph94m
Joseph94m force-pushed the feat/add-gitlab-mr-approval-settings-control branch from 90c6fc1 to 5572a88 Compare August 25, 2026 12:35
@Joseph94m

Copy link
Copy Markdown
Collaborator Author

@thomasboni should be good!

@Joseph94m
Joseph94m merged commit a70ef57 into main Aug 26, 2026
16 checks passed
@Joseph94m
Joseph94m deleted the feat/add-gitlab-mr-approval-settings-control branch August 26, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate platform control: MR approval settings must be compliant (ISSUE-503)

2 participants