Skip to content

Commit c7f86ee

Browse files
committed
Note the danger of using approvals_before_merge attribute in the project resource
Closes: #969
1 parent becf2ce commit c7f86ee

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docs/resources/project.md

+3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ resource "gitlab_project" "peters_repo" {
7575
- `allow_merge_on_skipped_pipeline` (Boolean) Set to true if you want to treat skipped pipelines as if they finished with success.
7676
- `analytics_access_level` (String) Set the analytics access level. Valid values are `disabled`, `private`, `enabled`.
7777
- `approvals_before_merge` (Number) Number of merge request approvals required for merging. Default is 0.
78+
This field **does not** work well in combination with the `gitlab_project_approval_rule` resource
79+
and is most likely gonna be deprecated in a future GitLab version (see [this upstream epic](https://gitlab.com/groups/gitlab-org/-/epics/7572)).
80+
In the meantime we recommend against using this attribute and use `gitlab_project_approval_rule` instead.
7881
- `archive_on_destroy` (Boolean) Set to `true` to archive the project instead of deleting on destroy. If set to `true` it will entire omit the `DELETE` operation.
7982
- `archived` (Boolean) Whether the project is in read-only mode (archived). Repositories can be archived/unarchived by toggling this parameter.
8083
- `auto_cancel_pending_pipelines` (String) Auto-cancel pending pipelines. This isn’t a boolean, but enabled/disabled.

internal/provider/resource_gitlab_project.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,14 @@ var resourceGitLabProjectSchema = map[string]*schema.Schema{
106106
Default: true,
107107
},
108108
"approvals_before_merge": {
109-
Description: "Number of merge request approvals required for merging. Default is 0.",
110-
Type: schema.TypeInt,
111-
Optional: true,
112-
Default: 0,
109+
Description: `Number of merge request approvals required for merging. Default is 0.
110+
This field **does not** work well in combination with the ` + "`gitlab_project_approval_rule`" + ` resource
111+
and is most likely gonna be deprecated in a future GitLab version (see [this upstream epic](https://gitlab.com/groups/gitlab-org/-/epics/7572)).
112+
In the meantime we recommend against using this attribute and use ` + "`gitlab_project_approval_rule`" + ` instead.
113+
`,
114+
Type: schema.TypeInt,
115+
Optional: true,
116+
Default: 0,
113117
},
114118
"wiki_enabled": {
115119
Description: "Enable wiki for the project.",

0 commit comments

Comments
 (0)