Skip to content

Commit c59413d

Browse files
authored
Merge pull request #1145 from timofurrer/feature/prat-owner
Add `owner` as possible value to `access_level` attribute in some project resources
2 parents 40a06bf + 4e3f188 commit c59413d

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

docs/resources/project_access_token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ resource "gitlab_project_variable" "example" {
4343

4444
### Optional
4545

46-
- `access_level` (String) The access level for the project access token. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `master`. Default is `maintainer`.
46+
- `access_level` (String) The access level for the project access token. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `owner`, `master`. Default is `maintainer`.
4747
- `expires_at` (String) Time the token will expire it, YYYY-MM-DD format. Will not expire per default.
4848

4949
### Read-Only

docs/resources/project_membership.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ resource "gitlab_project_membership" "example" {
3838

3939
### Required
4040

41-
- `access_level` (String) The access level for the member. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `master`
41+
- `access_level` (String) The access level for the member. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `owner`, `master`
4242
- `project_id` (String) The id of the project.
4343
- `user_id` (Number) The id of the user.
4444

docs/resources/project_share_group.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ resource "gitlab_project_share_group" "test" {
3333

3434
### Optional
3535

36-
- `access_level` (String, Deprecated) The access level to grant the group for the project. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `master`
37-
- `group_access` (String) The access level to grant the group for the project. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `master`
36+
- `access_level` (String, Deprecated) The access level to grant the group for the project. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `owner`, `master`
37+
- `group_access` (String) The access level to grant the group for the project. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `owner`, `master`
3838

3939
### Read-Only
4040

internal/provider/access_level_helpers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var validProjectAccessLevelNames = []string{
3737
"reporter",
3838
"developer",
3939
"maintainer",
40+
"owner",
4041

4142
// Deprecated and should be removed in v4 of this provider
4243
"master",

internal/provider/resource_gitlab_project_access_token_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,26 @@ func TestAccGitlabProjectAccessToken_basic(t *testing.T) {
7575
// The token is only known during creating. We explicitly mention this limitation in the docs.
7676
ImportStateVerifyIgnore: []string{"token"},
7777
},
78+
// Recreate with `owner` access level.
79+
{
80+
Config: fmt.Sprintf(`
81+
resource "gitlab_project_access_token" "foo" {
82+
project = %d
83+
name = "foo"
84+
scopes = ["api", "read_api", "read_repository", "write_repository"]
85+
access_level = "owner"
86+
expires_at = %q
87+
}
88+
`, project.ID, time.Now().Add(time.Hour*48).Format("2006-01-02")),
89+
},
90+
// Verify upstream resource with an import.
91+
{
92+
ResourceName: "gitlab_project_access_token.foo",
93+
ImportState: true,
94+
ImportStateVerify: true,
95+
// The token is only known during creating. We explicitly mention this limitation in the docs.
96+
ImportStateVerifyIgnore: []string{"token"},
97+
},
7898
},
7999
})
80100
}

0 commit comments

Comments
 (0)