Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Bump dependencies #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

micnncim
Copy link

@micnncim micnncim commented Sep 25, 2022

Description of your changes

Upgrades Go to 1.19, golang.org/x/tools to v0.1.12, and github.com/crossplane/terrajet to v0.4.2, and then regenerates code with make generate.

make generate fails at the latest main branch:

$ make generate
17:08:53 [ .. ] verify dependencies have expected content
all modules verified
17:08:55 [ OK ] go modules dependencies verified
17:08:55 [ .. ] generating provider schema for hashicorp/google 4.18.0
17:08:58 [ OK ] generating provider schema for hashicorp/google 4.18.0
17:08:58 [ .. ] go generate darwin_arm64
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x50 pc=0x105d28f0c]

goroutine 1 [running]:
github.com/crossplane/terrajet/pkg/types.init.0()
        /Users/micnncim/src/github.com/crossplane-contrib/provider-jet-gcp/.work/pkg/pkg/mod/github.com/crossplane/[email protected]/pkg/types/reference.go:73 +0x10c
exit status 2
apis/generate.go:33: running "go": exit status 1
generate: open /Users/micnncim/src/github.com/crossplane-contrib/provider-jet-gcp/apis/cloudplatform/v1alpha2/zz_folder_types.go: no such file or directory
17:09:01 [FAIL]
make[1]: *** [build/makelib/golang.mk:271: go.generate] Error 1
make: *** [build/makelib/common.mk:419: generate] Error 2

System and Go information is below:

$ go version
go version go1.19 darwin/arm64

make reviewable test fails but it's been failed on the latest main branch:

main
$ make reviewable test
17:23:30 [ .. ] verify dependencies have expected content
all modules verified
17:23:31 [ OK ] go modules dependencies verified
17:23:31 [ .. ] generating provider schema for hashicorp/google 4.18.0
17:23:34 [ OK ] generating provider schema for hashicorp/google 4.18.0
17:23:34 [ .. ] go generate darwin_arm64
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x50 pc=0x105200f0c]

goroutine 1 [running]:
github.com/crossplane/terrajet/pkg/types.init.0()
        /Users/micnncim/src/github.com/crossplane-contrib/provider-jet-gcp/.work/pkg/pkg/mod/github.com/crossplane/[email protected]/pkg/types/reference.go:73 +0x10c
exit status 2
apis/generate.go:33: running "go": exit status 1
generate: open /Users/micnncim/src/github.com/crossplane-contrib/provider-jet-gcp/apis/cloudplatform/v1alpha2/zz_folder_types.go: no such file or directory
17:23:37 [FAIL]
make[2]: *** [build/makelib/golang.mk:271: go.generate] Error 1
make[1]: *** [build/makelib/common.mk:419: generate] Error 2
make: *** [build/makelib/common.mk:424: reviewable] Error 2

Upgrading golangci-lint to v1.49.0 fixes the above errors but it's necessary to fix the configuration and/or lint errors themselves. I think it should be out the scope of this change, so it should be fixed in another change.

golangci-lint v1.49.0
$ make reviewable test
17:20:56 [ .. ] verify dependencies have expected content
all modules verified
17:20:57 [ OK ] go modules dependencies verified
17:20:57 [ .. ] installing terraform darwin-arm64
Archive:  /Users/micnncim/src/github.com/crossplane-contrib/provider-jet-gcp/.cache/tools/darwin_arm64/tmp-terraform/terraform.zip
  inflating: /Users/micnncim/src/github.com/crossplane-contrib/provider-jet-gcp/.cache/tools/darwin_arm64/tmp-terraform/terraform
17:21:22 [ OK ] installing terraform darwin-arm64
17:21:22 [ .. ] generating provider schema for hashicorp/google 4.18.0
17:21:26 [ OK ] generating provider schema for hashicorp/google 4.18.0
17:21:27 [ .. ] go generate darwin_arm64
Skipping resource google_access_context_manager_service_perimeters because it is in SkipList
Skipping resource google_access_context_manager_access_levels because it is in SkipList

