Skip to content

Commit 526d83f

Browse files
committed
datasource/gitlab_projects: Add many missing attributes
1 parent 452aba9 commit 526d83f

File tree

2 files changed

+192
-0
lines changed

2 files changed

+192
-0
lines changed

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

internal/provider/data_source_gitlab_projects.go

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,31 @@ func flattenProjects(projects []*gitlab.Project) (values []map[string]interface{
167167
"ci_forward_deployment_enabled": project.CIForwardDeploymentEnabled,
168168
"merge_pipelines_enabled": project.MergePipelinesEnabled,
169169
"merge_trains_enabled": project.MergeTrainsEnabled,
170+
"analytics_access_level": string(project.AnalyticsAccessLevel),
171+
"auto_cancel_pending_pipelines": project.AutoCancelPendingPipelines,
172+
"auto_devops_deploy_strategy": project.AutoDevopsDeployStrategy,
173+
"auto_devops_enabled": project.AutoDevopsEnabled,
174+
"autoclose_referenced_issues": project.AutocloseReferencedIssues,
175+
"build_git_strategy": project.BuildGitStrategy,
176+
"build_timeout": project.BuildTimeout,
177+
"builds_access_level": string(project.BuildsAccessLevel),
178+
"container_expiration_policy": flattenContainerExpirationPolicy(project.ContainerExpirationPolicy),
179+
"container_registry_access_level": string(project.ContainerRegistryAccessLevel),
180+
"emails_disabled": project.EmailsDisabled,
181+
"external_authorization_classification_label": project.ExternalAuthorizationClassificationLabel,
182+
"forking_access_level": string(project.ForkingAccessLevel),
183+
"issues_access_level": string(project.IssuesAccessLevel),
184+
"merge_requests_access_level": string(project.MergeRequestsAccessLevel),
185+
"operations_access_level": string(project.OperationsAccessLevel),
186+
"repository_access_level": string(project.RepositoryAccessLevel),
187+
"repository_storage": project.RepositoryStorage,
188+
"requirements_access_level": string(project.RequirementsAccessLevel),
189+
"security_and_compliance_access_level": string(project.SecurityAndComplianceAccessLevel),
190+
"snippets_access_level": string(project.SnippetsAccessLevel),
191+
"topics": project.Topics,
192+
"wiki_access_level": string(project.WikiAccessLevel),
193+
"squash_commit_template": project.SquashCommitTemplate,
194+
"merge_commit_template": project.MergeCommitTemplate,
170195
}
171196
values = append(values, v)
172197
}
@@ -793,6 +818,134 @@ var _ = registerDataSource("gitlab_projects", func() *schema.Resource {
793818
Type: schema.TypeBool,
794819
Computed: true,
795820
},
821+
"analytics_access_level": {
822+
Description: fmt.Sprintf("Set the analytics access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
823+
Type: schema.TypeString,
824+
Computed: true,
825+
},
826+
"auto_cancel_pending_pipelines": {
827+
Description: "Auto-cancel pending pipelines. This isn’t a boolean, but enabled/disabled.",
828+
Type: schema.TypeString,
829+
Computed: true,
830+
},
831+
"auto_devops_deploy_strategy": {
832+
Description: fmt.Sprintf("Auto Deploy strategy. Valid values are %s.", renderValueListForDocs(validProjectAutoDevOpsDeployStrategyValues)),
833+
Type: schema.TypeString,
834+
Computed: true,
835+
},
836+
"auto_devops_enabled": {
837+
Description: "Enable Auto DevOps for this project.",
838+
Type: schema.TypeBool,
839+
Computed: true,
840+
},
841+
"autoclose_referenced_issues": {
842+
Description: "Set whether auto-closing referenced issues on default branch.",
843+
Type: schema.TypeBool,
844+
Computed: true,
845+
},
846+
"build_git_strategy": {
847+
Description: "The Git strategy. Defaults to fetch.",
848+
Type: schema.TypeString,
849+
Computed: true,
850+
},
851+
"build_timeout": {
852+
Description: "The maximum amount of time, in seconds, that a job can run.",
853+
Type: schema.TypeInt,
854+
Computed: true,
855+
},
856+
"builds_access_level": {
857+
Description: fmt.Sprintf("Set the builds access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
858+
Type: schema.TypeString,
859+
Computed: true,
860+
},
861+
"container_expiration_policy": {
862+
Description: "Set the image cleanup policy for this project. **Note**: this field is sometimes named `container_expiration_policy_attributes` in the GitLab Upstream API.",
863+
Type: schema.TypeList,
864+
Elem: containerExpirationPolicyAttributesSchema,
865+
Computed: true,
866+
},
867+
"container_registry_access_level": {
868+
Description: fmt.Sprintf("Set visibility of container registry, for this project. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
869+
Type: schema.TypeString,
870+
Computed: true,
871+
},
872+
"emails_disabled": {
873+
Description: "Disable email notifications.",
874+
Type: schema.TypeBool,
875+
Computed: true,
876+
},
877+
"external_authorization_classification_label": {
878+
Description: "The classification label for the project.",
879+
Type: schema.TypeString,
880+
Computed: true,
881+
},
882+
"forking_access_level": {
883+
Description: fmt.Sprintf("Set the forking access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
884+
Type: schema.TypeString,
885+
Computed: true,
886+
},
887+
"issues_access_level": {
888+
Description: fmt.Sprintf("Set the issues access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
889+
Type: schema.TypeString,
890+
Computed: true,
891+
},
892+
"merge_requests_access_level": {
893+
Description: fmt.Sprintf("Set the merge requests access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
894+
Type: schema.TypeString,
895+
Computed: true,
896+
},
897+
"operations_access_level": {
898+
Description: fmt.Sprintf("Set the operations access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
899+
Type: schema.TypeString,
900+
Computed: true,
901+
},
902+
"repository_access_level": {
903+
Description: fmt.Sprintf("Set the repository access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
904+
Type: schema.TypeString,
905+
Computed: true,
906+
},
907+
"repository_storage": {
908+
Description: " Which storage shard the repository is on. (administrator only)",
909+
Type: schema.TypeString,
910+
Computed: true,
911+
},
912+
"requirements_access_level": {
913+
Description: fmt.Sprintf("Set the requirements access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
914+
Type: schema.TypeString,
915+
Computed: true,
916+
},
917+
"security_and_compliance_access_level": {
918+
Description: fmt.Sprintf("Set the security and compliance access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
919+
Type: schema.TypeString,
920+
Computed: true,
921+
},
922+
"snippets_access_level": {
923+
Description: fmt.Sprintf("Set the snippets access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
924+
Type: schema.TypeString,
925+
Computed: true,
926+
},
927+
"topics": {
928+
Description: "The list of topics for the project.",
929+
Type: schema.TypeSet,
930+
Set: schema.HashString,
931+
Elem: &schema.Schema{Type: schema.TypeString},
932+
Computed: true,
933+
},
934+
"wiki_access_level": {
935+
Description: fmt.Sprintf("Set the wiki access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),
936+
Type: schema.TypeString,
937+
Computed: true,
938+
},
939+
"squash_commit_template": {
940+
Description: "Template used to create squash commit message in merge requests. (Introduced in GitLab 14.6.)",
941+
Type: schema.TypeString,
942+
Computed: true,
943+
},
944+
"merge_commit_template": {
945+
Description: "Template used to create merge commit message in merge requests. (Introduced in GitLab 14.5.)",
946+
Type: schema.TypeString,
947+
Computed: true,
948+
},
796949
},
797950
},
798951
},

0 commit comments

Comments
 (0)