Skip to content

Commit 1dafd39

Browse files
ei-gradclaude
andcommitted
fix: Remove Optional from etag fields per review feedback
etag is server-computed and should not be user-editable. Remove Optional: true from all etag schema fields (both the 22 new ones and the 7 from PR #2840) and update the unit test accordingly. Co-Authored-By: Claude <[email protected]>
1 parent 23a52ec commit 1dafd39

30 files changed

Lines changed: 1 addition & 33 deletions

github/resource_github_actions_runner_group.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ func resourceGithubActionsRunnerGroup() *schema.Resource {
4242
},
4343
"etag": {
4444
Type: schema.TypeString,
45-
Optional: true,
4645
Computed: true,
4746
Description: "An etag representing the runner group object",
4847
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {

github/resource_github_branch.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ func resourceGithubBranch() *schema.Resource {
5050
},
5151
"etag": {
5252
Type: schema.TypeString,
53-
Optional: true,
5453
Computed: true,
5554
Description: "An etag representing the Branch object.",
5655
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {

github/resource_github_branch_default.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func resourceGithubBranchDefault() *schema.Resource {
4040
},
4141
"etag": {
4242
Type: schema.TypeString,
43-
Optional: true,
4443
Computed: true,
4544
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {
4645
return true

github/resource_github_branch_protection_v3.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ func resourceGithubBranchProtectionV3() *schema.Resource {
213213
},
214214
"etag": {
215215
Type: schema.TypeString,
216-
Optional: true,
217216
Computed: true,
218217
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {
219218
return true

github/resource_github_emu_group_mapping.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func resourceGithubEMUGroupMapping() *schema.Resource {
4646
},
4747
"etag": {
4848
Type: schema.TypeString,
49-
Optional: true,
5049
Computed: true,
5150
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {
5251
return true

github/resource_github_enterprise_actions_runner_group.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func resourceGithubActionsEnterpriseRunnerGroup() *schema.Resource {
4343
},
4444
"etag": {
4545
Type: schema.TypeString,
46-
Optional: true,
4746
Computed: true,
4847
Description: "An etag representing the runner group object",
4948
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {

github/resource_github_etag_unit_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,7 @@ func TestEtagSchemaConsistency(t *testing.T) {
113113
return
114114
}
115115

116-
// Verify etag is optional and computed
117-
if !etagField.Optional {
118-
t.Errorf("etag should be optional in %s", resourceName)
119-
}
116+
// Verify etag is computed
120117
if !etagField.Computed {
121118
t.Errorf("etag should be computed in %s", resourceName)
122119
}

github/resource_github_issue.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ func resourceGithubIssue() *schema.Resource {
6969
},
7070
"etag": {
7171
Type: schema.TypeString,
72-
Optional: true,
7372
Computed: true,
7473
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {
7574
return true

github/resource_github_issue_label.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ func resourceGithubIssueLabel() *schema.Resource {
4949
},
5050
"etag": {
5151
Type: schema.TypeString,
52-
Optional: true,
5352
Computed: true,
5453
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {
5554
return true

github/resource_github_membership.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ func resourceGithubMembership() *schema.Resource {
3939
},
4040
"etag": {
4141
Type: schema.TypeString,
42-
Optional: true,
4342
Computed: true,
4443
DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool {
4544
return true

0 commit comments

Comments
 (0)