Skip to content

Commit 275a5cb

Browse files
committed
resource/gitlab_project_issue: Remove Optional from Computed-only attributes
Some attributes were mistakenly marked as `Optional`, but they are `Computed`-only. See #1080
1 parent 5c1b525 commit 275a5cb

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

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

internal/provider/schema_gitlab_project_issue.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,13 @@ func gitlabProjectIssueGetSchema() map[string]*schema.Schema {
152152
Description: "When the issue was closed. Date time string, ISO 8601 formatted, for example 2016-03-11T03:45:40Z.",
153153
Type: schema.TypeString,
154154
Computed: true,
155-
Optional: true,
156155
},
157156
// NOTE: to keep things simple, users of this resource should use the `gitlab_user` data source to
158157
// get more information about the closer if desired.
159158
"closed_by_user_id": {
160159
Description: "The ID of the user that closed the issue. Use `gitlab_user` data source to get more information about the user.",
161160
Type: schema.TypeInt,
162161
Computed: true,
163-
Optional: true,
164162
},
165163
"moved_to_id": {
166164
Description: "The ID of the issue that was moved to.",
@@ -187,33 +185,28 @@ func gitlabProjectIssueGetSchema() map[string]*schema.Schema {
187185
Type: schema.TypeMap,
188186
Elem: &schema.Schema{Type: schema.TypeString},
189187
Computed: true,
190-
Optional: true,
191188
},
192189
// NOTE(TF): these are from the `time_stats` field.
193190
// Clarify what to do with nested types.
194191
"time_estimate": {
195192
Description: "The time estimate of the issue.",
196193
Type: schema.TypeInt,
197194
Computed: true,
198-
Optional: true,
199195
},
200196
"total_time_spent": {
201197
Description: "The total time spent of the issue.",
202198
Type: schema.TypeInt,
203199
Computed: true,
204-
Optional: true,
205200
},
206201
"human_time_estimate": {
207202
Description: "The human-readable time estimate of the issue.",
208203
Type: schema.TypeString,
209204
Computed: true,
210-
Optional: true,
211205
},
212206
"human_total_time_spent": {
213207
Description: "The human-readable total time spent of the issue.",
214208
Type: schema.TypeString,
215209
Computed: true,
216-
Optional: true,
217210
},
218211
// NOTE(TF): end `time_stats`
219212
// NOTE: not part of `CREATE`, but part of `UPDATE`
@@ -237,7 +230,6 @@ func gitlabProjectIssueGetSchema() map[string]*schema.Schema {
237230
Type: schema.TypeMap,
238231
Elem: &schema.Schema{Type: schema.TypeString},
239232
Computed: true,
240-
Optional: true,
241233
},
242234
"issue_link_id": {
243235
Description: "The ID of the issue link.",
@@ -258,9 +250,7 @@ func gitlabProjectIssueGetSchema() map[string]*schema.Schema {
258250
"task_completion_status": {
259251
Description: "The task completion status. It's always a one element list.",
260252
Type: schema.TypeList,
261-
MaxItems: 1,
262253
Computed: true,
263-
Optional: true,
264254
Elem: &schema.Resource{
265255
Schema: map[string]*schema.Schema{
266256
"count": {

0 commit comments

Comments
 (0)