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

r/aws_redshift_snapshot_copy_grant: Remove extraneous Exists function #13052

Merged

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Apr 27, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Closes #9953.

Includes testAccCheckResourceDisappears() from #12864.

Release note for CHANGELOG:

NONE

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRedshiftSnapshotCopyGrant_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRedshiftSnapshotCopyGrant_ -timeout 120m
=== RUN   TestAccAWSRedshiftSnapshotCopyGrant_Basic
=== PAUSE TestAccAWSRedshiftSnapshotCopyGrant_Basic
=== RUN   TestAccAWSRedshiftSnapshotCopyGrant_Update
=== PAUSE TestAccAWSRedshiftSnapshotCopyGrant_Update
=== RUN   TestAccAWSRedshiftSnapshotCopyGrant_disappears
=== PAUSE TestAccAWSRedshiftSnapshotCopyGrant_disappears
=== CONT  TestAccAWSRedshiftSnapshotCopyGrant_Basic
=== CONT  TestAccAWSRedshiftSnapshotCopyGrant_disappears
=== CONT  TestAccAWSRedshiftSnapshotCopyGrant_Update
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_disappears (18.83s)
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_Basic (24.47s)
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_Update (39.32s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	39.376s

@ewbankkit ewbankkit requested a review from a team April 27, 2020 21:58
@ghost ghost added size/L Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/redshift Issues and PRs that pertain to the redshift service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 27, 2020
@bflad bflad added technical-debt Addresses areas of the codebase that need refactoring or redesign. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 28, 2020
@bflad bflad self-assigned this Apr 28, 2020
@appilon appilon assigned appilon and unassigned bflad Apr 29, 2020
@appilon appilon added this to the v2.60.0 milestone Apr 29, 2020
@bflad
Copy link
Contributor

bflad commented Apr 29, 2020

#12864 has been merged so that functionality does not need to be reviewed again. 👍

Copy link
Contributor

@appilon appilon left a comment

Choose a reason for hiding this comment

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

Just one minor pedantic question

Message: fmt.Sprintf("[DEBUG] Grant %s not found", grantName),
LastRequest: input,
}
return out.SnapshotCopyGrants[0], nil
Copy link
Contributor

Choose a reason for hiding this comment

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

if err == nil is it guaranteed this slice has at least 1 item?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In all my testing that was the case, err != nil => out != nil && len(out.SnapshotCopyGrants), but you are correct in that the previous code would have handled opposite by returning nil for the grant. It's minor to add that back (plus change some of the callers to check for a nil grant).

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay if you don't mind, once that change is made this will get merged! Thank you for helping with all the tech debt.

@appilon appilon modified the milestones: v2.60.0, v2.61.0 Apr 30, 2020
@ewbankkit ewbankkit force-pushed the issue-9953.aws_redshift_snapshot_copy_grant branch from 7ce8a84 to b3bb017 Compare April 30, 2020 20:28
@ewbankkit
Copy link
Contributor Author

ewbankkit commented Apr 30, 2020

@appilon Made the suggested changes and added the additional check to make lint as this now closes #9953.

Acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRedshiftSnapshotCopyGrant_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRedshiftSnapshotCopyGrant_ -timeout 120m
=== RUN   TestAccAWSRedshiftSnapshotCopyGrant_Basic
=== PAUSE TestAccAWSRedshiftSnapshotCopyGrant_Basic
=== RUN   TestAccAWSRedshiftSnapshotCopyGrant_Update
=== PAUSE TestAccAWSRedshiftSnapshotCopyGrant_Update
=== RUN   TestAccAWSRedshiftSnapshotCopyGrant_disappears
=== PAUSE TestAccAWSRedshiftSnapshotCopyGrant_disappears
=== CONT  TestAccAWSRedshiftSnapshotCopyGrant_Update
=== CONT  TestAccAWSRedshiftSnapshotCopyGrant_Basic
=== CONT  TestAccAWSRedshiftSnapshotCopyGrant_disappears
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_disappears (18.44s)
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_Basic (23.83s)
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_Update (53.29s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	53.354s

@appilon appilon modified the milestones: v2.61.0, v2.60.0 Apr 30, 2020
@appilon appilon merged commit 72b775d into hashicorp:master Apr 30, 2020
@ewbankkit ewbankkit deleted the issue-9953.aws_redshift_snapshot_copy_grant branch April 30, 2020 20:57
@ghost
Copy link

ghost commented May 1, 2020

This has been released in version 2.60.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!

adamdecaf pushed a commit to adamdecaf/terraform-provider-aws that referenced this pull request May 28, 2020
…hashicorp#13052)

* r/aws_redshift_snapshot_copy_grant: Remove extraneous Exists function.

* Enable providerlint R003 as the last 'Exists' method has been removed.

* Fix rebase duplication.
@ghost
Copy link

ghost commented May 31, 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 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/redshift Issues and PRs that pertain to the redshift service. size/L Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix and enable tfproviderlint R003 check: Remove extraneous Exists functions
3 participants