Skip to content

Commit 0a70bbd

Browse files
Update docs for v16.6.0 release
1 parent b3b2f19 commit 0a70bbd

File tree

6 files changed

+122
-0
lines changed

6 files changed

+122
-0
lines changed

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## 16.6.0 (2023-11-16)
2+
3+
This release was tested against GitLab 16.4, 16.5, and 16.6 for both CE and EE
4+
5+
KNOWN ISSUES:
6+
7+
- Attempting to use the `gitlab_users` datasource with `sort` will not return users in the specified sort order when used with GitLab 16.6.0, as GitLab 16.6.0 uses relevancy sorting and ignores `sort`. This will be resolved with GitLab 16.6.1.
8+
9+
IMPROVEMENTS:
10+
11+
- **New Resource:** `gitlab_project_level_notifications` allows managing notification events for project ([!1715](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1715))
12+
- resource/gitlab_project_approval_rule: added support for `applies_to_all_protected_branches` ([!1755](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1755))
13+
- resource/gitlab_pipeline_schedule: added support for `take_ownership`, which will take ownership of the pipeline schedule prior to attempting an update ([!1745](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1745))
14+
- resource/gitlab_group: added support for `push_rules` ([!1730](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1730))
15+
16+
BUG FIXES:
17+
18+
- resource/gitlab_user_runner: Fixed an issue where not including `maximum_timeout` could cause an issue when updating the runner ([!1758](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1758))
19+
- datasource/gitlab_user: When using `email`, the the data source will now return the first user returned from the API instead of encountering an error when more than one is identified. When used with GitLab 16.6.0, this will always be the exact match if an exact match is available. ([!1743](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1743))
20+
21+
122
## 16.5.0 (2023-10-22)
223

324
This release was tested against GitLab 16.3, 16.4, and 16.5 for both CE and EE

docs/data-sources/user.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ subcategory: ""
55
description: |-
66
The gitlab_user data source allows details of a user to be retrieved by either the user ID, username or email address.
77
-> Some attributes might not be returned depending on if you're an admin or not.
8+
~> When using the email attribute, an exact match is not guaranteed. The most related match will be returned. Starting with GitLab 16.6,
9+
the most related match will prioritize an exact match if one is available.
810
Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/users.html#single-user
911
---
1012

@@ -14,6 +16,9 @@ The `gitlab_user` data source allows details of a user to be retrieved by either
1416

1517
-> Some attributes might not be returned depending on if you're an admin or not.
1618

19+
~> When using the `email` attribute, an exact match is not guaranteed. The most related match will be returned. Starting with GitLab 16.6,
20+
the most related match will prioritize an exact match if one is available.
21+
1722
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/users.html#single-user)
1823

1924
## Example Usage

docs/resources/group.md

