Skip to content

Commit f97d278

Browse files
committed
fix up package docs + build specific TODO comments
1 parent 63dc825 commit f97d278

File tree

7 files changed

+6
-37
lines changed

7 files changed

+6
-37
lines changed

internal/proto5server/server_upgraderesourceidentity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ import (
1111

1212
// UpgradeResourceIdentity satisfies the tfprotov5.ProviderServer interface.
1313
func (s *Server) UpgradeResourceIdentity(ctx context.Context, proto5Req *tfprotov5.UpgradeResourceIdentityRequest) (*tfprotov5.UpgradeResourceIdentityResponse, error) {
14-
panic("unimplemented") // TODO: implement
14+
panic("unimplemented") // TODO:ResourceIdentity: implement
1515
}

internal/proto6server/server_upgraderesourceidentity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ import (
1111

1212
// UpgradeResourceIdentity satisfies the tfprotov6.ProviderServer interface.
1313
func (s *Server) UpgradeResourceIdentity(ctx context.Context, proto6Req *tfprotov6.UpgradeResourceIdentityRequest) (*tfprotov6.UpgradeResourceIdentityResponse, error) {
14-
panic("unimplemented") // TODO: implement
14+
panic("unimplemented") // TODO:ResourceIdentity: implement
1515
}

resource/identityschema/doc.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
// Package identityschema contains all available schema functionality for managed
55
// resource identity.
66
//
7-
// TODO: Verify these type names are what we ended with.
8-
//
97
// Resource identity schemas define the structure and value types for identity state data.
108
// Schemas are implemented via the resource.ResourceWithIdentity type IdentitySchema method.
119
package identityschema

resource/identityschema/list_attribute.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,5 @@ func (a ListAttribute) ValidateImplementation(ctx context.Context, req fwschema.
165165
resp.Diagnostics.Append(fwschema.AttributeMissingElementTypeDiag(req.Path))
166166
}
167167

168-
// TODO: Write validation similar to the dynamic type validation/diagnostic for detecting
169-
// non-primitive element types
170-
// if a.CustomType == nil && fwtype.ContainsCollectionWithDynamic(a.GetType()) {
171-
// resp.Diagnostics.Append(fwtype.AttributeCollectionWithDynamicTypeDiag(req.Path))
172-
// }
168+
// TODO:ResourceIdentity: Write validation + tests that ensure the element type only contains primitive elements (bool, string, number)
173169
}

resource/identityschema/list_attribute_test.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -460,29 +460,6 @@ func TestListAttributeValidateImplementation(t *testing.T) {
460460
},
461461
expected: &fwschema.ValidateImplementationResponse{},
462462
},
463-
// TODO: Update this test once the validation logic is in place
464-
// "elementtype-invalid": {
465-
// attribute: identityschema.ListAttribute{
466-
// RequiredForImport: true,
467-
// ElementType: types.DynamicType,
468-
// },
469-
// request: fwschema.ValidateImplementationRequest{
470-
// Name: "test",
471-
// Path: path.Root("test"),
472-
// },
473-
// expected: &fwschema.ValidateImplementationResponse{
474-
// Diagnostics: diag.Diagnostics{
475-
// diag.NewErrorDiagnostic(
476-
// "Invalid Schema Implementation",
477-
// "When validating the schema, an implementation issue was found. "+
478-
// "This is always an issue with the provider and should be reported to the provider developers.\n\n"+
479-
// "\"test\" is an attribute that contains a collection type with a nested dynamic type.\n\n"+
480-
// "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. "+
481-
// "If underlying dynamic values are required, replace the \"test\" attribute definition with DynamicAttribute instead.",
482-
// ),
483-
// },
484-
// },
485-
// },
486463
"elementtype-missing": {
487464
attribute: identityschema.ListAttribute{
488465
RequiredForImport: true,

resource/identityschema/schema.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ import (
1717
// Schema must satify the fwschema.Schema interface.
1818
var _ fwschema.Schema = Schema{}
1919

20-
// TODO: Verify these type names are what we ended with.
21-
//
2220
// Schema defines the structure and value types of resource identity data. This type
23-
// is used as the resource.IdentitySchemaResponse type Schema field, which is
21+
// is used as the resource.IdentitySchemaResponse type IdentitySchema field, which is
2422
// implemented by the resource.ResourceWithIdentity type IdentitySchema method.
2523
type Schema struct {
2624
// Attributes is the mapping of underlying attribute names to attribute
@@ -31,7 +29,7 @@ type Schema struct {
3129

3230
// Version indicates the current version of the resource identity schema. Resource
3331
// identity schema versioning enables identity state upgrades in conjunction with the
34-
// [resource.ResourceWithIdentityStateUpgrades] interface. Versioning is only
32+
// [resource.ResourceWithUpgradeIdentity] interface. Versioning is only
3533
// required if there is a breaking change involving existing identity state data,
3634
// such as changing an attribute type in a manner that is incompatible with the Terraform type.
3735
//

resource/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ type ResourceWithValidateConfig interface {
199199

200200
// ResourceWithIdentity is an interface type that extends Resource to implement managed resource identity.
201201
//
202-
// TODO: Describe identity concept in more detail, reference the upgrade identity interface
202+
// TODO:ResourceIdentity: Add more documentation here to describe what identity is used for.
203203
type ResourceWithIdentity interface {
204204
Resource
205205

0 commit comments

Comments
 (0)