artefactual-sdps / enduro

A tool to support ingest and automation in digital preservation workflows
https://enduro.readthedocs.io/
Apache License 2.0
4 stars 3 forks source link

Problem: `grpc.DialContext` and `grpc.WithBlock` functions are deprecated #1012

Open jraddaoui opened 3 months ago

jraddaoui commented 3 months ago

Is your request related to a problem? Please describe.

After upgrading google.golang.org/grpc from v1.63.2 to v1.65.0, a couple of deprecation warnings are being reported by golangci-lint:

internal/telemetry/traces.go:36:15: SA1019: grpc.DialContext is deprecated: use NewClient instead.  Will be supported throughout 1.x. (staticcheck)
    conn, err := grpc.DialContext(
                 ^
internal/telemetry/traces.go:40:3: SA1019: grpc.WithBlock is deprecated: this DialOption is not supported by NewClient. Will be supported throughout 1.x. (staticcheck)
        grpc.WithBlock(),
        ^
internal/a3m/client.go:21:15: SA1019: grpc.DialContext is deprecated: use NewClient instead.  Will be supported throughout 1.x. (staticcheck)
    conn, err := grpc.DialContext(
                 ^

More info about the deprecation:

Describe the solution you'd like

For now, after the changes in https://github.com/artefactual-sdps/enduro/pull/1011, we are ignoring those warnings. But we should consider using grpc.NewClient, which raises a couple of questions:

Describe alternatives you've considered

Keep ignoring the warning until we upgrade google.golang.org/grpc to version 2.x.