Skip to content

Commit f654ee5

Browse files
committed
Merge branch 'main' of github.com:Moon1706/terraform-provider-gitlab into main
2 parents e919cdb + fdde2f2 commit f654ee5

File tree

110 files changed

+752
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+752
-436
lines changed

.github/workflows/issue-opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# This prevents the needs-triage label from being added.
2626
- uses: actions/checkout@v3
2727
if: ${{ failure() }}
28-
- uses: github/issue-labeler@v2.4
28+
- uses: github/issue-labeler@v2.5
2929
if: ${{ failure() }}
3030
with:
3131
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/pr-lint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
matrix:
2929
target:
3030
- lint-golangci
31-
- lint-tfprovider
3231
- lint-examples-tf
3332
- lint-examples-sh
3433
- lint-generated

.github/workflows/push.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
matrix:
4141
target:
4242
- lint-golangci
43-
- lint-tfprovider
4443
- lint-examples-tf
4544
- lint-examples-sh
4645
- lint-generated

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.16
1+
1.17

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ run:
44
timeout: 3m
55

66
linters-settings:
7+
custom:
8+
tfproviderlint:
9+
path: ./bin/tfproviderlint-plugin.so
10+
description: "Terraform Provider Lint Tool"
11+
original-url: https://github.com/bflad/tfproviderlint
712
errcheck:
813
exclude: errcheck_excludes.txt
914

1015
linters:
1116
enable:
1217
- gofmt
1318
- govet
19+
- tfproviderlint

.vscode/settings.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"go.testEnvVars": {
3-
"TF_ACC": "1",
4-
"GITLAB_TOKEN": "ACCTEST1234567890123",
5-
"GITLAB_BASE_URL": "http://127.0.0.1:8080"
6-
},
7-
"go.testFlags": ["-count=1", "-v", "-timeout=30m"]
2+
"go.testEnvVars": {
3+
"TF_ACC": "1",
4+
"GITLAB_TOKEN": "ACCTEST1234567890123",
5+
"GITLAB_BASE_URL": "http://127.0.0.1:8080"
6+
},
7+
"go.testFlags": ["-count=1", "-v", "-tags=acceptance", "-tags=acceptance"]
88
}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Documentation in [/docs](/docs) is auto-generated by [terraform-plugin-docs](htt
6262

6363
### Set Up Your Local Environment
6464

65-
You'll first need [Go](http://www.golang.org) installed on your machine (version 1.16+ is *required*).
65+
You'll first need [Go](http://www.golang.org) installed on your machine (version 1.17+ is *required*).
6666

6767
1. Clone the git repository.
6868

GNUmakefile

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,14 @@ endif
2121
test: ## Run unit tests.
2222
go test $(TESTARGS) $(PROVIDER_SRC_DIR)
2323

24-
TFPROVIDERLINTX_CHECKS = -XAT001=false -XR003=false -XS002=false
25-
26-
fmt: tool-golangci-lint tool-tfproviderlintx tool-terraform tool-shfmt ## Format files and fix issues.
24+
fmt: tool-golangci-lint tool-terraform tool-shfmt tfproviderlint-plugin ## Format files and fix issues.
2725
gofmt -w -s .
28-
$(GOBIN)/golangci-lint run --fix
29-
$(GOBIN)/tfproviderlintx $(TFPROVIDERLINTX_CHECKS) --fix ./...
26+
$(GOBIN)/golangci-lint run --build-tags acceptance --fix
3027
$(GOBIN)/terraform fmt -recursive -list ./examples
3128
$(GOBIN)/shfmt -l -s -w ./examples
3229

33-
lint-golangci: tool-golangci-lint ## Run golangci-lint linter (same as fmt but without modifying files).
34-
$(GOBIN)/golangci-lint run
35-
36-
lint-tfprovider: tool-tfproviderlintx ## Run tfproviderlintx linter (same as fmt but without modifying files).
37-
$(GOBIN)/tfproviderlintx $(TFPROVIDERLINTX_CHECKS) ./...
30+
lint-golangci: tool-golangci-lint tfproviderlint-plugin ## Run golangci-lint linter (same as fmt but without modifying files).
31+
$(GOBIN)/golangci-lint run --build-tags acceptance
3832

3933
lint-examples-tf: tool-terraform ## Run terraform linter on examples (same as fmt but without modifying files).
4034
$(GOBIN)/terraform fmt -recursive -check ./examples
@@ -73,7 +67,7 @@ testacc-down: ## Teardown a GitLab instance.
7367
docker-compose down --volumes
7468

7569
testacc: ## Run acceptance tests against a GitLab instance.
76-
TF_ACC=1 GITLAB_TOKEN=$(GITLAB_TOKEN) GITLAB_BASE_URL=$(GITLAB_BASE_URL) go test -v $(PROVIDER_SRC_DIR) $(TESTARGS) -timeout 40m
70+
TF_ACC=1 GITLAB_TOKEN=$(GITLAB_TOKEN) GITLAB_BASE_URL=$(GITLAB_BASE_URL) go test --tags acceptance -v $(PROVIDER_SRC_DIR) $(TESTARGS) -timeout 40m
7771

7872
certs: ## Generate certs for the GitLab container registry
7973
mkdir -p certs
@@ -85,9 +79,6 @@ certs: ## Generate certs for the GitLab container registry
8579
tool-golangci-lint:
8680
@$(call install-tool, github.com/golangci/golangci-lint/cmd/golangci-lint)
8781

88-
tool-tfproviderlintx:
89-
@$(call install-tool, github.com/bflad/tfproviderlint/cmd/tfproviderlintx)
90-
9182
tool-tfplugindocs:
9283
@$(call install-tool, github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs)
9384

@@ -110,4 +101,7 @@ tool-terraform:
110101
@[ -f $(GOBIN)/terraform ] || { mkdir -p tmp; cd tmp; rm -rf terraform; git clone --branch $(TERRAFORM_VERSION) --depth 1 https://github.com/hashicorp/terraform.git; cd terraform; GOBIN=$(GOBIN) go install; cd ..; rm -rf terraform; }
111102

112103
clean: testacc-down
113-
@rm -rf certs/
104+
@rm -rf certs/
105+
106+
tfproviderlint-plugin:
107+
@cd tools && go build -buildmode=plugin -o $(GOBIN)/tfproviderlint-plugin.so ./cmd/tfproviderlint-plugin

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@ GitLab resources, like users, groups and projects.
1717
## Contributing
1818

1919
Check out the [CONTRIBUTING.md](/CONTRIBUTING.md) guide for tips on how to contribute and develop the provider.
20+
21+
## Community
22+
23+
You are welcome to join our [Discord Server](https://discord.gg/CCc6Pe5EYy) or the monthly community hours:
24+
25+
- [Google Calendar signup](https://calendar.google.com/event?action=TEMPLATE&tmeid=MnZyN2owdmYxaDdiMWdjNGdoMzQ3bWM0dDlfMjAyMjA0MjdUMTQzMDAwWiBjXzh0bjczaDNjYW5mam1zY2pwamJqNjFpNDVrQGc&tmsrc=c_8tn73h3canfjmscjpjbj61i45k%40group.calendar.google.com&scp=ALL )
26+
- [Recordings](https://www.youtube.com/playlist?list=PL05JrBw4t0KrMncKb6v9S0wB_liBky39P)
27+
- [Notes](https://docs.google.com/document/d/1-rgmylTUlO2lPRmbmGk0aB-mktg8nYu0NxOkFw9bo_M/edit#)

docs/data-sources/group_variable.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,21 @@ The `gitlab_group_variable` data source allows to retrieve details about a group
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/group_level_variables.html)
1515

16-
16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_group_variable" "foo" {
20+
group = "my/example/group"
21+
key = "foo"
22+
}
23+
24+
# Using an environment scope
25+
data "gitlab_group_variable" "bar" {
26+
group = "my/example/group"
27+
key = "bar"
28+
environment_scope = "staging/*"
29+
}
30+
```
1731

1832
<!-- schema generated by tfplugindocs -->
1933
## Schema

docs/data-sources/group_variables.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@ The `gitlab_group_variables` data source allows to retrieve all group-level CI/C
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/group_level_variables.html)
1515

16-
16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_group_variables" "vars" {
20+
group = "my/example/group"
21+
}
22+
23+
# Using an environment scope
24+
data "gitlab_group_variables" "staging_vars" {
25+
group = "my/example/group"
26+
environment_scope = "staging/*"
27+
}
28+
```
1729

1830
<!-- schema generated by tfplugindocs -->
1931
## Schema

docs/data-sources/instance_variable.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ The `gitlab_instance_variable` data source allows to retrieve details about an i
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/instance_level_ci_variables.html)
1515

16+
## Example Usage
1617

18+
```terraform
19+
data "gitlab_instance_variable" "foo" {
20+
key = "foo"
21+
}
22+
```
1723

1824
<!-- schema generated by tfplugindocs -->
1925
## Schema

docs/data-sources/instance_variables.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ The `gitlab_instance_variables` data source allows to retrieve all instance-leve
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/instance_level_ci_variables.html)
1515

16+
## Example Usage
1617

18+
```terraform
19+
data "gitlab_instance_variables" "vars" {}
20+
```
1721

1822
<!-- schema generated by tfplugindocs -->
1923
## Schema

docs/data-sources/project_variable.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,21 @@ The `gitlab_project_variable` data source allows to retrieve details about a pro
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/project_level_variables.html)
1515

16-
16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_project_variable" "foo" {
20+
project = "my/example/project"
21+
key = "foo"
22+
}
23+
24+
# Using an environment scope
25+
data "gitlab_project_variable" "bar" {
26+
project = "my/example/project"
27+
key = "bar"
28+
environment_scope = "staging/*"
29+
}
30+
```
1731

1832
<!-- schema generated by tfplugindocs -->
1933
## Schema

docs/data-sources/project_variables.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@ The `gitlab_project_variables` data source allows to retrieve all project-level
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/project_level_variables.html)
1515

16-
16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_project_variables" "vars" {
20+
project = "my/example/project"
21+
}
22+
23+
# Using an environment scope
24+
data "gitlab_project_variables" "staging_vars" {
25+
project = "my/example/project"
26+
environment_scope = "staging/*"
27+
}
28+
```
1729

