Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and enable tfproviderlint S020 check: schema should not combine Computed only with ForceNew #11865

Closed
bflad opened this issue Feb 3, 2020 · 3 comments · Fixed by #12674
Closed
Assignees
Labels
good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. linter Pertains to changes to or issues with the various linters. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Feb 3, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Using ForceNew with Computed: true only (no Optional/Required) is extraneous and not valid. See also: https://github.com/bflad/tfproviderlint/blob/master/passes/S020/README.md

The fix in all these is to remove the extraneous ForceNew declaration per attribute.

e.g.

/Users/bflad/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_ami.go:171:28: S020: schema should not only enable Computed and enable ForceNew
/Users/bflad/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_ami_copy.go:145:28: S020: schema should not only enable Computed and enable ForceNew
/Users/bflad/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_ami_from_instance.go:132:28: S020: schema should not only enable Computed and enable ForceNew
/Users/bflad/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_inspector_assessment_template.go:29:11: S020: schema should not only enable Computed and enable ForceNew

Definition of Done

  • Fix S020 reports
  • In GNUmakefile, add -S020 to tfproviderlint command under lint target and have TravisCI testing pass
@bflad bflad added good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Feb 3, 2020
@bflad bflad changed the title Fix and enable tfproviderlint S020 check: schema should combine Computed only and ForceNew Fix and enable tfproviderlint S020 check: schema should not combine Computed only with ForceNew Feb 3, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 3, 2020
@bflad bflad removed the needs-triage Waiting for first response or review from a maintainer. label Feb 3, 2020
bflad added a commit that referenced this issue Feb 3, 2020
Gaps in `tfproviderlint` checking are covered by the following issues:

Reference: #9950 (fix and enable AT003)
Reference: #11862 (fix and enable AT005)
Reference: #9951 (fix and enable R001)
Reference: #9952 (fix and enable R002)
Reference: #9953 (fix and enable R003)
Reference: #9954 (fix and enable R004)
Reference: #11863 (fix and enable R005)
Reference: #11864 (fix and enable R006)
Reference: #9955 (fix and enable S006)
Reference: #9956 (fix and enable S018)
Reference: #11865 (fix and enable S020)
Reference: #11866 (fix and enable S022)
Reference: #11867 (fix and enable S023)
Reference: #11868 (fix and enable S024)
Reference: #11869 (fix and enable S031)
Reference: #11870 (fix and enable S032)
Reference: #11871 (fix and enable S033)
Reference: #11872 (fix and enable V001)
Reference: #11844 (fix and enable V002, V004, V005, V007, V008)
bflad added a commit that referenced this issue Feb 4, 2020
Gaps in `tfproviderlint` checking are covered by the following issues:

Reference: #9950 (fix and enable AT003)
Reference: #11862 (fix and enable AT005)
Reference: #9951 (fix and enable R001)
Reference: #9952 (fix and enable R002)
Reference: #9953 (fix and enable R003)
Reference: #9954 (fix and enable R004)
Reference: #11863 (fix and enable R005)
Reference: #11864 (fix and enable R006)
Reference: #9955 (fix and enable S006)
Reference: #9956 (fix and enable S018)
Reference: #11865 (fix and enable S020)
Reference: #11866 (fix and enable S022)
Reference: #11867 (fix and enable S023)
Reference: #11868 (fix and enable S024)
Reference: #11869 (fix and enable S031)
Reference: #11870 (fix and enable S032)
Reference: #11871 (fix and enable S033)
Reference: #11872 (fix and enable V001)
Reference: #11844 (fix and enable V002, V004, V005, V007, V008)
bflad added a commit that referenced this issue Feb 19, 2020
Reference: #12074

Gaps in `tfproviderlint`/`awsproviderlint` checking are covered by the following issues:

Reference: #11888 (fix and enable AWSAT001)
Reference: #9950 (fix and enable AT003)
Reference: #11862 (fix and enable AT005)
Reference: #9951 (fix and enable R001)
Reference: #9952 (fix and enable R002)
Reference: #9953 (fix and enable R003)
Reference: #11863 (fix and enable R005)
Reference: #11864 (fix and enable R006)
Reference: #12083 (fix and enable R007, R008)
Reference: #9955 (fix and enable S006)
Reference: #9956 (fix and enable S018)
Reference: #11865 (fix and enable S020)
Reference: #11866 (fix and enable S022)
Reference: #11867 (fix and enable S023)
Reference: #11868 (fix and enable S024)
Reference: #11869 (fix and enable S031)
Reference: #11870 (fix and enable S032)
Reference: #11871 (fix and enable S033)
Reference: #11872 (fix and enable V001)
Reference: #11844 (fix and enable V002, V004, V005, V007, V008)
bflad added a commit that referenced this issue Mar 10, 2020
Reference: #12074

Gaps in `tfproviderlint`/`awsproviderlint` checking are covered by the following issues:

Reference: #11888 (fix and enable AWSAT001)
Reference: #9950 (fix and enable AT003)
Reference: #11862 (fix and enable AT005)
Reference: #9951 (fix and enable R001)
Reference: #9952 (fix and enable R002)
Reference: #9953 (fix and enable R003)
Reference: #11863 (fix and enable R005)
Reference: #11864 (fix and enable R006)
Reference: #12083 (fix and enable R007, R008)
Reference: #9955 (fix and enable S006)
Reference: #9956 (fix and enable S018)
Reference: #11865 (fix and enable S020)
Reference: #11866 (fix and enable S022)
Reference: #11867 (fix and enable S023)
Reference: #11868 (fix and enable S024)
Reference: #11869 (fix and enable S031)
Reference: #11870 (fix and enable S032)
Reference: #11871 (fix and enable S033)
Reference: #11872 (fix and enable V001)
Reference: #11844 (fix and enable V002, V004, V005, V007, V008)
@breathingdust breathingdust added this to the v2.57.0 milestone Apr 8, 2020
@breathingdust
Copy link
Member

The fix for this has been merged and will release in version 2.57.0 of the Terraform AWS Provider, later this week.

@ghost
Copy link

ghost commented Apr 10, 2020

This has been released in version 2.57.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented May 8, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators May 8, 2020
@breathingdust breathingdust added the linter Pertains to changes to or issues with the various linters. label Oct 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. linter Pertains to changes to or issues with the various linters. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants