From 69e47e1fae32ddadae2fe16c3d0e77cc4e40cc0d Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 13 Jul 2023 12:02:16 +0300 Subject: [PATCH 1/7] chore: bump and update pqtype in go.mod pqtype has moved to https://github.com/sqlc-dev/pqtype from http://github.com/tabbed/pqtype See: https://github.com/coder/coder/network/updates/693763692 for details --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 6ebb406824020..404e5e89f03d7 100644 --- a/go.mod +++ b/go.mod @@ -141,7 +141,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/swaggo/http-swagger/v2 v2.0.1 github.com/swaggo/swag v1.8.6 - github.com/tabbed/pqtype v0.1.1 + github.com/sqlc-dev/pqtype v0.2.0 github.com/u-root/u-root v0.11.0 github.com/unrolled/secure v1.13.0 github.com/valyala/fasthttp v1.48.0 From a831c3e21de8008c0a0b9777024aeab372bd7e23 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 13 Jul 2023 09:13:23 +0000 Subject: [PATCH 2/7] replace all occurrences and `go mod tidy` --- coderd/apikey/apikey.go | 2 +- coderd/audit.go | 2 +- coderd/audit/request.go | 2 +- coderd/database/dbgen/dbgen.go | 2 +- coderd/httpmw/apikey.go | 2 +- coderd/httpmw/authorize_test.go | 2 +- coderd/provisionerdserver/provisionerdserver.go | 2 +- coderd/templateversions.go | 2 +- coderd/wsbuilder/wsbuilder.go | 2 +- enterprise/audit/audittest/rand.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/coderd/apikey/apikey.go b/coderd/apikey/apikey.go index a5741043ab84d..8abba96421914 100644 --- a/coderd/apikey/apikey.go +++ b/coderd/apikey/apikey.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/xerrors" "github.com/coder/coder/coderd/database" diff --git a/coderd/audit.go b/coderd/audit.go index bfcdf38e0bb31..18eb155743c0e 100644 --- a/coderd/audit.go +++ b/coderd/audit.go @@ -11,7 +11,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/xerrors" "cdr.dev/slog" diff --git a/coderd/audit/request.go b/coderd/audit/request.go index 34a148531ee02..aec89ef3d308e 100644 --- a/coderd/audit/request.go +++ b/coderd/audit/request.go @@ -10,7 +10,7 @@ import ( "strconv" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "cdr.dev/slog" "github.com/coder/coder/coderd/database" diff --git a/coderd/database/dbgen/dbgen.go b/coderd/database/dbgen/dbgen.go index 93002010d5765..23ccfe71ac61a 100644 --- a/coderd/database/dbgen/dbgen.go +++ b/coderd/database/dbgen/dbgen.go @@ -13,8 +13,8 @@ import ( "github.com/google/uuid" "github.com/moby/moby/pkg/namesgenerator" + "github.com/sqlc-dev/pqtype" "github.com/stretchr/testify/require" - "github.com/tabbed/pqtype" "github.com/coder/coder/coderd/database" "github.com/coder/coder/coderd/database/dbauthz" diff --git a/coderd/httpmw/apikey.go b/coderd/httpmw/apikey.go index 65732b0fcab92..3de05b073ced5 100644 --- a/coderd/httpmw/apikey.go +++ b/coderd/httpmw/apikey.go @@ -14,7 +14,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/oauth2" "golang.org/x/xerrors" diff --git a/coderd/httpmw/authorize_test.go b/coderd/httpmw/authorize_test.go index a0c0baaf19340..1418d0b65ffb9 100644 --- a/coderd/httpmw/authorize_test.go +++ b/coderd/httpmw/authorize_test.go @@ -12,8 +12,8 @@ import ( "github.com/go-chi/chi/v5" "github.com/google/uuid" + "github.com/sqlc-dev/pqtype" "github.com/stretchr/testify/require" - "github.com/tabbed/pqtype" "github.com/coder/coder/coderd/database" "github.com/coder/coder/coderd/database/dbtestutil" diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index 163abe1c21d33..e416c6b80b07f 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -16,7 +16,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" semconv "go.opentelemetry.io/otel/semconv/v1.14.0" "go.opentelemetry.io/otel/trace" "golang.org/x/exp/maps" diff --git a/coderd/templateversions.go b/coderd/templateversions.go index 37a7bba98b2be..fab6dbb305ca1 100644 --- a/coderd/templateversions.go +++ b/coderd/templateversions.go @@ -13,7 +13,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/google/uuid" "github.com/moby/moby/pkg/namesgenerator" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/xerrors" "cdr.dev/slog" diff --git a/coderd/wsbuilder/wsbuilder.go b/coderd/wsbuilder/wsbuilder.go index a1f8948a25aa5..7f6d840f9db6d 100644 --- a/coderd/wsbuilder/wsbuilder.go +++ b/coderd/wsbuilder/wsbuilder.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/lib/pq" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "golang.org/x/xerrors" "github.com/coder/coder/coderd/database" diff --git a/enterprise/audit/audittest/rand.go b/enterprise/audit/audittest/rand.go index 5bf443142ae19..c1560825f0e37 100644 --- a/enterprise/audit/audittest/rand.go +++ b/enterprise/audit/audittest/rand.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/uuid" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" "github.com/coder/coder/coderd/database" ) diff --git a/go.mod b/go.mod index 404e5e89f03d7..d4a00559945b3 100644 --- a/go.mod +++ b/go.mod @@ -138,10 +138,10 @@ require ( github.com/robfig/cron/v3 v3.0.1 github.com/spf13/afero v1.9.5 github.com/spf13/pflag v1.0.5 + github.com/sqlc-dev/pqtype v0.2.0 github.com/stretchr/testify v1.8.4 github.com/swaggo/http-swagger/v2 v2.0.1 github.com/swaggo/swag v1.8.6 - github.com/sqlc-dev/pqtype v0.2.0 github.com/u-root/u-root v0.11.0 github.com/unrolled/secure v1.13.0 github.com/valyala/fasthttp v1.48.0 diff --git a/go.sum b/go.sum index fd47f877a2717..1d9544181ee4b 100644 --- a/go.sum +++ b/go.sum @@ -772,6 +772,8 @@ github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/sqlc-dev/pqtype v0.2.0 h1:zfzDpAxjCU0/GO7EgZ7ELUh0w28SrMSHzO3rH5Wd3is= +github.com/sqlc-dev/pqtype v0.2.0/go.mod h1:oyUjp5981ctiL9UYvj1bVvCKi8OXkCa0u645hce7CAs= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= @@ -798,8 +800,6 @@ github.com/swaggo/http-swagger/v2 v2.0.1/go.mod h1:XYhrQVIKz13CxuKD4p4kvpaRB4jJ1 github.com/swaggo/swag v1.8.6 h1:2rgOaLbonWu1PLP6G+/rYjSvPg0jQE0HtrEKuE380eg= github.com/swaggo/swag v1.8.6/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tabbed/pqtype v0.1.1 h1:PhEcb9JZ8jr7SUjJDFjRPxny0M8fkXZrxn/a9yQfoZg= -github.com/tabbed/pqtype v0.1.1/go.mod h1:HLt2kLJPcUhODQkYn3mJkMHXVsuv3Z2n5NZEeKXL0Uk= github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af h1:6yITBqGTE2lEeTPG04SN9W+iWHCRyHqlVYILiSXziwk= github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af/go.mod h1:4F09kP5F+am0jAwlQLddpoMDM+iewkxxt6nxUQ5nq5o= github.com/tailscale/certstore v0.1.1-0.20220316223106-78d6e1c49d8d h1:K3j02b5j2Iw1xoggN9B2DIEkhWGheqFOeDkdJdBrJI8= From a0481cccbd9b5596a7d901e1fbcbc888c6961fd6 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 13 Jul 2023 10:51:17 +0000 Subject: [PATCH 3/7] replace --- coderd/database/models.go | 2 +- coderd/database/queries.sql.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/coderd/database/models.go b/coderd/database/models.go index 35ab32c134ee0..75950c66176d3 100644 --- a/coderd/database/models.go +++ b/coderd/database/models.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/lib/pq" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" ) type APIKeyScope string diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index 78537c65ff5df..46c649e89edac 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/lib/pq" - "github.com/tabbed/pqtype" + "github.com/sqlc-dev/pqtype" ) const deleteAPIKeyByID = `-- name: DeleteAPIKeyByID :exec From 49d79224d9cd05495b3c42ecd4fb7b936218f325 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 13 Jul 2023 12:03:49 +0000 Subject: [PATCH 4/7] go mod tidy --- enterprise/cli/licenses.go | 3 ++- go.mod | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/enterprise/cli/licenses.go b/enterprise/cli/licenses.go index 4258081df3e24..ce4b3c7ba5ac7 100644 --- a/enterprise/cli/licenses.go +++ b/enterprise/cli/licenses.go @@ -12,10 +12,11 @@ import ( "golang.org/x/xerrors" + "github.com/google/uuid" + "github.com/coder/coder/cli/clibase" "github.com/coder/coder/cli/cliui" "github.com/coder/coder/codersdk" - "github.com/google/uuid" ) var jwtRegexp = regexp.MustCompile(`^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$`) diff --git a/go.mod b/go.mod index d4a00559945b3..bfcd427eaf1cd 100644 --- a/go.mod +++ b/go.mod @@ -345,7 +345,7 @@ require ( go.opentelemetry.io/otel/metric v1.16.0 // indirect go.opentelemetry.io/proto/otlp v0.19.0 // indirect go4.org/mem v0.0.0-20210711025021-927187094b94 // indirect - golang.org/x/net v0.12.0 // indirect + golang.org/x/net v0.12.0 golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.3.0 // indirect golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect From 7bcf6c8bac812c16994163cd19e7a502e9e667e1 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 13 Jul 2023 12:24:03 +0000 Subject: [PATCH 5/7] workaround untill sqlc 1.20.0 is released --- go.mod | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go.mod b/go.mod index bfcd427eaf1cd..4ce54a0bc8b17 100644 --- a/go.mod +++ b/go.mod @@ -50,6 +50,9 @@ replace github.com/gliderlabs/ssh => github.com/coder/ssh v0.0.0-20230621095435- // Waiting on https://github.com/imulab/go-scim/pull/95 to merge. replace github.com/imulab/go-scim/pkg/v2 => github.com/coder/go-scim/pkg/v2 v2.0.0-20230221055123-1d63c1222136 +// Waiting for https://github.com/kyleconroy/sqlc/pull/2418 to be released in sqlc 1.20.0 +replace github.com/tabbed/pqtype v0.2.0 => github.com/sqlc-dev/pqtype v0.2.0 + require ( cdr.dev/slog v1.5.4 cloud.google.com/go/compute/metadata v0.2.3 From 0b8d9db2ad0981105aa9e61e87c6c196a438b53d Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 13 Jul 2023 15:02:03 +0000 Subject: [PATCH 6/7] revert --- go.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 4ce54a0bc8b17..18312d2103eed 100644 --- a/go.mod +++ b/go.mod @@ -50,8 +50,8 @@ replace github.com/gliderlabs/ssh => github.com/coder/ssh v0.0.0-20230621095435- // Waiting on https://github.com/imulab/go-scim/pull/95 to merge. replace github.com/imulab/go-scim/pkg/v2 => github.com/coder/go-scim/pkg/v2 v2.0.0-20230221055123-1d63c1222136 -// Waiting for https://github.com/kyleconroy/sqlc/pull/2418 to be released in sqlc 1.20.0 -replace github.com/tabbed/pqtype v0.2.0 => github.com/sqlc-dev/pqtype v0.2.0 +// Waiting for https://github.com/kyleconroy/sqlc/pull/2418 to be released in sqlc 1.19.1. +// replace github.com/tabbed/pqtype v0.2.0 => github.com/sqlc-dev/pqtype v0.2.0 require ( cdr.dev/slog v1.5.4 From 8a1125ae169f5796f656da5b2f1b395bc2d1e04a Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 13 Jul 2023 15:22:40 +0000 Subject: [PATCH 7/7] remove workaround --- go.mod | 3 --- 1 file changed, 3 deletions(-) diff --git a/go.mod b/go.mod index 18312d2103eed..bfcd427eaf1cd 100644 --- a/go.mod +++ b/go.mod @@ -50,9 +50,6 @@ replace github.com/gliderlabs/ssh => github.com/coder/ssh v0.0.0-20230621095435- // Waiting on https://github.com/imulab/go-scim/pull/95 to merge. replace github.com/imulab/go-scim/pkg/v2 => github.com/coder/go-scim/pkg/v2 v2.0.0-20230221055123-1d63c1222136 -// Waiting for https://github.com/kyleconroy/sqlc/pull/2418 to be released in sqlc 1.19.1. -// replace github.com/tabbed/pqtype v0.2.0 => github.com/sqlc-dev/pqtype v0.2.0 - require ( cdr.dev/slog v1.5.4 cloud.google.com/go/compute/metadata v0.2.3