1830
<!-- schema generated by tfplugindocs -->
1931
## Schema

docs/resources/group_share_group.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ resource "gitlab_group_share_group" "test" {
3030
### Required
3131

3232
- `group_access` (String) The access level to grant the group. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `owner`, `master`
33-
- `group_id` (String) The id of the main group.
34-
- `share_group_id` (Number) The id of an additional group which will be shared with the main group.
33+
- `group_id` (String) The id of the main group to be shared.
34+
- `share_group_id` (Number) The id of the additional group with which the main group will be shared.
3535

3636
### Optional
3737

docs/resources/project_issue.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ output "welcome_issue_web_url" {
5454
### Optional
5555

5656
- `assignee_ids` (Set of Number) The IDs of the users to assign the issue to.
57-
- `closed_at` (String) When the issue was closed. Date time string, ISO 8601 formatted, for example 2016-03-11T03:45:40Z.
58-
- `closed_by_user_id` (Number) The ID of the user that closed the issue. Use `gitlab_user` data source to get more information about the user.
5957
- `confidential` (Boolean) Set an issue to be confidential.
6058
- `created_at` (String) When the issue was created. Date time string, ISO 8601 formatted, for example 2016-03-11T03:45:40Z. Requires administrator or project/group owner rights.
6159
- `delete_on_destroy` (Boolean) Whether the issue is deleted instead of closed during destroy.
@@ -65,45 +63,47 @@ output "welcome_issue_web_url" {
6563
- `due_date` (String) The due date. Date time string in the format YYYY-MM-DD, for example 2016-03-11.
6664
**Note:** removing a due date is currently not supported, see https://github.com/xanzy/go-gitlab/issues/1384 for details.
6765
- `epic_issue_id` (Number) The ID of the epic issue.
68-
- `human_time_estimate` (String) The human-readable time estimate of the issue.
69-
- `human_total_time_spent` (String) The human-readable total time spent of the issue.
7066
- `iid` (Number) The internal ID of the project's issue.
7167
- `issue_type` (String) The type of issue. Valid values are: `issue`, `incident`, `test_case`.
7268
- `labels` (Set of String) The labels of an issue.
73-
- `links` (Map of String) The links of the issue.
7469
- `merge_request_to_resolve_discussions_of` (Number) The IID of a merge request in which to resolve all issues. This fills out the issue with a default description and mark all discussions as resolved. When passing a description or title, these values take precedence over the default values.
7570
- `milestone_id` (Number) The global ID of a milestone to assign issue. To find the milestone_id associated with a milestone, view an issue with the milestone assigned and use the API to retrieve the issue's details.
76-
- `references` (Map of String) The references of the issue.
7771
- `state` (String) The state of the issue. Valid values are: `opened`, `closed`.
78-
- `task_completion_status` (Block List, Max: 1) The task completion status. It's always a one element list. (see [below for nested schema](#nestedblock--task_completion_status))
79-
- `time_estimate` (Number) The time estimate of the issue.
80-
- `total_time_spent` (Number) The total time spent of the issue.
8172
- `updated_at` (String) When the issue was updated. Date time string, ISO 8601 formatted, for example 2016-03-11T03:45:40Z.
8273
- `weight` (Number) The weight of the issue. Valid values are greater than or equal to 0.
8374

8475
### Read-Only
8576

8677
- `author_id` (Number) The ID of the author of the issue. Use `gitlab_user` data source to get more information about the user.
78+
- `closed_at` (String) When the issue was closed. Date time string, ISO 8601 formatted, for example 2016-03-11T03:45:40Z.
79+
- `closed_by_user_id` (Number) The ID of the user that closed the issue. Use `gitlab_user` data source to get more information about the user.
8780
- `downvotes` (Number) The number of downvotes the issue has received.
8881
- `epic_id` (Number) ID of the epic to add the issue to. Valid values are greater than or equal to 0.
8982
- `external_id` (String) The external ID of the issue.
83+
- `human_time_estimate` (String) The human-readable time estimate of the issue.
84+
- `human_total_time_spent` (String) The human-readable total time spent of the issue.
9085
- `id` (String) The ID of this resource.
9186
- `issue_id` (Number) The instance-wide ID of the issue.
9287
- `issue_link_id` (Number) The ID of the issue link.
88+
- `links` (Map of String) The links of the issue.
9389
- `merge_requests_count` (Number) The number of merge requests associated with the issue.
9490
- `moved_to_id` (Number) The ID of the issue that was moved to.
91+
- `references` (Map of String) The references of the issue.
9592
- `subscribed` (Boolean) Whether the authenticated user is subscribed to the issue or not.
93+
- `task_completion_status` (List of Object) The task completion status. It's always a one element list. (see [below for nested schema](#nestedatt--task_completion_status))
94+
- `time_estimate` (Number) The time estimate of the issue.
95+
- `total_time_spent` (Number) The total time spent of the issue.
9696
- `upvotes` (Number) The number of upvotes the issue has received.
9797
- `user_notes_count` (Number) The number of user notes on the issue.
9898
- `web_url` (String) The web URL of the issue.
9999

100-
<a id="nestedblock--task_completion_status"></a>
100+
<a id="nestedatt--task_completion_status"></a>
101101
### Nested Schema for `task_completion_status`
102102

103-
Optional:
103+
Read-Only:
104104

105-
- `completed_count` (Number) The number of tasks that are completed.
106-
- `count` (Number) The number of tasks.
105+
- `completed_count` (Number)
106+
- `count` (Number)
107107

108108
## Import
109109

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
data "gitlab_group_variable" "foo" {
2+
group = "my/example/group"
3+
key = "foo"
4+
}
5+
6+
# Using an environment scope
7+
data "gitlab_group_variable" "bar" {
8+
group = "my/example/group"
9+
key = "bar"
10+
environment_scope = "staging/*"
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
data "gitlab_group_variables" "vars" {
2+
group = "my/example/group"
3+
}
4+
5+
# Using an environment scope
6+
data "gitlab_group_variables" "staging_vars" {
7+
group = "my/example/group"
8+
environment_scope = "staging/*"
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "gitlab_instance_variable" "foo" {
2+
key = "foo"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data "gitlab_instance_variables" "vars" {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
data "gitlab_project_variable" "foo" {
2+
project = "my/example/project"
3+
key = "foo"
4+
}
5+
6+
# Using an environment scope
7+
data "gitlab_project_variable" "bar" {
8+
project = "my/example/project"
9+
key = "bar"
10+
environment_scope = "staging/*"
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
data "gitlab_project_variables" "vars" {
2+
project = "my/example/project"
3+
}
4+
5+
# Using an environment scope
6+
data "gitlab_project_variables" "staging_vars" {
7+
project = "my/example/project"
8+
environment_scope = "staging/*"
9+
}

0 commit comments

Comments
 (0)