-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29005 from hashicorp/td-context-everywhere
Converts AWS API calls to and provider CRUD calls to `Context`-aware versions
- Loading branch information
Showing
3,447 changed files
with
101,327 additions
and
84,564 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,3 @@ linters: | |
|
||
run: | ||
timeout: 10m | ||
skip-dirs: | ||
- .ci/providerlint/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,5 +106,3 @@ linters-settings: | |
|
||
run: | ||
timeout: 75m | ||
skip-dirs: | ||
- .ci/providerlint/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
rules: | ||
- id: aws-api-context | ||
languages: [go] | ||
message: All AWS API calls should use the WithContext version | ||
paths: &paths | ||
include: | ||
- internal/service/* | ||
- internal/acctest/* | ||
exclude: | ||
# `pattern-not` not working | ||
- internal/service/kafkaconnect | ||
# WIP | ||
- internal/acctest/acctest.go | ||
patterns: | ||
- pattern: | | ||
$CONN.$API(...) | ||
- metavariable-regex: | ||
metavariable: $CONN | ||
regex: ^(?!conns)\w*([cC]onn) | ||
- metavariable-regex: | ||
metavariable: $API | ||
# This weird construction is to get around greedy matching | ||
regex: ^(?!.*WithContext).*$ | ||
- pattern-not: | | ||
$CONN.$APIV2(ctx, ...) | ||
- pattern-not: connect.$API(...) | ||
- pattern-not: tfconnect.$API(...) | ||
- pattern-not: codestarconnections.$API(...) | ||
- pattern-not: tfcodestarconnections.$API(...) | ||
- pattern-not: tfdirectconnect.$API(...) | ||
- pattern-not: kafkaconnect.$API(...) | ||
- pattern-not: tfkafkaconnect.$API(...) | ||
- pattern-not: conn.Handlers.$X(...) | ||
- pattern-not: conn.Handlers.$X.$Y(...) | ||
severity: ERROR | ||
- id: aws-helpers-context | ||
languages: [go] | ||
message: All AWS helper functions should take a context.Context | ||
paths: *paths | ||
patterns: | ||
- pattern: | | ||
$INNER(conn, ...) | ||
- pattern-not: $V2(conn, ...) | ||
- metavariable-regex: | ||
metavariable: $V2 | ||
regex: ^New\w+Paginator$ | ||
severity: ERROR | ||
- id: retry-context | ||
languages: [go] | ||
message: Waiter and retry functions should use the Context version | ||
paths: *paths | ||
patterns: | ||
- pattern-either: | ||
- pattern: $X.WaitForState() | ||
- pattern: resource.Retry() | ||
- pattern: tfresource.RetryWhen(...) | ||
- pattern: tfresource.RetryWhenAWSErrCodeEquals(...) | ||
- pattern: tfresource.RetryWhenAWSErrMessageContains(...) | ||
- pattern: tfresource.RetryUntilNotFound(...) | ||
- pattern: tfresource.RetryWhenNotFound(...) | ||
- pattern: tfresource.RetryWhenNewResourceNotFound(...) | ||
- pattern: tfresource.WaitUntil(...) | ||
severity: WARNING | ||
- id: context-todo | ||
languages: [go] | ||
message: Should not use `context.TODO()` | ||
paths: *paths | ||
pattern: context.TODO() | ||
severity: ERROR | ||
- id: schema-noop | ||
languages: [go] | ||
message: Should use `schema.NoopContext` instead of `schema.Noop` | ||
paths: *paths | ||
pattern: schema.Noop | ||
severity: ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.