+32
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ resource "gitlab_project" "example" {
3131
description = "An example project"
3232
namespace_id = gitlab_group.example.id
3333
}
34+
35+
# Group with custom push rules
36+
resource "gitlab_group" "example-two" {
37+
name = "example-two"
38+
path = "example-two"
39+
description = "An example group with push rules"
40+
41+
push_rules {
42+
author_email_regex = "@example\\.com$"
43+
commit_committer_check = true
44+
member_check = true
45+
prevent_secrets = true
46+
}
47+
}
3448
```
3549

3650
<!-- schema generated by tfplugindocs -->
@@ -57,6 +71,7 @@ resource "gitlab_project" "example" {
5771
- `parent_id` (Number) Id of the parent group (creates a nested group).
5872
- `prevent_forking_outside_group` (Boolean) Defaults to false. When enabled, users can not fork projects from this group to external namespaces.
5973
- `project_creation_level` (String) Determine if developers can create projects in the group. Valid values are: `noone`, `maintainer`, `developer`
74+
- `push_rules` (Block List, Max: 1) Push rules for the group. (see [below for nested schema](#nestedblock--push_rules))
6075
- `request_access_enabled` (Boolean) Allow users to request member access.
6176
- `require_two_factor_authentication` (Boolean) Require all users in this group to setup Two-factor authentication.
6277
- `share_with_group_lock` (Boolean) Prevent sharing a project with another group within this group.
@@ -76,6 +91,23 @@ resource "gitlab_project" "example" {
7691
- `runners_token` (String, Sensitive) The group level registration token to use during runner setup.
7792
- `web_url` (String) Web URL of the group.
7893

94+
<a id="nestedblock--push_rules"></a>
95+
### Nested Schema for `push_rules`
96+
97+
Optional:
98+
99+
- `author_email_regex` (String) All commit author emails must match this regex, e.g. `@my-company.com$`.
100+
- `branch_name_regex` (String) All branch names must match this regex, e.g. `(feature|hotfix)\/*`.
101+
- `commit_committer_check` (Boolean) Only commits pushed using verified emails are allowed. **Note** This attribute is only supported in GitLab versions >= 16.4.
102+
- `commit_message_negative_regex` (String) No commit message is allowed to match this regex, for example `ssh\:\/\/`.
103+
- `commit_message_regex` (String) All commit messages must match this regex, e.g. `Fixed \d+\..*`.
104+
- `deny_delete_tag` (Boolean) Deny deleting a tag.
105+
- `file_name_regex` (String) Filenames matching the regular expression provided in this attribute are not allowed, for example, `(jar|exe)$`.
106+
- `max_file_size` (Number) Maximum file size (MB) allowed.
107+
- `member_check` (Boolean) Allows only GitLab users to author commits.
108+
- `prevent_secrets` (Boolean) GitLab will reject any files that are likely to contain secrets.
109+
- `reject_unsigned_commits` (Boolean) Only commits signed through GPG are allowed. **Note** This attribute is only supported in GitLab versions >= 16.4.
110+
79111
## Import
80112

81113
Import is supported using the following syntax:

docs/resources/pipeline_schedule.md

+2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ resource "gitlab_pipeline_schedule" "example" {
3838

3939
- `active` (Boolean) The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
4040
- `cron_timezone` (String) The timezone.
41+
- `take_ownership` (Boolean) When set to `true`, the user represented by the token running Terraform will take ownership of the scheduled pipeline prior to editing it. This can help when managing scheduled pipeline drift when other users are making changes outside Terraform.
4142

4243
### Read-Only
4344

4445
- `id` (String) The ID of this resource.
46+
- `owner` (Number) The ID of the user that owns the pipeline schedule.
4547
- `pipeline_schedule_id` (Number) The pipeline schedule id.
4648

4749
## Import

docs/resources/project_approval_rule.md

+11
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ resource "gitlab_project_approval_rule" "any_approver" {
7777
rule_type = "any_approver"
7878
approvals_required = 1
7979
}
80+
81+
# Example using `applies_to_all_protected_branches`
82+
resource "gitlab_project_approval_rule" "example-four" {
83+
project = 5
84+
name = "Example Rule 4"
85+
approvals_required = 3
86+
user_ids = [50, 500]
87+
group_ids = [51]
88+
applies_to_all_protected_branches = true
89+
}
8090
```
8191

8292
<!-- schema generated by tfplugindocs -->
@@ -90,6 +100,7 @@ resource "gitlab_project_approval_rule" "any_approver" {
90100

91101
### Optional
92102

103+
- `applies_to_all_protected_branches` (Boolean) Whether the rule is applied to all protected branches. If set to 'true', the value of `protected_branch_ids` is ignored. Default is 'false'.
93104
- `disable_importing_default_any_approver_rule_on_create` (Boolean) When this flag is set, the default `any_approver` rule will not be imported if present.
94105
- `group_ids` (Set of Number) A list of group IDs whose members can approve of the merge request.
95106
- `protected_branch_ids` (Set of Number) A list of protected branch IDs (not branch names) for which the rule applies.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gitlab_project_level_notifications Resource - terraform-provider-gitlab"
4+
subcategory: ""
5+
description: |-
6+
The gitlab_project_level_notifications resource allows to manage notifications for a project.
7+
~> While the API supports both groups and projects, this resource only supports projects currently.
8+
Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/notification_settings.html#group--project-level-notification-settings
9+
---
10+
11+
# gitlab_project_level_notifications (Resource)
12+
13+
The `gitlab_project_level_notifications` resource allows to manage notifications for a project.
14+
15+
~> While the API supports both groups and projects, this resource only supports projects currently.
16+
17+
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/notification_settings.html#group--project-level-notification-settings)
18+
19+
20+
21+
<!-- schema generated by tfplugindocs -->
22+
## Schema
23+
24+
### Required
25+
26+
- `project` (String) The ID or URL-encoded path of a project where notifications will be configured.
27+
28+
### Optional
29+
30+
- `close_issue` (Boolean) Enable notifications for closed issues. Can only be used when `level` is `custom`.
31+
- `close_merge_request` (Boolean) Enable notifications for closed merge requests. Can only be used when `level` is `custom`.
32+
- `failed_pipeline` (Boolean) Enable notifications for failed pipelines. Can only be used when `level` is `custom`.
33+
- `fixed_pipeline` (Boolean) Enable notifications for fixed pipelines. Can only be used when `level` is `custom`.
34+
- `issue_due` (Boolean) Enable notifications for due issues. Can only be used when `level` is `custom`.
35+
- `level` (String) The level of the notification. Valid values are: `disabled`, `participating`, `watch`, `global`, `mention`, `custom`.
36+
- `merge_merge_request` (Boolean) Enable notifications for merged merge requests. Can only be used when `level` is `custom`.
37+
- `merge_when_pipeline_succeeds` (Boolean) Enable notifications for merged merge requests when the pipeline succeeds. Can only be used when `level` is `custom`.
38+
- `moved_project` (Boolean) Enable notifications for moved projects. Can only be used when `level` is `custom`.
39+
- `new_issue` (Boolean) Enable notifications for new issues. Can only be used when `level` is `custom`.
40+
- `new_merge_request` (Boolean) Enable notifications for new merge requests. Can only be used when `level` is `custom`.
41+
- `new_note` (Boolean) Enable notifications for new notes on merge requests. Can only be used when `level` is `custom`.
42+
- `push_to_merge_request` (Boolean) Enable notifications for push to merge request branches. Can only be used when `level` is `custom`.
43+
- `reassign_issue` (Boolean) Enable notifications for issue reassignments. Can only be used when `level` is `custom`.
44+
- `reassign_merge_request` (Boolean) Enable notifications for merge request reassignments. Can only be used when `level` is `custom`.
45+
- `reopen_issue` (Boolean) Enable notifications for reopened issues. Can only be used when `level` is `custom`.
46+
- `reopen_merge_request` (Boolean) Enable notifications for reopened merge requests. Can only be used when `level` is `custom`.
47+
- `success_pipeline` (Boolean) Enable notifications for successful pipelines. Can only be used when `level` is `custom`.
48+
49+
### Read-Only
50+
51+
- `id` (String) The ID of the resource. Matches the `project` value.

0 commit comments

Comments
 (0)