Add ability to manage flag Prevent editing approval rules in merge requests
New Data Source
The flag 'Prevent editing approval rules in merge requests' is used to manage our SOC2 compliance. We presently manage all repositories via Terraform and had expected to just set this value in order to solve the problem across all repositories. However on reviewing the documentation and available resources, this option does not appear to be available to set.
I'm looking for something that I could use like this:
resource "gitlab_project" "default" {
prevent_editing_approval_rules_in_merge_requests = true
}
Related GitLab APIs
- Update: https://docs.gitlab.com/ee/api/merge_request_approvals.html#change-configuration
- Read: https://docs.gitlab.com/ee/api/merge_request_approvals.html#get-configuration
There are no Create or Delete APIs for this resource, since it's essentially a project configuration. Delete would simply un-manage the terraform resource, and Create would simply call the Update method since the project would already exist with default values.
Additional Details
We have two options for how we could manage this resource:
- We could create a new
gitlab_project_default_approval_rulesresource which allowed for configuring the new settings. This would align with our 1:1 API:Resource principle, and would mean we could implement this using the new framework without having the transitiongitlab_project(which is one of our largest resources in terms of maintenance), or: - We could implement this as a new post-create/update call on
gitlab_project
-
GitLab REST API resources available (read for data sources, crud for resources) -
go-gitlabdoes support the related GitLab API already (support available here: https://github.com/xanzy/go-gitlab/blob/master/merge_request_approvals.go#L196) -
I'd like to contribute it myself
Edited by Patrick Rice