Skip to content

Commit fd70a3b

Browse files
authored
Merge pull request #917 from timofurrer/feature/align-project-api
resource/gitlab_project: Add many attributes to align with upstream API
2 parents 375586b + 526d83f commit fd70a3b

File tree

7 files changed

+1376
-62
lines changed

7 files changed

+1376
-62
lines changed

docs/data-sources/project.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,74 @@ data "gitlab_project" "example" {
3232

3333
- **id** (String) The integer or path with namespace that uniquely identifies the project within the gitlab install.
3434
- **path_with_namespace** (String) The path of the repository with namespace.
35+
- **public_builds** (Boolean) If true, jobs can be viewed by non-project members.
3536

3637
### Read-Only
3738

39+
- **analytics_access_level** (String) Set the analytics access level. Valid values are `disabled`, `private`, `enabled`.
3840
- **archived** (Boolean) Whether the project is in read-only mode (archived).
41+
- **auto_cancel_pending_pipelines** (String) Auto-cancel pending pipelines. This isn’t a boolean, but enabled/disabled.
42+
- **auto_devops_deploy_strategy** (String) Auto Deploy strategy. Valid values are `continuous`, `manual`, `timed_incremental`.
43+
- **auto_devops_enabled** (Boolean) Enable Auto DevOps for this project.
44+
- **autoclose_referenced_issues** (Boolean) Set whether auto-closing referenced issues on default branch.
45+
- **build_git_strategy** (String) The Git strategy. Defaults to fetch.
46+
- **build_timeout** (Number) The maximum amount of time, in seconds, that a job can run.
47+
- **builds_access_level** (String) Set the builds access level. Valid values are `disabled`, `private`, `enabled`.
48+
- **container_expiration_policy** (List of Object) Set the image cleanup policy for this project. **Note**: this field is sometimes named `container_expiration_policy_attributes` in the GitLab Upstream API. (see [below for nested schema](#nestedatt--container_expiration_policy))
49+
- **container_registry_access_level** (String) Set visibility of container registry, for this project. Valid values are `disabled`, `private`, `enabled`.
3950
- **default_branch** (String) The default branch for the project.
4051
- **description** (String) A description of the project.
52+
- **emails_disabled** (Boolean) Disable email notifications.
53+
- **external_authorization_classification_label** (String) The classification label for the project.
54+
- **forking_access_level** (String) Set the forking access level. Valid values are `disabled`, `private`, `enabled`.
4155
- **http_url_to_repo** (String) URL that can be provided to `git clone` to clone the
56+
- **issues_access_level** (String) Set the issues access level. Valid values are `disabled`, `private`, `enabled`.
4257
- **issues_enabled** (Boolean) Enable issue tracking for the project.
4358
- **lfs_enabled** (Boolean) Enable LFS for the project.
59+
- **merge_commit_template** (String) Template used to create merge commit message in merge requests. (Introduced in GitLab 14.5.)
4460
- **merge_pipelines_enabled** (Boolean) Enable or disable merge pipelines.
61+
- **merge_requests_access_level** (String) Set the merge requests access level. Valid values are `disabled`, `private`, `enabled`.
4562
- **merge_requests_enabled** (Boolean) Enable merge requests for the project.
4663
- **merge_trains_enabled** (Boolean) Enable or disable merge trains.
4764
- **name** (String) The name of the project.
4865
- **namespace_id** (Number) The namespace (group or user) of the project. Defaults to your user.
66+
- **operations_access_level** (String) Set the operations access level. Valid values are `disabled`, `private`, `enabled`.
4967
- **path** (String) The path of the repository.
5068
- **pipelines_enabled** (Boolean) Enable pipelines for the project.
5169
- **printing_merge_request_link_enabled** (Boolean) Show link to create/view merge request when pushing from the command line
5270
- **push_rules** (List of Object) Push rules for the project. (see [below for nested schema](#nestedatt--push_rules))
5371
- **remove_source_branch_after_merge** (Boolean) Enable `Delete source branch` option by default for all new merge requests
72+
- **repository_access_level** (String) Set the repository access level. Valid values are `disabled`, `private`, `enabled`.
73+
- **repository_storage** (String) Which storage shard the repository is on. (administrator only)
5474
- **request_access_enabled** (Boolean) Allow users to request member access.
75+
- **requirements_access_level** (String) Set the requirements access level. Valid values are `disabled`, `private`, `enabled`.
76+
- **resolve_outdated_diff_discussions** (Boolean) Automatically resolve merge request diffs discussions on lines changed with a push.
5577
- **runners_token** (String) Registration token to use during runner setup.
78+
- **security_and_compliance_access_level** (String) Set the security and compliance access level. Valid values are `disabled`, `private`, `enabled`.
79+
- **snippets_access_level** (String) Set the snippets access level. Valid values are `disabled`, `private`, `enabled`.
5680
- **snippets_enabled** (Boolean) Enable snippets for the project.
81+
- **squash_commit_template** (String) Template used to create squash commit message in merge requests. (Introduced in GitLab 14.6.)
5782
- **ssh_url_to_repo** (String) URL that can be provided to `git clone` to clone the
83+
- **topics** (Set of String) The list of topics for the project.
5884
- **visibility_level** (String) Repositories are created as private by default.
5985
- **web_url** (String) URL that can be used to find the project in a browser.
86+
- **wiki_access_level** (String) Set the wiki access level. Valid values are `disabled`, `private`, `enabled`.
6087
- **wiki_enabled** (Boolean) Enable wiki for the project.
6188

89+
<a id="nestedatt--container_expiration_policy"></a>
90+
### Nested Schema for `container_expiration_policy`
91+
92+
Read-Only:
93+
94+
- **cadence** (String)
95+
- **enabled** (Boolean)
96+
- **keep_n** (Number)
97+
- **name_regex_delete** (String)
98+
- **name_regex_keep** (String)
99+
- **next_run_at** (String)
100+
- **older_than** (String)
101+
102+
62103
<a id="nestedatt--push_rules"></a>
63104
### Nested Schema for `push_rules`
64105

docs/data-sources/projects.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,30 +80,46 @@ Read-Only:
8080

8181
- **_links** (Map of String)
8282
- **allow_merge_on_skipped_pipeline** (Boolean)
83+
- **analytics_access_level** (String)
8384
- **approvals_before_merge** (Number)
8485
- **archived** (Boolean)
86+
- **auto_cancel_pending_pipelines** (String)
87+
- **auto_devops_deploy_strategy** (String)
88+
- **auto_devops_enabled** (Boolean)
89+
- **autoclose_referenced_issues** (Boolean)
8590
- **avatar_url** (String)
8691
- **build_coverage_regex** (String)
92+
- **build_git_strategy** (String)
93+
- **build_timeout** (Number)
94+
- **builds_access_level** (String)
8795
- **ci_config_path** (String)
8896
- **ci_forward_deployment_enabled** (Boolean)
97+
- **container_expiration_policy** (List of Object) (see [below for nested schema](#nestedobjatt--projects--container_expiration_policy))
98+
- **container_registry_access_level** (String)
8999
- **container_registry_enabled** (Boolean)
90100
- **created_at** (String)
91101
- **creator_id** (Number)
92102
- **custom_attributes** (List of Map of String)
93103
- **default_branch** (String)
94104
- **description** (String)
105+
- **emails_disabled** (Boolean)
106+
- **external_authorization_classification_label** (String)
95107
- **forked_from_project** (List of Object) (see [below for nested schema](#nestedobjatt--projects--forked_from_project))
108+
- **forking_access_level** (String)
96109
- **forks_count** (Number)
97110
- **http_url_to_repo** (String)
98111
- **id** (Number)
99112
- **import_error** (String)
100113
- **import_status** (String)
114+
- **issues_access_level** (String)
101115
- **issues_enabled** (Boolean)
102116
- **jobs_enabled** (Boolean)
103117
- **last_activity_at** (String)
104118
- **lfs_enabled** (Boolean)
119+
- **merge_commit_template** (String)
105120
- **merge_method** (String)
106121
- **merge_pipelines_enabled** (Boolean)
122+
- **merge_requests_access_level** (String)
107123
- **merge_requests_enabled** (Boolean)
108124
- **merge_trains_enabled** (Boolean)
109125
- **mirror** (Boolean)
@@ -117,6 +133,7 @@ Read-Only:
117133
- **only_allow_merge_if_pipeline_succeeds** (Boolean)
118134
- **only_mirror_protected_branches** (Boolean)
119135
- **open_issues_count** (Number)
136+
- **operations_access_level** (String)
120137
- **owner** (List of Object) (see [below for nested schema](#nestedobjatt--projects--owner))
121138
- **packages_enabled** (Boolean)
122139
- **path** (String)
@@ -125,20 +142,42 @@ Read-Only:
125142
- **public** (Boolean)
126143
- **public_builds** (Boolean)
127144
- **readme_url** (String)
145+
- **repository_access_level** (String)
146+
- **repository_storage** (String)
128147
- **request_access_enabled** (Boolean)
148+
- **requirements_access_level** (String)
129149
- **resolve_outdated_diff_discussions** (Boolean)
130150
- **runners_token** (String)
151+
- **security_and_compliance_access_level** (String)
131152
- **shared_runners_enabled** (Boolean)
132153
- **shared_with_groups** (List of Object) (see [below for nested schema](#nestedobjatt--projects--shared_with_groups))
154+
- **snippets_access_level** (String)
133155
- **snippets_enabled** (Boolean)
156+
- **squash_commit_template** (String)
134157
- **ssh_url_to_repo** (String)
135158
- **star_count** (Number)
136159
- **statistics** (Map of Number)
137160
- **tag_list** (Set of String)
161+
- **topics** (Set of String)
138162
- **visibility** (String)
139163
- **web_url** (String)
164+
- **wiki_access_level** (String)
140165
- **wiki_enabled** (Boolean)
141166

167+
<a id="nestedobjatt--projects--container_expiration_policy"></a>
168+
### Nested Schema for `projects.container_expiration_policy`
169+
170+
Read-Only:
171+
172+
- **cadence** (String)
173+
- **enabled** (Boolean)
174+
- **keep_n** (Number)
175+
- **name_regex_delete** (String)
176+
- **name_regex_keep** (String)
177+
- **next_run_at** (String)
178+
- **older_than** (String)
179+
180+
142181
<a id="nestedobjatt--projects--forked_from_project"></a>
143182
### Nested Schema for `projects.forked_from_project`
144183

docs/resources/project.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,40 @@ resource "gitlab_project" "example-two" {
4949
### Optional
5050

5151
- **allow_merge_on_skipped_pipeline** (Boolean) Set to true if you want to treat skipped pipelines as if they finished with success.
52+
- **analytics_access_level** (String) Set the analytics access level. Valid values are `disabled`, `private`, `enabled`.
5253
- **approvals_before_merge** (Number) Number of merge request approvals required for merging. Default is 0.
5354
- **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.
5455
- **archived** (Boolean) Whether the project is in read-only mode (archived). Repositories can be archived/unarchived by toggling this parameter.
56+
- **auto_cancel_pending_pipelines** (String) Auto-cancel pending pipelines. This isn’t a boolean, but enabled/disabled.
57+
- **auto_devops_deploy_strategy** (String) Auto Deploy strategy. Valid values are `continuous`, `manual`, `timed_incremental`.
58+
- **auto_devops_enabled** (Boolean) Enable Auto DevOps for this project.
59+
- **autoclose_referenced_issues** (Boolean) Set whether auto-closing referenced issues on default branch.
5560
- **build_coverage_regex** (String) Test coverage parsing for the project.
61+
- **build_git_strategy** (String) The Git strategy. Defaults to fetch.
62+
- **build_timeout** (Number) The maximum amount of time, in seconds, that a job can run.
63+
- **builds_access_level** (String) Set the builds access level. Valid values are `disabled`, `private`, `enabled`.
5664
- **ci_config_path** (String) Custom Path to CI config file.
5765
- **ci_forward_deployment_enabled** (Boolean) When a new deployment job starts, skip older deployment jobs that are still pending.
66+
- **container_expiration_policy** (Block List, Max: 1) Set the image cleanup policy for this project. **Note**: this field is sometimes named `container_expiration_policy_attributes` in the GitLab Upstream API. (see [below for nested schema](#nestedblock--container_expiration_policy))
67+
- **container_registry_access_level** (String) Set visibility of container registry, for this project. Valid values are `disabled`, `private`, `enabled`.
5868
- **container_registry_enabled** (Boolean) Enable container registry for the project.
5969
- **default_branch** (String) The default branch for the project.
6070
- **description** (String) A description of the project.
71+
- **emails_disabled** (Boolean) Disable email notifications.
72+
- **external_authorization_classification_label** (String) The classification label for the project.
73+
- **forking_access_level** (String) Set the forking access level. Valid values are `disabled`, `private`, `enabled`.
6174
- **group_with_project_templates_id** (Number) For group-level custom templates, specifies ID of group from which all the custom project templates are sourced. Leave empty for instance-level templates. Requires use_custom_template to be true (enterprise edition).
6275
- **id** (String) The ID of this resource.
6376
- **import_url** (String) Git URL to a repository to be imported.
6477
- **initialize_with_readme** (Boolean) Create main branch with first commit containing a README.md file.
78+
- **issues_access_level** (String) Set the issues access level. Valid values are `disabled`, `private`, `enabled`.
6579
- **issues_enabled** (Boolean) Enable issue tracking for the project.
6680
- **issues_template** (String) Sets the template for new issues in the project.
6781
- **lfs_enabled** (Boolean) Enable LFS for the project.
82+
- **merge_commit_template** (String) Template used to create merge commit message in merge requests. (Introduced in GitLab 14.5.)
6883
- **merge_method** (String) Set to `ff` to create fast-forward merges
6984
- **merge_pipelines_enabled** (Boolean) Enable or disable merge pipelines.
85+
- **merge_requests_access_level** (String) Set the merge requests access level. Valid values are `disabled`, `private`, `enabled`.
7086
- **merge_requests_enabled** (Boolean) Enable merge requests for the project.
7187
- **merge_requests_template** (String) Sets the template for new merge requests in the project.
7288
- **merge_trains_enabled** (Boolean) Enable or disable merge trains. Requires `merge_pipelines_enabled` to be set to `true` to take effect.
@@ -77,22 +93,33 @@ resource "gitlab_project" "example-two" {
7793
- **only_allow_merge_if_all_discussions_are_resolved** (Boolean) Set to true if you want allow merges only if all discussions are resolved.
7894
- **only_allow_merge_if_pipeline_succeeds** (Boolean) Set to true if you want allow merges only if a pipeline succeeds.
7995
- **only_mirror_protected_branches** (Boolean) Enable only mirror protected branches for a mirrored project.
96+
- **operations_access_level** (String) Set the operations access level. Valid values are `disabled`, `private`, `enabled`.
8097
- **packages_enabled** (Boolean) Enable packages repository for the project.
8198
- **pages_access_level** (String) Enable pages access control
8299
- **path** (String) The path of the repository.
83100
- **pipelines_enabled** (Boolean) Enable pipelines for the project.
84101
- **printing_merge_request_link_enabled** (Boolean) Show link to create/view merge request when pushing from the command line
102+
- **public_builds** (Boolean) If true, jobs can be viewed by non-project members.
85103
- **push_rules** (Block List, Max: 1) Push rules for the project. (see [below for nested schema](#nestedblock--push_rules))
86104
- **remove_source_branch_after_merge** (Boolean) Enable `Delete source branch` option by default for all new merge requests.
105+
- **repository_access_level** (String) Set the repository access level. Valid values are `disabled`, `private`, `enabled`.
106+
- **repository_storage** (String) Which storage shard the repository is on. (administrator only)
87107
- **request_access_enabled** (Boolean) Allow users to request member access.
108+
- **requirements_access_level** (String) Set the requirements access level. Valid values are `disabled`, `private`, `enabled`.
109+
- **resolve_outdated_diff_discussions** (Boolean) Automatically resolve merge request diffs discussions on lines changed with a push.
110+
- **security_and_compliance_access_level** (String) Set the security and compliance access level. Valid values are `disabled`, `private`, `enabled`.
88111
- **shared_runners_enabled** (Boolean) Enable shared runners for this project.
112+
- **snippets_access_level** (String) Set the snippets access level. Valid values are `disabled`, `private`, `enabled`.
89113
- **snippets_enabled** (Boolean) Enable snippets for the project.
114+
- **squash_commit_template** (String) Template used to create squash commit message in merge requests. (Introduced in GitLab 14.6.)
90115
- **squash_option** (String) Squash commits when merge request. Valid values are `never`, `always`, `default_on`, or `default_off`. The default value is `default_off`. [GitLab >= 14.1]
91-
- **tags** (Set of String) Tags (topics) of the project.
116+
- **tags** (Set of String) The list of tags for a project; put array of tags, that should be finally assigned to a project. Use topics instead.
92117
- **template_name** (String) When used without use_custom_template, name of a built-in project template. When used with use_custom_template, name of a custom project template. This option is mutually exclusive with `template_project_id`.
93118
- **template_project_id** (Number) When used with use_custom_template, project ID of a custom project template. This is preferable to using template_name since template_name may be ambiguous (enterprise edition). This option is mutually exclusive with `template_name`.
119+
- **topics** (Set of String) The list of topics for the project.
94120
- **use_custom_template** (Boolean) Use either custom instance or group (with group_with_project_templates_id) project template (enterprise edition).
95121
- **visibility_level** (String) Set to `public` to create a public project.
122+
- **wiki_access_level** (String) Set the wiki access level. Valid values are `disabled`, `private`, `enabled`.
96123
- **wiki_enabled** (Boolean) Enable wiki for the project.
97124

98125
### Read-Only
@@ -103,6 +130,23 @@ resource "gitlab_project" "example-two" {
103130
- **ssh_url_to_repo** (String) URL that can be provided to `git clone` to clone the
104131
- **web_url** (String) URL that can be used to find the project in a browser.
105132

133+
<a id="nestedblock--container_expiration_policy"></a>
134+
### Nested Schema for `container_expiration_policy`
135+
136+
Optional:
137+
138+
- **cadence** (String) The cadence of the policy. Valid values are: `1d`, `7d`, `14d`, `1month`, `3month`.
139+
- **enabled** (Boolean) If true, the policy is enabled.
140+
- **keep_n** (Number) The number of images to keep.
141+
- **name_regex_delete** (String) The regular expression to match image names to delete. **Note**: the upstream API has some inconsistencies with the `name_regex` field here. It's basically unusable at the moment.
142+
- **name_regex_keep** (String) The regular expression to match image names to keep.
143+
- **older_than** (String) The number of days to keep images.
144+
145+
Read-Only:
146+
147+
- **next_run_at** (String) The next time the policy will run.
148+
149+
106150
<a id="nestedblock--push_rules"></a>
107151
### Nested Schema for `push_rules`
108152

0 commit comments

Comments
 (0)