feat(projects): manage merge request approval configuration on Project - #395
Open
alexandre-allard wants to merge 1 commit into
Open
Conversation
alexandre-allard
force-pushed
the
feat/mr-approval-settings
branch
from
July 30, 2026 09:06
5820f2c to
31204ab
Compare
GitLab exposes project-level merge request approval settings (reset-on-push, author/committer self-approval, reauthentication, etc.) through a dedicated /projects/:id/approvals endpoint that is separate from the main project update API. Expose it as an optional `approvals` block on the existing Project resource, following the same pattern as `pushRules`, rather than a separate CRD, since it has no independent identity or lifecycle apart from the project it belongs to. Fields are only reconciled when `approvals` is set in the spec, so existing Project resources are unaffected. Signed-off-by: Alexandre Allard <alexandre.allard@proton.ch>
alexandre-allard
force-pushed
the
feat/mr-approval-settings
branch
from
July 30, 2026 09:07
31204ab to
32934f5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
GitLab exposes project-level merge request approval settings (reset-on-push, author/committer self-approval, reauthentication, etc.) through a dedicated
/projects/:id/approvalsendpoint that is separate from the main project update API.This adds an optional
approvalsblock on the existingProjectresource, following the same pattern aspushRules, rather than introducing a separate CRD, since these settings have no independent identity or lifecycle apart from the project they belong to.Fields are only reconciled when
approvalsis set in the spec, so existingProjectresources are unaffected.approvalsBeforeMergeis intentionally left out of the newapprovalsblock, it's already managed via the existing top-levelProjectParameters.approvalsBeforeMergefield (a different GitLab API), and duplicating it here would create two reconciliation paths for the same underlying setting.Note on design:
I went back and forth on whether this should be a separate CRD (similar to the existing
ApprovalRuleresource) instead of a field onProject.I ended up embedding it because these settings have no identity or lifecycle independent of the project they belong to, but I'm not fully set on this, so happy to split it out into its own resource if maintainers prefer that instead.
I have:
make reviewable testto ensure this PR is ready for review.How has this code been tested
Tested it on one of our clusters with real data and we're currently using it in production.