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

Terraform Plugin SDK v2 Upgrade #279

Merged
merged 4 commits into from
Sep 2, 2020
Merged

Terraform Plugin SDK v2 Upgrade #279

merged 4 commits into from
Sep 2, 2020

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Aug 28, 2020

Upgrades codebase to latest Terraform Plugin SDK and removes some of deprecated method usage. Full refactoring to context-based resources is out of scope of this PR

@nfx nfx requested a review from stikkireddy August 28, 2020 11:47
@TravisBuddy
Copy link

Travis tests have failed

Hey @nfx,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

View build log

curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v0.4.2/gotestsum_0.4.2_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum
The command "curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v0.4.2/gotestsum_0.4.2_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum" exited with 0.
$ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0
golangci/golangci-lint info checking GitHub for tag 'v1.25.0'
golangci/golangci-lint info found version: 1.25.0 for v1.25.0/linux/amd64
golangci/golangci-lint info installed /home/travis/gopath/bin/golangci-lint
The command "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0" exited with 0.
$ time make lint
✓ Linting source code with golangci-lint make sure you run make fmt ...
internal/qa/testing.go:50:6: type `errorSlice` is unused (unused)
workspace/data_notebook_paths.go:86:10: Error return value of `h.Write` is not checked (errcheck)
		h.Write([]byte(v.(string)))
		       ^
storage/aws_s3_mount.go:109:8: Error return value of `d.Set` is not checked (errcheck)
		d.Set("cluster_id", cluster.ClusterID)
		     ^
provider/provider.go:11: File is not `gofmt`-ed with `-s` (gofmt)
	
internal/acceptance/acceptance.go:18:2: SA1019: tc.Providers is deprecated: Providers is deprecated, please use ProviderFactories  (staticcheck)
	tc.Providers = map[string]*schema.Provider{
	^
access/resource_secret_scope.go:70:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/clusters.go:153:17: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return result, resource.Retry(a.defaultTimeout(), func() *resource.RetryError {
	               ^
compute/resource_cluster.go:31:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_cluster.go:189:8: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	err = resource.Retry(5*time.Minute, func() *resource.RetryError {
	      ^
compute/resource_cluster_policy.go:136:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_instance_pool.go:64:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_job.go:192:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_group.go:17:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_instance_profile.go:82:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_token.go:97:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
internal/qa/testing.go:105:14: SA1019: f.Resource.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
		whatever = f.Resource.Create
		           ^
mws/resource_network.go:233:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(60*time.Second, func() *resource.RetryError {
	       ^
mws/resource_workspace.go:236:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(timeoutDurationMinutes, func() *resource.RetryError {
	       ^
mws/resource_workspace.go:452:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(15*time.Minute, func() *resource.RetryError {
	       ^
storage/aws_s3_mount.go:60:2: SA1019: r.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
	r.Create = func(d *schema.ResourceData, m interface{}) error {
	^
storage/mounts.go:88:2: SA1019: resource.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
	resource.Create = mountCreate(tpl, resource)
	^
storage/mounts.go:157:55: SA1019: schema.CreateFunc is deprecated: Please use the context aware equivalents instead.  (staticcheck)
func mountCreate(tpl interface{}, r *schema.Resource) schema.CreateFunc {
                                                      ^
workspace/resource_notebook.go:373:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(5*time.Minute, func() *resource.RetryError {
	       ^
Makefile:10: recipe for target 'lint' failed
make: *** [lint] Error 1

real	0m44.505s
user	1m14.032s
sys	0m3.913s
The command "time make lint" exited with 2.
$ time make test
✓ Running tests...
go: downloading github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.2-0.20200828083434-d39628234432
go: extracting github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.2-0.20200828083434-d39628234432
go: downloading github.com/hashicorp/hcl/v2 v2.3.0
go: downloading github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
go: downloading github.com/hashicorp/terraform-plugin-test/v2 v2.0.0
go: downloading google.golang.org/grpc v1.30.0
go: downloading github.com/mitchellh/go-testing-interface v1.0.4
go: downloading github.com/golang/protobuf v1.4.2
go: downloading github.com/hashicorp/go-plugin v1.3.0
go: extracting github.com/golang/protobuf v1.4.2
go: extracting google.golang.org/grpc v1.30.0
go: extracting github.com/hashicorp/hcl/v2 v2.3.0
go: extracting github.com/mitchellh/go-testing-interface v1.0.4
go: downloading google.golang.org/protobuf v1.25.0
go: extracting github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
go: extracting github.com/hashicorp/go-plugin v1.3.0
go: extracting github.com/hashicorp/terraform-plugin-test/v2 v2.0.0
go: downloading golang.org/x/text v0.3.3
go: downloading github.com/hashicorp/terraform-exec v0.3.0
go: downloading github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02
go: downloading golang.org/x/net v0.0.0-20200707034311-ab3426394381
go: extracting github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02
go: extracting github.com/hashicorp/terraform-exec v0.3.0
go: downloading google.golang.org/genproto v0.0.0-20200711021454-869866162049
go: extracting golang.org/x/net v0.0.0-20200707034311-ab3426394381
go: extracting google.golang.org/protobuf v1.25.0
go: downloading github.com/ulikunitz/xz v0.5.7
go: downloading cloud.google.com/go v0.61.0
go: downloading google.golang.org/api v0.29.0
go: extracting github.com/ulikunitz/xz v0.5.7
go: extracting golang.org/x/text v0.3.3
go: extracting cloud.google.com/go v0.61.0
go: downloading cloud.google.com/go/storage v1.10.0
go: extracting cloud.google.com/go/storage v1.10.0
go: downloading go.opencensus.io v0.22.4
go: extracting go.opencensus.io v0.22.4
go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: extracting github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: extracting google.golang.org/genproto v0.0.0-20200711021454-869866162049
go: extracting google.golang.org/api v0.29.0
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: extracting golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: finding github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.2-0.20200828083434-d39628234432
go: finding github.com/hashicorp/go-plugin v1.3.0
go: finding github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
go: finding google.golang.org/grpc v1.30.0
go: finding github.com/mitchellh/go-testing-interface v1.0.4
go: finding github.com/golang/protobuf v1.4.2
go: finding golang.org/x/text v0.3.3
go: finding google.golang.org/genproto v0.0.0-20200711021454-869866162049
go: finding github.com/hashicorp/hcl/v2 v2.3.0
go: finding google.golang.org/protobuf v1.25.0
go: finding golang.org/x/net v0.0.0-20200707034311-ab3426394381
go: finding github.com/hashicorp/terraform-plugin-test/v2 v2.0.0
go: finding github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02
go: finding github.com/hashicorp/terraform-exec v0.3.0
go: finding cloud.google.com/go/storage v1.10.0
go: finding cloud.google.com/go v0.61.0
go: finding google.golang.org/api v0.29.0
go: finding go.opencensus.io v0.22.4
go: finding github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: finding golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: finding github.com/ulikunitz/xz v0.5.7
∅  .
✓  access (103ms) (coverage: 83.5% of statements)
✓  common (30ms) (coverage: 66.0% of statements)
✓  access/acceptance (57ms)
✓  compute/acceptance (20ms)
✓  compute (691ms) (coverage: 68.3% of statements)
✓  identity (103ms) (coverage: 42.4% of statements)
✓  internal (12ms) (coverage: 67.5% of statements)
✓  identity/acceptance (27ms)
∅  internal/acceptance
✓  internal/qa (19ms) (coverage: 53.6% of statements)
✓  internal/sanity (18ms) (coverage: 100.0% of statements)
✓  mws (1.081s) (coverage: 70.5% of statements)
✓  mws/acceptance (24ms)
✓  provider (114ms) (coverage: 64.6% of statements)
✓  storage (90ms) (coverage: 73.5% of statements)
✓  storage/acceptance (20ms)
✓  workspace (1.34s) (coverage: 65.6% of statements)
✓  workspace/acceptance (14ms)

DONE 551 tests, 67 skipped in 56.259s

real	0m56.266s
user	1m27.105s
sys	0m9.561s
The command "time make test" exited with 0.
$ time make build
✓ Building source code with go build...
github.com/databrickslabs/databricks-terraform

real	0m2.991s
user	0m3.520s
sys	0m0.461s
The command "time make build" exited with 0.
store build cache
changes detected (content changed, file is created, or file is deleted):\n/home/travis/.cache/go-build/00/00521d4640144ae9d52e3a4ff95f58b694beba5f33baea87ee9099416eb3f5cc-a
/home/travis/.cache/go-build/00/0058d13ec9154e9c954c355d5343a241034c177de98301bc8d92901b1a0138f2-a
/home/travis/.cache/go-build/00/0074d29713d3121a0471e8858e9a96e92ab9067a5ace1582e791327c810e952f-a
/home/travis/.cache/go-build/00/00ce35b45ed530ad8cfbb595da7b554b1b6c7413ced73397a460b9e9e4c851a5-a
/home/travis/.cache/go-build/00/00f04da442f2adc07a1a39d9ab2ca05420b115bc6e940d66771af9aeb4346536-a
/home/travis/.cache/go-build/01/010909209ecd24acfe48123e9611c70b11cf749ebaf9c62037ea15ef053d412f-a
/home/travis/.cache/go-build/01/01321d86c2105ed4b4754d9b023104e069a3321057584a25d84c7da2e83021e4-a
/home/travis/.cache/go-build/01/0132bfbc4523a00ea6855f4af55524c825e60578f37013b4f43d6f8370366b2a-a
/home/travis/.cache/go-build/01/0169845bb02399c449f8b11e1983adc0e1895c460450f7419fb97a3139fd6480-a
/home/travis/.cache/go-build/01/01bd684298428b0c1623a3353f944d00af8b8d04cbdb5c98c7531ef329e3bf1b-d
/home/trav\n...
changes detected, packing new archive
uploading PR.279/cache--linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--go-1.13.x.tgz
cache uploaded


Done. Your build exited with 1.
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0
golangci/golangci-lint info checking GitHub for tag 'v1.25.0'
golangci/golangci-lint info found version: 1.25.0 for v1.25.0/linux/amd64
golangci/golangci-lint info installed /home/travis/gopath/bin/golangci-lint
time make lint
✓ Linting source code with golangci-lint make sure you run make fmt ...
internal/qa/testing.go:50:6: type `errorSlice` is unused (unused)
workspace/data_notebook_paths.go:86:10: Error return value of `h.Write` is not checked (errcheck)
		h.Write([]byte(v.(string)))
		       ^
storage/aws_s3_mount.go:109:8: Error return value of `d.Set` is not checked (errcheck)
		d.Set("cluster_id", cluster.ClusterID)
		     ^
provider/provider.go:11: File is not `gofmt`-ed with `-s` (gofmt)
	
internal/acceptance/acceptance.go:18:2: SA1019: tc.Providers is deprecated: Providers is deprecated, please use ProviderFactories  (staticcheck)
	tc.Providers = map[string]*schema.Provider{
	^
access/resource_secret_scope.go:70:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/clusters.go:153:17: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return result, resource.Retry(a.defaultTimeout(), func() *resource.RetryError {
	               ^
compute/resource_cluster.go:31:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_cluster.go:189:8: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	err = resource.Retry(5*time.Minute, func() *resource.RetryError {
	      ^
compute/resource_cluster_policy.go:136:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_instance_pool.go:64:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_job.go:192:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_group.go:17:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_instance_profile.go:82:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_token.go:97:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
internal/qa/testing.go:105:14: SA1019: f.Resource.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
		whatever = f.Resource.Create
		           ^
mws/resource_network.go:233:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(60*time.Second, func() *resource.RetryError {
	       ^
mws/resource_workspace.go:236:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(timeoutDurationMinutes, func() *resource.RetryError {
	       ^
mws/resource_workspace.go:452:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(15*time.Minute, func() *resource.RetryError {
	       ^
storage/aws_s3_mount.go:60:2: SA1019: r.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
	r.Create = func(d *schema.ResourceData, m interface{}) error {
	^
storage/mounts.go:88:2: SA1019: resource.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
	resource.Create = mountCreate(tpl, resource)
	^
storage/mounts.go:157:55: SA1019: schema.CreateFunc is deprecated: Please use the context aware equivalents instead.  (staticcheck)
func mountCreate(tpl interface{}, r *schema.Resource) schema.CreateFunc {
                                                      ^
workspace/resource_notebook.go:373:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(5*time.Minute, func() *resource.RetryError {
	       ^
Makefile:10: recipe for target 'lint' failed
make: *** [lint] Error 1

real	0m44.505s
user	1m14.032s
sys	0m3.913s

2nd Build

View build log

curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v0.4.2/gotestsum_0.4.2_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum
The command "curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v0.4.2/gotestsum_0.4.2_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum" exited with 0.
$ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0
golangci/golangci-lint info checking GitHub for tag 'v1.25.0'
golangci/golangci-lint info found version: 1.25.0 for v1.25.0/linux/amd64
golangci/golangci-lint info installed /home/travis/gopath/bin/golangci-lint
The command "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0" exited with 0.
$ time make lint
✓ Linting source code with golangci-lint make sure you run make fmt ...
internal/qa/testing.go:50:6: type `errorSlice` is unused (unused)
provider/provider.go:11: File is not `goimports`-ed (goimports)
	
workspace/data_notebook_paths.go:86:10: Error return value of `h.Write` is not checked (errcheck)
		h.Write([]byte(v.(string)))
		       ^
storage/aws_s3_mount.go:109:8: Error return value of `d.Set` is not checked (errcheck)
		d.Set("cluster_id", cluster.ClusterID)
		     ^
internal/acceptance/acceptance.go:18:2: SA1019: tc.Providers is deprecated: Providers is deprecated, please use ProviderFactories  (staticcheck)
	tc.Providers = map[string]*schema.Provider{
	^
access/resource_secret_scope.go:70:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/clusters.go:153:17: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return result, resource.Retry(a.defaultTimeout(), func() *resource.RetryError {
	               ^
compute/resource_cluster.go:31:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_cluster.go:189:8: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	err = resource.Retry(5*time.Minute, func() *resource.RetryError {
	      ^
compute/resource_cluster_policy.go:136:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_instance_pool.go:64:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_job.go:192:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_group.go:17:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_instance_profile.go:82:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_token.go:97:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
internal/qa/testing.go:105:14: SA1019: f.Resource.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
		whatever = f.Resource.Create
		           ^
mws/resource_network.go:233:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(60*time.Second, func() *resource.RetryError {
	       ^
mws/resource_workspace.go:236:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(timeoutDurationMinutes, func() *resource.RetryError {
	       ^
mws/resource_workspace.go:452:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(15*time.Minute, func() *resource.RetryError {
	       ^
storage/aws_s3_mount.go:60:2: SA1019: r.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
	r.Create = func(d *schema.ResourceData, m interface{}) error {
	^
storage/mounts.go:88:2: SA1019: resource.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
	resource.Create = mountCreate(tpl, resource)
	^
storage/mounts.go:157:55: SA1019: schema.CreateFunc is deprecated: Please use the context aware equivalents instead.  (staticcheck)
func mountCreate(tpl interface{}, r *schema.Resource) schema.CreateFunc {
                                                      ^
workspace/resource_notebook.go:373:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(5*time.Minute, func() *resource.RetryError {
	       ^
Makefile:10: recipe for target 'lint' failed
make: *** [lint] Error 1

real	0m43.959s
user	1m14.034s
sys	0m3.888s
The command "time make lint" exited with 2.
$ time make test
✓ Running tests...
go: downloading github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.2-0.20200828083434-d39628234432
go: downloading github.com/mitchellh/go-testing-interface v1.0.4
go: downloading github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
go: downloading github.com/hashicorp/hcl/v2 v2.3.0
go: downloading golang.org/x/text v0.3.3
go: downloading github.com/hashicorp/go-plugin v1.3.0
go: downloading google.golang.org/grpc v1.30.0
go: downloading github.com/hashicorp/terraform-plugin-test/v2 v2.0.0
go: downloading github.com/golang/protobuf v1.4.2
go: downloading golang.org/x/net v0.0.0-20200707034311-ab3426394381
go: downloading google.golang.org/protobuf v1.25.0
go: downloading github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02
go: downloading google.golang.org/genproto v0.0.0-20200711021454-869866162049
go: downloading google.golang.org/api v0.29.0
go: downloading cloud.google.com/go v0.61.0
go: downloading github.com/ulikunitz/xz v0.5.7
go: downloading github.com/hashicorp/terraform-exec v0.3.0
go: downloading cloud.google.com/go/storage v1.10.0
go: downloading go.opencensus.io v0.22.4
go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
∅  .
✓  access (109ms) (coverage: 83.5% of statements)
✓  common (23ms) (coverage: 66.0% of statements)
✓  access/acceptance (24ms)
✓  compute/acceptance (20ms)
✓  compute (723ms) (coverage: 68.3% of statements)
✓  identity (133ms) (coverage: 42.4% of statements)
✓  internal (9ms) (coverage: 67.5% of statements)
✓  identity/acceptance (19ms)
∅  internal/acceptance
✓  internal/qa (9ms) (coverage: 53.6% of statements)
✓  internal/sanity (19ms) (coverage: 100.0% of statements)
✓  mws (1.068s) (coverage: 70.5% of statements)
✓  mws/acceptance (28ms)
✓  provider (107ms) (coverage: 64.6% of statements)
✓  storage (148ms) (coverage: 73.5% of statements)
✓  storage/acceptance (24ms)
✓  workspace/acceptance (15ms)
✓  workspace (1.176s) (coverage: 65.6% of statements)

DONE 551 tests, 67 skipped in 58.699s

real	0m58.729s
user	1m23.433s
sys	0m9.754s
The command "time make test" exited with 0.
$ time make build
✓ Building source code with go build...
github.com/databrickslabs/databricks-terraform

real	0m2.763s
user	0m3.397s
sys	0m0.412s
The command "time make build" exited with 0.
store build cache
changes detected (content changed, file is created, or file is deleted):\n/home/travis/.cache/go-build/00/001d433df56492d29b0e60c3b1fc4abc3705533a967d9de11b84597cad4b6cc7-d
/home/travis/.cache/go-build/00/00510a2a06b38d39a9a6a09b912b551d0f41047209ea6af15079ead34b9e735b-a
/home/travis/.cache/go-build/00/00756b8b0e2314f73775f3173dd82bd188244019ee20f217d45ba4600534b7b2-a
/home/travis/.cache/go-build/00/007e1bcdca01c4b078e449d1f4d3dbc15f4f263397d4e11709a5f8cdc064376a-a
/home/travis/.cache/go-build/00/0092971b9041b2369efae4cd25ad5b868ed643bc9a1c61080fda6e30101d7f34-a
/home/travis/.cache/go-build/00/00c00a961d11265f599624954915ad02f130f8fe3a5e64d409e5855de84e1300-a
/home/travis/.cache/go-build/01/0113b42119ec5a1af5f6f2f29b0861f7654f692a4c2456cda62a7e2342e4796e-a
/home/travis/.cache/go-build/01/01351a93788bb7b80cc20df74494f478442af38eafd0d3985b7090f966416407-a
/home/travis/.cache/go-build/01/015ad7883bf5cd0092bf80ee9ccfdbd830c9c6df6ed94605151d459738fdef78-a
/home/travis/.cache/go-build/01/0188c945040f87ea229e7595a33ff731951e19f2f3ad500b2ea40f93b56f4239-a
/home/trav\n...
changes detected, packing new archive
uploading PR.279/cache--linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--go-1.14.x.tgz
cache uploaded


Done. Your build exited with 1.
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0
golangci/golangci-lint info checking GitHub for tag 'v1.25.0'
golangci/golangci-lint info found version: 1.25.0 for v1.25.0/linux/amd64
golangci/golangci-lint info installed /home/travis/gopath/bin/golangci-lint
time make lint
✓ Linting source code with golangci-lint make sure you run make fmt ...
internal/qa/testing.go:50:6: type `errorSlice` is unused (unused)
provider/provider.go:11: File is not `goimports`-ed (goimports)
	
workspace/data_notebook_paths.go:86:10: Error return value of `h.Write` is not checked (errcheck)
		h.Write([]byte(v.(string)))
		       ^
storage/aws_s3_mount.go:109:8: Error return value of `d.Set` is not checked (errcheck)
		d.Set("cluster_id", cluster.ClusterID)
		     ^
internal/acceptance/acceptance.go:18:2: SA1019: tc.Providers is deprecated: Providers is deprecated, please use ProviderFactories  (staticcheck)
	tc.Providers = map[string]*schema.Provider{
	^
access/resource_secret_scope.go:70:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/clusters.go:153:17: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return result, resource.Retry(a.defaultTimeout(), func() *resource.RetryError {
	               ^
compute/resource_cluster.go:31:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_cluster.go:189:8: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	err = resource.Retry(5*time.Minute, func() *resource.RetryError {
	      ^
compute/resource_cluster_policy.go:136:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_instance_pool.go:64:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
compute/resource_job.go:192:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_group.go:17:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_instance_profile.go:82:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
identity/resource_token.go:97:11: SA1019: schema.ImportStatePassthrough is deprecated: Please use the context aware ImportStatePassthroughContext instead  (staticcheck)
			State: schema.ImportStatePassthrough,
			       ^
internal/qa/testing.go:105:14: SA1019: f.Resource.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
		whatever = f.Resource.Create
		           ^
mws/resource_network.go:233:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(60*time.Second, func() *resource.RetryError {
	       ^
mws/resource_workspace.go:236:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(timeoutDurationMinutes, func() *resource.RetryError {
	       ^
mws/resource_workspace.go:452:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(15*time.Minute, func() *resource.RetryError {
	       ^
storage/aws_s3_mount.go:60:2: SA1019: r.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
	r.Create = func(d *schema.ResourceData, m interface{}) error {
	^
storage/mounts.go:88:2: SA1019: resource.Create is deprecated: Please use the context aware equivalents instead. Only one of the operations or context aware equivalent can be set, not both.  (staticcheck)
	resource.Create = mountCreate(tpl, resource)
	^
storage/mounts.go:157:55: SA1019: schema.CreateFunc is deprecated: Please use the context aware equivalents instead.  (staticcheck)
func mountCreate(tpl interface{}, r *schema.Resource) schema.CreateFunc {
                                                      ^
workspace/resource_notebook.go:373:9: SA1019: resource.Retry is deprecated: Please use RetryContext to ensure proper plugin shutdown  (staticcheck)
	return resource.Retry(5*time.Minute, func() *resource.RetryError {
	       ^
Makefile:10: recipe for target 'lint' failed
make: *** [lint] Error 1

real	0m43.959s
user	1m14.034s
sys	0m3.888s
TravisBuddy Request Identifier: e2143110-e924-11ea-ae3c-2d16223a9f65

@TravisBuddy
Copy link

Hey @nfx,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 58c45580-e932-11ea-ae3c-2d16223a9f65

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2020

Codecov Report

Merging #279 into master will decrease coverage by 0.05%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #279      +/-   ##
==========================================
- Coverage   64.24%   64.18%   -0.06%     
==========================================
  Files          55       55              
  Lines        6720     6724       +4     
==========================================
- Hits         4317     4316       -1     
- Misses       2034     2038       +4     
- Partials      369      370       +1     
Impacted Files Coverage Δ
access/data_aws_policies.go 95.86% <ø> (ø)
access/resource_permissions.go 76.88% <ø> (ø)
access/resource_secret.go 87.38% <ø> (ø)
access/resource_secret_acl.go 89.01% <ø> (ø)
compute/clusters.go 60.89% <ø> (ø)
compute/common_instances.go 73.33% <ø> (ø)
compute/data_zones.go 63.63% <ø> (ø)
identity/data_default_user_roles.go 0.00% <ø> (ø)
identity/resource_group_instance_profile.go 13.58% <ø> (ø)
identity/resource_group_member.go 0.00% <ø> (ø)
... and 27 more

@nfx
Copy link
Contributor Author

nfx commented Sep 2, 2020

awsst

  • access/acceptance.TestAccSecretAclResource (11.03s)
  • access/acceptance.TestAccSecretResource (12.19s)
  • access/acceptance.TestAccSecretScopeResource (8.20s)
  • compute.TestAccContext (113.72s)
  • compute.TestAccInstancePools (0.35s)
  • compute.TestAccLibraryCreate (112.27s)
  • compute.TestAccListClustersIntegration (72.57s)
  • compute.TestAwsAccJobsCreate (0.38s)
  • compute.TestAwsAccSmallestNodeType (0.06s)
  • compute/acceptance.TestAccClusterPolicyResourceFullLifecycle (24.74s)
  • compute/acceptance.TestAccClusterResource_CreateClusterWithLibraries (287.36s)
  • compute/acceptance.TestAccJobResource (3.83s)
  • compute/acceptance.TestAwsAccClusterResource_CreateClusterViaInstancePool (167.22s)
  • compute/acceptance.TestAwsAccClusterResource_ValidatePlan (4.42s)
  • compute/acceptance.TestAwsAccJobResource_NoInstancePool (3.88s)
  • identity.TestAccCreateAdminUser (1.91s)
  • identity.TestAccCreateToken (0.26s)
  • identity.TestAccCreateUser (1.32s)
  • identity.TestAccGetAdminGroup (0.19s)
  • identity.TestAccGroup (3.05s)
  • identity.TestAccRoleDifferences (0.75s)
  • identity.TestAwsAccInstanceProfiles (0.29s)
  • identity.TestAwsAccReadInheritedRolesFromGroup (1.60s)
  • identity/acceptance.TestAccGroupMemberResource (19.88s)
  • identity/acceptance.TestAccGroupResource (18.48s)
  • identity/acceptance.TestAccGroupResource_verify_entitlements (8.55s)
  • identity/acceptance.TestAccScimGroupResource (35.44s)
  • identity/acceptance.TestAccScimUserResource (54.45s)
  • identity/acceptance.TestAccTokenResource (6.94s)
  • identity/acceptance.TestAwsAccGroupInstanceProfileResource (10.79s)
  • identity/acceptance.TestAwsAccInstanceProfileResource (8.90s)
  • internal/sanity.TestAccMissingResourcesInWorkspace (2.38s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Cluster_Policies (0.12s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Clusters (0.15s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/DBFS_Files (0.24s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Groups (0.12s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Instance_Pools (0.22s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Instance_Profiles (0.16s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Jobs (0.13s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Notebooks (0.29s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Secret_ACLs (0.37s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Secret_Scopes (0.05s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Secrets (0.05s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Tokens (0.35s)
  • internal/sanity.TestAccMissingResourcesInWorkspace/Users (0.13s)
  • internal/sanity.TestAccMutiworkspaceUsedFromNormalMode (1.01s)
  • storage.TestAccCreateFile (3.97s)
  • storage.TestAccDeleteInvalidMountFails (142.61s)
  • storage.TestAccInvalidSecretScopeFails (9.02s)
  • storage.TestAccSourceOnInvalidMountFails (36.74s)
  • storage/acceptance.TestAccDatabricksDBFSFile_CreateViaContent (15.44s)
  • storage/acceptance.TestAccDatabricksDBFSFile_CreateViaSource (11.87s)
  • workspace/acceptance.TestAccNotebookResourceMultipleFormats (17.19s)
  • workspace/acceptance.TestAccNotebookResourceScalability (6.32s)

@TravisBuddy
Copy link

Hey @nfx,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 70d594f0-ed55-11ea-b6ba-27fe84eba218

@nfx nfx removed the request for review from stikkireddy September 2, 2020 19:50
@nfx nfx merged commit 732b3f0 into master Sep 2, 2020
@nfx nfx deleted the plugin-sdk2-update branch September 2, 2020 19:52
@nfx nfx mentioned this pull request Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants