Skip to content

Conversation

@bendbennett
Copy link
Contributor

@bendbennett bendbennett commented Apr 28, 2023

Closes: #51
Closes: #37

@bendbennett bendbennett added the documentation Improvements or additions to documentation label Apr 28, 2023
@bendbennett bendbennett requested a review from a team as a code owner April 28, 2023 16:48
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding attribute descriptions would definitely be great, but a few things to potentially consider while we are doing this. 😄

  • The Go documentation is tailored for Go developers, which may differ slightly from the audience of folks reading/writing Terraform configuration:
    • When talking about units, it might be good to write out that the "s" unit means "seconds", etc., especially for non-English speakers.
    • In general, Terraform resource operations are "long-running" operations over a network where even milliseconds is very unlikely in practice. It may be good to pare down the list to discussing only longer duration units.
  • Folks may want to know when each of the timeouts actually apply, such as read being any refresh or planning (with refresh enabled) operation and the delete value only being applied if it is saved into state before the destroy operation occurs.
  • Is it worth looking into #37 as well? (The answer there may be separately switching the resource attribute value handling to Default if it makes sense)

@bflad bflad added the enhancement New feature or request label May 1, 2023
@bflad bflad added this to the v0.4.0 milestone May 1, 2023
@jbinko
Copy link

jbinko commented May 4, 2023

Thank you for PR. I appreciate quick code change. Please, can somebody merge this into main branch? It seems it is "just" waiting for a review. I'm waiting for merge into the main branch. Thx

@jbinko
Copy link

jbinko commented May 10, 2023

Please, can you approve the PR? Thx

@austinvalle
Copy link
Member

austinvalle commented May 10, 2023

Hi @jbinko 👋🏻, this PR is still a WIP re: the above comments, but it's not currently in our team's prioritized work (no timeline). If you want to use any of that work before we review/release this PR, you could always install the module from one of the commits on the PR, for example eccc121:

# go get github.com/hashicorp/terraform-plugin-framework-timeouts@<commit>
go get github.com/hashicorp/terraform-plugin-framework-timeouts@eccc1210acfdd389ae2bc4027caa54f0a7d46f9d

@bendbennett
Copy link
Contributor Author

resource/timeouts: Opts have been added for CreateDescription, ReadDescription, UpdateDescription and DeleteDescription to allow overriding of default description.

datasource/timeouts: New BlockWithOpts() and AttributesWithOpts() functions have been added to allow overriding of default description.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good but I'm wondering about the unit testing not picking up the Description equality correctly. I'll check that upstream.

Comment on lines 39 to 44
"read": schema.StringAttribute{
Optional: true,
Validators: []validator.String{
validators.TimeDuration(),
},
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, wouldn't this also have the default description or am I thinking about this wrong?

Comment on lines 139 to 144
"read": schema.StringAttribute{
Optional: true,
Validators: []validator.String{
validators.TimeDuration(),
},
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here regarding the default description. I wonder if I need to double check the Equal() implementation.

@bflad
Copy link
Contributor

bflad commented Jun 9, 2023

It looks like the equality handlers for attributes doesn't handle nested attributes and blocks doesn't handle nested attributes and blocks. Will create an issue upstream and get it patched up.

@bendbennett
Copy link
Contributor Author

It looks like the equality handlers for attributes doesn't handle nested attributes and blocks doesn't handle nested attributes and blocks. Will create an issue upstream and get it patched up.

Thanks for getting this patched up. Have updated to terraform-plugin-framework v1.3.1 and updated the tests.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀

@bendbennett bendbennett merged commit 4ba612d into main Jun 20, 2023
@bendbennett bendbennett deleted the bendbennett/issues-51 branch June 20, 2023 13:35
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

timeouts/schema.go - documentation Provide better documentation to the practitioners

4 participants