Skip to content

Commit

Permalink
chore: Upgrade deps (#3389)
Browse files Browse the repository at this point in the history
<!-- Feel free to delete comments as you fill this in -->
- Upgrade libraries, tools, and Go version to 1.22.
- Add a note about the new field in the driver.
- Ignore linter warnings about using the new field (this will be
continued in SNOW-1917271).
- Replace `ConcatSlices` with `slices.Concat`.
- Exclude a listing rule for the generated structs.
- Remove `avast/retry-go` library. Use our own solution instead (it was
already used in other places before).
- Remove `golangci-lint` from tools. It is not needed, because of a
custom installation in the Makefile.
- Increase a warehouse test timeout.
- Fix tests of granting all streamlits and add a note to the docs about
the grants.
- Remove the deprecated linter.
<!-- summary of changes -->

## Test Plan
<!-- detail ways in which this PR has been tested or needs to be tested
-->
* [ ] acceptance tests
<!-- add more below if you think they are relevant -->
* [ ] …

## References
<!-- issues documentation links, etc  -->
#3322 
#3316

## TODO
- Upgrade Go to 1.23 and 1.24 when it's available
- Close relevant dependabot PRs.
  • Loading branch information
sfc-gh-jmichalak authored Feb 13, 2025
1 parent cb1d6e2 commit 086bf15
Show file tree
Hide file tree
Showing 29 changed files with 353 additions and 1,522 deletions.
7 changes: 4 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ run:
# skip-dirs:

linters-settings:

gosimple:
# Disable a rule for linting the generated converters in SDK.
checks: ["-ST1016"]
misspell:
locale: US
depguard:
Expand All @@ -16,14 +18,13 @@ linters-settings:
rules:
- name: if-return
disabled: true

linters:
disable-all: true
enable:
- whitespace
# unparam: Checks Go code for unused constants, variables, functions and types
# - unparam # todo: enabled
# checks for pointers to enclosing loop variables
- exportloopref
- gocritic
- misspell
# errcheck: Errcheck is a program for checking for unchecked errors in go programs.
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export TERRAFORM_PLUGIN_LOCAL_INSTALL=$(TERRAFORM_PLUGINS_DIR)/$(BASE_BINARY_NAM
default: help

dev-setup: ## setup development dependencies
@which ./bin/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.61.0
@which ./bin/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.63.4
cd tools && mkdir -p bin/
cd tools && env GOBIN=$$PWD/bin go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
cd tools && env GOBIN=$$PWD/bin go install mvdan.cc/gofumpt
Expand Down Expand Up @@ -43,7 +43,7 @@ lint-fix: ## Run static code analysis, check formatting and try to fix findings
./bin/golangci-lint run ./... -v --fix

mod: ## add missing and remove unused modules
go mod tidy -compat=1.21
go mod tidy -compat=1.22

mod-check: mod ## check if there are any missing/unused modules
git diff --exit-code -- go.mod go.sum
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/authentication_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Read more on Snowflake's password protection: https://docs.snowflake.com/en/user

* [Protecting secret values](#protecting-secret-values)
* [Snowflake authenticator flow (login + password)](#snowflake-authenticator-flow-login--password)
* [JWT authenticator flow](#jwt-authenticator-flow-)
* [JWT authenticator flow](#jwt-authenticator-flow)
* [JWT authenticator flow using passphrase](#jwt-authenticator-flow-using-passphrase)
* [MFA authenticator flow](#mfa-authenticator-flow)
* [MFA token caching](#mfa-token-caching)
Expand Down
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ provider "snowflake" {

**Warning: these values are passed directly to the gosnowflake library, which may not work exactly the way you expect. See the [gosnowflake docs](https://godoc.org/github.com/snowflakedb/gosnowflake#hdr-Connection_Parameters) for more.**

--> **Note: In Go Snowflake driver 1.12.1 ([release notes](https://docs.snowflake.com/en/release-notes/clients-drivers/golang-2024#version-1-12-1-december-05-2024)), configuration field `InsecureMode` has been deprecated in favor of `DisableOCSPChecks`. This field is not available in the provider yet. Please use `InsecureMode` instead, which has the same behavior. We are planning to support this new field and deprecate the old one.

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down
3 changes: 3 additions & 0 deletions docs/resources/grant_privileges_to_account_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ description: |-

~> **Note** When granting privileges on applications (for example, the default "SNOWFLAKE" application) use `on_account_object.object_type = "DATABASE"` instead.

<!-- TODO(SNOW-1844996): Remove this note.-->
-> **Note** Granting on future Streamlits is currently missing. It will be added in the future. Use [execute](./execute) resource instead.

# snowflake_grant_privileges_to_account_role (Resource)


Expand Down
3 changes: 3 additions & 0 deletions docs/resources/grant_privileges_to_database_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ description: |-

~> **Note** Manage grants on `HYBRID TABLE` by specifying `TABLE` or `TABLES` in `object_type` field. This applies to a single object, all objects, or future objects. This reflects the current behavior in Snowflake.

<!-- TODO(SNOW-1844996): Remove this note.-->
-> **Note** Granting on future Streamlits is currently missing. It will be added in the future. Use [execute](./execute) resource instead.

# snowflake_grant_privileges_to_database_role (Resource)


Expand Down
2 changes: 1 addition & 1 deletion framework/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ func (p *SnowflakeProvider) Configure(ctx context.Context, req provider.Configur
if !data.InsecureMode.IsNull() && !data.InsecureMode.IsUnknown() {
insecureMode = data.InsecureMode.ValueBool()
}
config.InsecureMode = insecureMode
config.InsecureMode = insecureMode //nolint:staticcheck

ocspFailOpen := getBoolEnv("SNOWFLAKE_OCSP_FAIL_OPEN", true)
if !data.OCSPFailOpen.IsNull() && !data.OCSPFailOpen.IsUnknown() {
Expand Down
113 changes: 56 additions & 57 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
module github.com/Snowflake-Labs/terraform-provider-snowflake

go 1.21
go 1.22.10

require (
github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/avast/retry-go v3.0.0+incompatible
github.com/brianvoe/gofakeit/v6 v6.28.0
github.com/gookit/color v1.5.4
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/terraform-json v0.21.0
github.com/hashicorp/terraform-plugin-framework v1.8.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-go v0.22.2
github.com/hashicorp/terraform-json v0.24.0
github.com/hashicorp/terraform-plugin-framework v1.13.0
github.com/hashicorp/terraform-plugin-framework-validators v0.16.0
github.com/hashicorp/terraform-plugin-go v0.26.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-mux v0.15.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
github.com/hashicorp/terraform-plugin-testing v1.6.0
github.com/jmoiron/sqlx v1.3.5
github.com/hashicorp/terraform-plugin-mux v0.18.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0
github.com/hashicorp/terraform-plugin-testing v1.11.0
github.com/jmoiron/sqlx v1.4.0
github.com/luna-duclos/instrumentedsql v1.1.3
github.com/pelletier/go-toml/v2 v2.1.1
github.com/snowflakedb/gosnowflake v1.10.0
github.com/stretchr/testify v1.8.4
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a
golang.org/x/crypto v0.23.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/text v0.15.0
github.com/pelletier/go-toml/v2 v2.2.3
github.com/snowflakedb/gosnowflake v1.13.0
github.com/stretchr/testify v1.10.0
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78
golang.org/x/crypto v0.33.0
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac
golang.org/x/text v0.22.0
)

require (
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
golang.org/x/tools v0.21.0 // indirect
golang.org/x/tools v0.30.0 // indirect
)

require (
Expand All @@ -42,54 +39,56 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.1.0 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect
github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect
github.com/ProtonMail/go-crypto v1.1.3 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apache/arrow/go/v15 v15.0.0 // indirect
github.com/apache/arrow/go/v16 v16.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/aws/aws-sdk-go-v2 v1.21.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.41 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.88 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.14 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.36 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.4 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.40.0 // indirect
github.com/aws/smithy-go v1.14.2 // indirect
github.com/aws/aws-sdk-go-v2 v1.26.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.11 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/danieljoos/wincred v1.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.7 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/flatbuffers v23.5.26+incompatible // indirect
github.com/google/flatbuffers v24.3.25+incompatible // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.6.3 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/hashicorp/go-plugin v1.6.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hc-install v0.9.1 // indirect
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.20.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-exec v0.22.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.4 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand All @@ -99,25 +98,25 @@ require (
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
github.com/zclconf/go-cty v1.14.2 // indirect
github.com/zclconf/go-cty v1.16.2 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
golang.org/x/mod v0.23.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.69.4 // indirect
google.golang.org/protobuf v1.36.3 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 086bf15

Please sign in to comment.