Generated 24 resources!
17:21:35 [ OK ] go generate darwin_arm64
17:21:35 [ .. ] go mod tidy
17:21:35 [ OK ] go mod tidy
17:21:36 [ .. ] verify dependencies have expected content
all modules verified
17:21:39 [ OK ] go modules dependencies verified
17:21:39 [ .. ] installing golangci-lint-v1.49.0 darwin-amd64
17:22:00 [ OK ] installing golangci-lint-v1.49.0 darwin-amd64
17:22:00 [ .. ] golangci-lint
WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
WARN [runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner.  Replaced by exportloopref.
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner.  Replaced by revive.
WARN [runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.
WARN [linters context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] sqlclosecheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.
cmd/provider/main.go:92:23: ProviderRunner not declared by package terraform (typecheck)
        var runner terraform.ProviderRunner = terraform.NewNoOpProviderRunner()
                             ^
cmd/provider/main.go:94:22: NewSharedProvider not declared by package terraform (typecheck)
                runner = terraform.NewSharedProvider(log, *nativeProviderPath, "registry.terraform.io/"+*providerSource)
                                   ^
cmd/provider/main.go:106:62: WithProviderRunner not declared by package terraform (typecheck)
                WorkspaceStore: terraform.NewWorkspaceStore(log, terraform.WithProviderRunner(runner)),
                                                                           ^
cmd/provider/main.go:110:5: o.SecretStoreConfigGVK undefined (type "github.com/crossplane/terrajet/pkg/controller".Options has no field or method SecretStoreConfigGVK) (typecheck)
                o.SecretStoreConfigGVK = &v1alpha1.StoreConfigGroupVersionKind
                  ^
config/provider.go:118:9: unlambda: replace `func(name string, terraformResource *schema.Resource, orgOpts ...tjconfig.ResourceOption) *tjconfig.Resource {
        return tjconfig.DefaultResource(name, terraformResource, append(orgOpts, opts...)...)
}` with `tjconfig.DefaultResource` (gocritic)
        return func(name string, terraformResource *schema.Resource, orgOpts ...tjconfig.ResourceOption) *tjconfig.Resource {
               ^
config/common/config.go:61: File is not `gofmt`-ed with `-s` (gofmt)
//  fails properly otherwise.
17:22:35 [FAIL]
make[2]: *** [build/makelib/golang.mk:194: go.lint] Error 1
make[1]: *** [build/makelib/common.mk:357: lint] Error 2
make: *** [build/makelib/common.mk:425: reviewable] Error 2

Related to crossplane/terrajet#271.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Upgrades Go to `1.19`, `golang.org/x/tools` to `v0.1.12`, and
`github.com/crossplane/terrajet` to `v0.4.2`, and then regenerates code
with `make generate`.

`make generate` fails at the latest main branch:

```
$ make generate
17:08:53 [ .. ] verify dependencies have expected content
all modules verified
17:08:55 [ OK ] go modules dependencies verified
17:08:55 [ .. ] generating provider schema for hashicorp/google 4.18.0
17:08:58 [ OK ] generating provider schema for hashicorp/google 4.18.0
17:08:58 [ .. ] go generate darwin_arm64
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x50 pc=0x105d28f0c]

goroutine 1 [running]:
github.com/crossplane/terrajet/pkg/types.init.0()
        /Users/micnncim/src/github.com/crossplane-contrib/provider-jet-gcp/.work/pkg/pkg/mod/github.com/crossplane/[email protected]/pkg/types/reference.go:73 +0x10c
exit status 2
apis/generate.go:33: running "go": exit status 1
generate: open /Users/micnncim/src/github.com/crossplane-contrib/provider-jet-gcp/apis/cloudplatform/v1alpha2/zz_folder_types.go: no such file or directory
17:09:01 [FAIL]
make[1]: *** [build/makelib/golang.mk:271: go.generate] Error 1
make: *** [build/makelib/common.mk:419: generate] Error 2
```

System and Go information is below:

```
$ go version
go version go1.19 darwin/arm64
```

Signed-off-by: micnncim <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant