From 814769373f6ea86c027e6551122880282d8e8128 Mon Sep 17 00:00:00 2001 From: Alex Kucksdorf Date: Wed, 26 Oct 2022 12:14:04 +0200 Subject: [PATCH 01/26] [sqlserver] Ensure version table in provided schema Closes #839 --- database/sqlserver/sqlserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/sqlserver/sqlserver.go b/database/sqlserver/sqlserver.go index 90e3926df..c1220b555 100644 --- a/database/sqlserver/sqlserver.go +++ b/database/sqlserver/sqlserver.go @@ -365,10 +365,10 @@ func (ss *SQLServer) ensureVersionTable() (err error) { query := `IF NOT EXISTS (SELECT * FROM sysobjects - WHERE id = object_id(N'[dbo].[` + ss.config.MigrationsTable + `]') + WHERE id = object_id(N'[` + ss.config.SchemaName + `].[` + ss.config.MigrationsTable + `]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1 ) - CREATE TABLE ` + ss.config.MigrationsTable + ` ( version BIGINT PRIMARY KEY NOT NULL, dirty BIT NOT NULL );` + CREATE TABLE [` + ss.config.SchemaName + `].[` + ss.config.MigrationsTable + `] ( version BIGINT PRIMARY KEY NOT NULL, dirty BIT NOT NULL );` if _, err = ss.conn.ExecContext(context.Background(), query); err != nil { return &database.Error{OrigErr: err, Query: []byte(query)} From 0350a00606ffb68b0036adc93561fa3dc2b67115 Mon Sep 17 00:00:00 2001 From: Alex Kucksdorf Date: Wed, 26 Oct 2022 12:51:46 +0200 Subject: [PATCH 02/26] [sqlserver] Always access version table with explicit schema --- database/sqlserver/sqlserver.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/database/sqlserver/sqlserver.go b/database/sqlserver/sqlserver.go index c1220b555..3cfa48bf9 100644 --- a/database/sqlserver/sqlserver.go +++ b/database/sqlserver/sqlserver.go @@ -263,7 +263,7 @@ func (ss *SQLServer) SetVersion(version int, dirty bool) error { return &database.Error{OrigErr: err, Err: "transaction start failed"} } - query := `TRUNCATE TABLE "` + ss.config.MigrationsTable + `"` + query := `TRUNCATE TABLE ` + ss.getMigrationTable() if _, err := tx.Exec(query); err != nil { if errRollback := tx.Rollback(); errRollback != nil { err = multierror.Append(err, errRollback) @@ -279,7 +279,7 @@ func (ss *SQLServer) SetVersion(version int, dirty bool) error { if dirty { dirtyBit = 1 } - query = `INSERT INTO "` + ss.config.MigrationsTable + `" (version, dirty) VALUES (@p1, @p2)` + query = `INSERT INTO ` + ss.getMigrationTable() + ` (version, dirty) VALUES (@p1, @p2)` if _, err := tx.Exec(query, version, dirtyBit); err != nil { if errRollback := tx.Rollback(); errRollback != nil { err = multierror.Append(err, errRollback) @@ -297,7 +297,7 @@ func (ss *SQLServer) SetVersion(version int, dirty bool) error { // Version of the current database state func (ss *SQLServer) Version() (version int, dirty bool, err error) { - query := `SELECT TOP 1 version, dirty FROM "` + ss.config.MigrationsTable + `"` + query := `SELECT TOP 1 version, dirty FROM ` + ss.getMigrationTable() err = ss.conn.QueryRowContext(context.Background(), query).Scan(&version, &dirty) switch { case err == sql.ErrNoRows: @@ -365,10 +365,10 @@ func (ss *SQLServer) ensureVersionTable() (err error) { query := `IF NOT EXISTS (SELECT * FROM sysobjects - WHERE id = object_id(N'[` + ss.config.SchemaName + `].[` + ss.config.MigrationsTable + `]') + WHERE id = object_id(N'` + ss.getMigrationTable() + `') AND OBJECTPROPERTY(id, N'IsUserTable') = 1 ) - CREATE TABLE [` + ss.config.SchemaName + `].[` + ss.config.MigrationsTable + `] ( version BIGINT PRIMARY KEY NOT NULL, dirty BIT NOT NULL );` + CREATE TABLE ` + ss.getMigrationTable() + ` ( version BIGINT PRIMARY KEY NOT NULL, dirty BIT NOT NULL );` if _, err = ss.conn.ExecContext(context.Background(), query); err != nil { return &database.Error{OrigErr: err, Query: []byte(query)} @@ -377,6 +377,10 @@ func (ss *SQLServer) ensureVersionTable() (err error) { return nil } +func (ss *SQLServer) getMigrationTable() string { + return fmt.Sprintf("[%s].[%s]", ss.config.SchemaName, ss.config.MigrationsTable) +} + func getMSITokenProvider(resource string) (func() (string, error), error) { msi, err := adal.NewServicePrincipalTokenFromManagedIdentity(resource, nil) if err != nil { From a860f0cbd4946f829b080e8133f37c5ef61cf246 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:22:36 +0000 Subject: [PATCH 03/26] Bump github.com/dvsekhvalnov/jose2go from 1.5.0 to 1.6.0 Bumps [github.com/dvsekhvalnov/jose2go](https://github.com/dvsekhvalnov/jose2go) from 1.5.0 to 1.6.0. - [Commits](https://github.com/dvsekhvalnov/jose2go/compare/v1.5...v1.6.0) --- updated-dependencies: - dependency-name: github.com/dvsekhvalnov/jose2go dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4fb259b69..b5678692c 100644 --- a/go.mod +++ b/go.mod @@ -86,7 +86,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712 // indirect github.com/envoyproxy/go-control-plane v0.11.1 // indirect github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect diff --git a/go.sum b/go.sum index 0b001a7d0..f5d80e340 100644 --- a/go.sum +++ b/go.sum @@ -171,8 +171,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712 h1:aaQcKT9WumO6JEJcRyTqFVq4XUZiUcKR2/GI31TOcz8= github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= From 94b8fa5946f9b23b88951df698e9b6e0ef31597c Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Fri, 5 Jan 2024 15:34:45 -0500 Subject: [PATCH 04/26] rqlite is spelled with all lowercase I'm the creator of rqlite, so wanted to fix the title. See https://rqlite.io/ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 359c7b3ab..ad1c73dc7 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Database drivers run migrations. [Add a new database?](database/driver.go) * [ClickHouse](database/clickhouse) * [Firebird](database/firebird) * [MS SQL Server](database/sqlserver) -* [RQLite](database/rqlite) +* [rqlite](database/rqlite) ### Database URLs From 7f85f9cf64023fccf82a97ed7a662f7b2a573811 Mon Sep 17 00:00:00 2001 From: occupyhabit Date: Sat, 23 Mar 2024 21:49:28 +0800 Subject: [PATCH 05/26] chore: fix some typos Signed-off-by: occupyhabit --- README.md | 2 +- database/clickhouse/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad1c73dc7..e672a2b51 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ Each migration has an up and down migration. [Why?](FAQ.md#why-two-separate-file ## Coming from another db migration tool? Check out [migradaptor](https://github.com/musinit/migradaptor/). -*Note: migradaptor is not affliated or supported by this project* +*Note: migradaptor is not affiliated or supported by this project* ## Versions diff --git a/database/clickhouse/README.md b/database/clickhouse/README.md index a3cea9298..9357efcfd 100644 --- a/database/clickhouse/README.md +++ b/database/clickhouse/README.md @@ -16,7 +16,7 @@ ## Notes -* The Clickhouse driver does not natively support executing multipe statements in a single query. To allow for multiple statements in a single migration, you can use the `x-multi-statement` param. There are two important caveats: +* The Clickhouse driver does not natively support executing multiple statements in a single query. To allow for multiple statements in a single migration, you can use the `x-multi-statement` param. There are two important caveats: * This mode splits the migration text into separately-executed statements by a semi-colon `;`. Thus `x-multi-statement` cannot be used when a statement in the migration contains a string with a semi-colon. * The queries are not executed in any sort of transaction/batch, meaning you are responsible for fixing partial migrations. * Using the default TinyLog table engine for the schema_versions table prevents backing up the table if using the [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) tool. If backing up the database with make sure the migrations are run with `x-migrations-table-engine=MergeTree`. From ff8a961068dd83b9cbcfcbe02b4dc69cd98c7349 Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Sun, 24 Mar 2024 22:30:38 -0700 Subject: [PATCH 06/26] Update yugabyte test images --- database/yugabytedb/yugabytedb_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/yugabytedb/yugabytedb_test.go b/database/yugabytedb/yugabytedb_test.go index dc9103ece..fdcb9a2ba 100644 --- a/database/yugabytedb/yugabytedb_test.go +++ b/database/yugabytedb/yugabytedb_test.go @@ -33,8 +33,8 @@ var ( } // Released versions: https://docs.yugabyte.com/preview/releases/release-notes/ specs = []dktesting.ContainerSpec{ - {ImageName: "yugabytedb/yugabyte:2.14.10.4-b1", Options: opts}, - {ImageName: "yugabytedb/yugabyte:2.20.0.2-b1", Options: opts}, + {ImageName: "yugabytedb/yugabyte:2.14.15.0-b57", Options: opts}, + {ImageName: "yugabytedb/yugabyte:2.20.2.1-b3", Options: opts}, } ) From e9133367d77718c1af328e1d587016a513508d37 Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Sun, 24 Mar 2024 22:34:00 -0700 Subject: [PATCH 07/26] Drop support for Go 1.20 and add support for Go 1.22 --- .github/workflows/ci.yaml | 6 +++--- Dockerfile | 2 +- README.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fbde0204f..eea094fdf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: "1.22.x" - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v3 @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ["1.20.x", "1.21.x"] + go: ["1.21.x", "1.22.x"] steps: - uses: actions/checkout@v4 @@ -68,7 +68,7 @@ jobs: ruby-version: 2.7 - uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: "1.22.x" - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 diff --git a/Dockerfile b/Dockerfile index 779cbcab2..9f4265339 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21-alpine3.19 AS builder +FROM golang:1.22-alpine3.19 AS builder ARG VERSION RUN apk add --no-cache git gcc musl-dev make diff --git a/README.md b/README.md index e672a2b51..975348685 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Coverage Status](https://img.shields.io/coveralls/github/golang-migrate/migrate/master.svg)](https://coveralls.io/github/golang-migrate/migrate?branch=master) [![packagecloud.io](https://img.shields.io/badge/deb-packagecloud.io-844fec.svg)](https://packagecloud.io/golang-migrate/migrate?filter=debs) [![Docker Pulls](https://img.shields.io/docker/pulls/migrate/migrate.svg)](https://hub.docker.com/r/migrate/migrate/) -![Supported Go Versions](https://img.shields.io/badge/Go-1.20%2C%201.21-lightgrey.svg) +![Supported Go Versions](https://img.shields.io/badge/Go-1.21%2C%201.22-lightgrey.svg) [![GitHub Release](https://img.shields.io/github/release/golang-migrate/migrate.svg)](https://github.com/golang-migrate/migrate/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/golang-migrate/migrate/v4)](https://goreportcard.com/report/github.com/golang-migrate/migrate/v4) From 9d70a397e4c2f27ee4cd6a8d8b3ed13254939973 Mon Sep 17 00:00:00 2001 From: goodfirm Date: Wed, 10 Apr 2024 14:36:20 +0800 Subject: [PATCH 08/26] chore: fix some typos in comments Signed-off-by: goodfirm --- database/cockroachdb/TUTORIAL.md | 2 +- database/mysql/README.md | 2 +- database/mysql/mysql_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/database/cockroachdb/TUTORIAL.md b/database/cockroachdb/TUTORIAL.md index d8cea6159..f8c9e7c06 100644 --- a/database/cockroachdb/TUTORIAL.md +++ b/database/cockroachdb/TUTORIAL.md @@ -15,7 +15,7 @@ CREATE USER IF NOT EXISTS cockroach; GRANT ALL ON DATABASE example TO cockroach; ``` -When using Migrate CLI we need to pass to database URL. Let's export it to a variable for convienience: +When using Migrate CLI we need to pass to database URL. Let's export it to a variable for convenience: ``` export COCKROACHDB_URL='cockroachdb://cockroach:@localhost:26257/example?sslmode=disable' ``` diff --git a/database/mysql/README.md b/database/mysql/README.md index 00aca683d..a687b1dd0 100644 --- a/database/mysql/README.md +++ b/database/mysql/README.md @@ -14,7 +14,7 @@ | `port` | | The port to bind to. | | `tls` | | TLS / SSL encrypted connection parameter; see [go-sql-driver](https://github.com/go-sql-driver/mysql#tls). Use any name (e.g. `migrate`) if you want to use a custom TLS config (`x-tls-` queries). | | `x-tls-ca` | | The location of the CA (certificate authority) file. | -| `x-tls-cert` | | The location of the client certicicate file. Must be used with `x-tls-key`. | +| `x-tls-cert` | | The location of the client certificate file. Must be used with `x-tls-key`. | | `x-tls-key` | | The location of the private key file. Must be used with `x-tls-cert`. | | `x-tls-insecure-skip-verify` | | Whether or not to use SSL (true\|false) | diff --git a/database/mysql/mysql_test.go b/database/mysql/mysql_test.go index 09d95fc9a..0f675d438 100644 --- a/database/mysql/mysql_test.go +++ b/database/mysql/mysql_test.go @@ -391,7 +391,7 @@ func TestURLToMySQLConfig(t *testing.T) { // Not supported yet: https://github.com/go-sql-driver/mysql/issues/591 // {name: "user/password - user with encoded :", // urlStr: "mysql://username%3A:password@tcp(127.0.0.1:3306)/myDB?multiStatements=true", - // expectedDSN: "username::pasword@tcp(127.0.0.1:3306)/myDB?multiStatements=true"}, + // expectedDSN: "username::password@tcp(127.0.0.1:3306)/myDB?multiStatements=true"}, {name: "user/password - user with encoded @", urlStr: "mysql://username%40:password@tcp(127.0.0.1:3306)/myDB?multiStatements=true", expectedDSN: "username@:password@tcp(127.0.0.1:3306)/myDB?multiStatements=true"}, From 4bc6777f19c52750a7c544b79a457e5c81276bdb Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Sun, 14 Apr 2024 23:13:36 -0700 Subject: [PATCH 09/26] Add dktesting.Cleanup() method --- dktesting/dktesting.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dktesting/dktesting.go b/dktesting/dktesting.go index 342af2fdc..7a0785860 100644 --- a/dktesting/dktesting.go +++ b/dktesting/dktesting.go @@ -1,11 +1,15 @@ package dktesting import ( + "context" + "fmt" "testing" ) import ( "github.com/dhui/dktest" + "github.com/docker/docker/api/types" + "github.com/docker/docker/client" ) // ContainerSpec holds Docker testing setup specifications @@ -14,6 +18,26 @@ type ContainerSpec struct { Options dktest.Options } +// Cleanup cleanups the ContainerSpec after a test run by removing the ContainerSpec's image +func (s *ContainerSpec) Cleanup() (retErr error) { + // copied from dktest.RunContext() + dc, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion("1.41")) + if err != nil { + return err + } + defer func() { + if err := dc.Close(); err != nil && retErr == nil { + retErr = fmt.Errorf("error closing Docker client: %w", err) + } + }() + ctx, timeoutCancelFunc := context.WithTimeout(context.Background(), s.Options.CleanupTimeout) + defer timeoutCancelFunc() + if _, err := dc.ImageRemove(ctx, s.ImageName, types.ImageRemoveOptions{Force: true, PruneChildren: true}); err != nil { + return err + } + return nil +} + // ParallelTest runs Docker tests in parallel func ParallelTest(t *testing.T, specs []ContainerSpec, testFunc func(*testing.T, dktest.ContainerInfo)) { From 2884a8e8517a7a40169568f2a3115ab13d0888df Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Mon, 15 Apr 2024 00:16:54 -0700 Subject: [PATCH 10/26] Cleanup postgres images after tests run --- database/postgres/postgres_test.go | 52 ++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/database/postgres/postgres_test.go b/database/postgres/postgres_test.go index 65395cc7e..02bf991b8 100644 --- a/database/postgres/postgres_test.go +++ b/database/postgres/postgres_test.go @@ -85,6 +85,32 @@ func mustRun(t *testing.T, d database.Driver, statements []string) { } func Test(t *testing.T) { + t.Run("test", test) + t.Run("testMigrate", testMigrate) + t.Run("testMultipleStatements", testMultipleStatements) + t.Run("testMultipleStatementsInMultiStatementMode", testMultipleStatementsInMultiStatementMode) + t.Run("testErrorParsing", testErrorParsing) + t.Run("testFilterCustomQuery", testFilterCustomQuery) + t.Run("testWithSchema", testWithSchema) + t.Run("testMigrationTableOption", testMigrationTableOption) + t.Run("testFailToCreateTableWithoutPermissions", testFailToCreateTableWithoutPermissions) + t.Run("testCheckBeforeCreateTable", testCheckBeforeCreateTable) + t.Run("testParallelSchema", testParallelSchema) + t.Run("testPostgresLock", testPostgresLock) + t.Run("testWithInstanceConcurrent", testWithInstanceConcurrent) + t.Run("testWithConnection", testWithConnection) + + t.Cleanup(func() { + for _, spec := range specs { + t.Log("Cleaning up ", spec.ImageName) + if err := spec.Cleanup(); err != nil { + t.Error("Error removing ", spec.ImageName, "error:", err) + } + } + }) +} + +func test(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -106,7 +132,7 @@ func Test(t *testing.T) { }) } -func TestMigrate(t *testing.T) { +func testMigrate(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -132,7 +158,7 @@ func TestMigrate(t *testing.T) { }) } -func TestMultipleStatements(t *testing.T) { +func testMultipleStatements(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -165,7 +191,7 @@ func TestMultipleStatements(t *testing.T) { }) } -func TestMultipleStatementsInMultiStatementMode(t *testing.T) { +func testMultipleStatementsInMultiStatementMode(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -198,7 +224,7 @@ func TestMultipleStatementsInMultiStatementMode(t *testing.T) { }) } -func TestErrorParsing(t *testing.T) { +func testErrorParsing(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -227,7 +253,7 @@ func TestErrorParsing(t *testing.T) { }) } -func TestFilterCustomQuery(t *testing.T) { +func testFilterCustomQuery(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -249,7 +275,7 @@ func TestFilterCustomQuery(t *testing.T) { }) } -func TestWithSchema(t *testing.T) { +func testWithSchema(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -319,7 +345,7 @@ func TestWithSchema(t *testing.T) { }) } -func TestMigrationTableOption(t *testing.T) { +func testMigrationTableOption(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -387,7 +413,7 @@ func TestMigrationTableOption(t *testing.T) { }) } -func TestFailToCreateTableWithoutPermissions(t *testing.T) { +func testFailToCreateTableWithoutPermissions(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -457,7 +483,7 @@ func TestFailToCreateTableWithoutPermissions(t *testing.T) { }) } -func TestCheckBeforeCreateTable(t *testing.T) { +func testCheckBeforeCreateTable(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -534,7 +560,7 @@ func TestCheckBeforeCreateTable(t *testing.T) { }) } -func TestParallelSchema(t *testing.T) { +func testParallelSchema(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -602,7 +628,7 @@ func TestParallelSchema(t *testing.T) { }) } -func TestPostgres_Lock(t *testing.T) { +func testPostgresLock(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -642,7 +668,7 @@ func TestPostgres_Lock(t *testing.T) { }) } -func TestWithInstance_Concurrent(t *testing.T) { +func testWithInstanceConcurrent(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -685,7 +711,7 @@ func TestWithInstance_Concurrent(t *testing.T) { }) } -func TestWithConnection(t *testing.T) { +func testWithConnection(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { From 1b707a76f41ce82e6ab05530f8c10166f4a9c47b Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Mon, 15 Apr 2024 00:06:52 -0700 Subject: [PATCH 11/26] Cleanup cassandra images after tests run --- database/cassandra/cassandra_test.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/database/cassandra/cassandra_test.go b/database/cassandra/cassandra_test.go index 87d21d9a1..84af2853e 100644 --- a/database/cassandra/cassandra_test.go +++ b/database/cassandra/cassandra_test.go @@ -61,6 +61,20 @@ func isReady(ctx context.Context, c dktest.ContainerInfo) bool { } func Test(t *testing.T) { + t.Run("test", test) + t.Run("testMigrate", testMigrate) + + t.Cleanup(func() { + for _, spec := range specs { + t.Log("Cleaning up ", spec.ImageName) + if err := spec.Cleanup(); err != nil { + t.Error("Error removing ", spec.ImageName, "error:", err) + } + } + }) +} + +func test(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.Port(9042) if err != nil { @@ -81,7 +95,7 @@ func Test(t *testing.T) { }) } -func TestMigrate(t *testing.T) { +func testMigrate(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.Port(9042) if err != nil { From 06614d9cf5ac6c68750a0975c1d042e17bb03d61 Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Mon, 15 Apr 2024 00:25:40 -0700 Subject: [PATCH 12/26] Cleanup yugabytedb images after tests run --- database/yugabytedb/yugabytedb_test.go | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/database/yugabytedb/yugabytedb_test.go b/database/yugabytedb/yugabytedb_test.go index fdcb9a2ba..05fb14fa7 100644 --- a/database/yugabytedb/yugabytedb_test.go +++ b/database/yugabytedb/yugabytedb_test.go @@ -91,6 +91,22 @@ func getConnectionString(ip, port string, options ...string) string { } func Test(t *testing.T) { + t.Run("test", test) + t.Run("testMigrate", testMigrate) + t.Run("testMultiStatement", testMultiStatement) + t.Run("testFilterCustomQuery", testFilterCustomQuery) + + t.Cleanup(func() { + for _, spec := range specs { + t.Log("Cleaning up ", spec.ImageName) + if err := spec.Cleanup(); err != nil { + t.Error("Error removing ", spec.ImageName, "error:", err) + } + } + }) +} + +func test(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, ci dktest.ContainerInfo) { createDB(t, ci) @@ -109,7 +125,7 @@ func Test(t *testing.T) { }) } -func TestMigrate(t *testing.T) { +func testMigrate(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, ci dktest.ContainerInfo) { createDB(t, ci) @@ -133,7 +149,7 @@ func TestMigrate(t *testing.T) { }) } -func TestMultiStatement(t *testing.T) { +func testMultiStatement(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, ci dktest.ContainerInfo) { createDB(t, ci) @@ -163,7 +179,7 @@ func TestMultiStatement(t *testing.T) { }) } -func TestFilterCustomQuery(t *testing.T) { +func testFilterCustomQuery(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, ci dktest.ContainerInfo) { createDB(t, ci) From 49cac86ab2d64ca41bb72f59c57a6aa60fd4d20c Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Mon, 15 Apr 2024 00:35:46 -0700 Subject: [PATCH 13/26] Cleanup mongodb images after tests run --- database/mongodb/mongodb_test.go | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/database/mongodb/mongodb_test.go b/database/mongodb/mongodb_test.go index f15f74113..8823bd9ca 100644 --- a/database/mongodb/mongodb_test.go +++ b/database/mongodb/mongodb_test.go @@ -74,6 +74,22 @@ func isReady(ctx context.Context, c dktest.ContainerInfo) bool { } func Test(t *testing.T) { + t.Run("test", test) + t.Run("testMigrate", testMigrate) + t.Run("testWithAuth", testWithAuth) + t.Run("testLockWorks", testLockWorks) + + t.Cleanup(func() { + for _, spec := range specs { + t.Log("Cleaning up ", spec.ImageName) + if err := spec.Cleanup(); err != nil { + t.Error("Error removing ", spec.ImageName, "error:", err) + } + } + }) +} + +func test(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -99,7 +115,7 @@ func Test(t *testing.T) { }) } -func TestMigrate(t *testing.T) { +func testMigrate(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -125,7 +141,7 @@ func TestMigrate(t *testing.T) { }) } -func TestWithAuth(t *testing.T) { +func testWithAuth(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -180,7 +196,7 @@ func TestWithAuth(t *testing.T) { }) } -func TestLockWorks(t *testing.T) { +func testLockWorks(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { @@ -241,6 +257,15 @@ func TestTransaction(t *testing.T) { {ImageName: "mongo:4", Options: dktest.Options{PortRequired: true, ReadyFunc: isReady, Cmd: []string{"mongod", "--bind_ip_all", "--replSet", "rs0"}}}, } + t.Cleanup(func() { + for _, spec := range transactionSpecs { + t.Log("Cleaning up ", spec.ImageName) + if err := spec.Cleanup(); err != nil { + t.Error("Error removing ", spec.ImageName, "error:", err) + } + } + }) + dktesting.ParallelTest(t, transactionSpecs, func(t *testing.T, c dktest.ContainerInfo) { ip, port, err := c.FirstPort() if err != nil { From b1d02e222f9a941096efc4a741728738b675d40f Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Mon, 15 Apr 2024 22:42:34 -0700 Subject: [PATCH 14/26] Cleanup sqlserver images after tests run --- database/sqlserver/sqlserver_test.go | 34 ++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/database/sqlserver/sqlserver_test.go b/database/sqlserver/sqlserver_test.go index afe7fd253..e7af5d7f9 100644 --- a/database/sqlserver/sqlserver_test.go +++ b/database/sqlserver/sqlserver_test.go @@ -96,6 +96,26 @@ func SkipIfUnsupportedArch(t *testing.T, c dktest.ContainerInfo) { } func Test(t *testing.T) { + t.Run("test", test) + t.Run("testMigrate", testMigrate) + t.Run("testMultiStatement", testMultiStatement) + t.Run("testErrorParsing", testErrorParsing) + t.Run("testLockWorks", testLockWorks) + t.Run("testMsiTrue", testMsiTrue) + t.Run("testOpenWithPasswordAndMSI", testOpenWithPasswordAndMSI) + t.Run("testMsiFalse", testMsiFalse) + + t.Cleanup(func() { + for _, spec := range specs { + t.Log("Cleaning up ", spec.ImageName) + if err := spec.Cleanup(); err != nil { + t.Error("Error removing ", spec.ImageName, "error:", err) + } + } + }) +} + +func test(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { SkipIfUnsupportedArch(t, c) ip, port, err := c.Port(defaultPort) @@ -120,7 +140,7 @@ func Test(t *testing.T) { }) } -func TestMigrate(t *testing.T) { +func testMigrate(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { SkipIfUnsupportedArch(t, c) ip, port, err := c.Port(defaultPort) @@ -149,7 +169,7 @@ func TestMigrate(t *testing.T) { }) } -func TestMultiStatement(t *testing.T) { +func testMultiStatement(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { SkipIfUnsupportedArch(t, c) ip, port, err := c.Port(defaultPort) @@ -183,7 +203,7 @@ func TestMultiStatement(t *testing.T) { }) } -func TestErrorParsing(t *testing.T) { +func testErrorParsing(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { SkipIfUnsupportedArch(t, c) ip, port, err := c.Port(defaultPort) @@ -215,7 +235,7 @@ func TestErrorParsing(t *testing.T) { }) } -func TestLockWorks(t *testing.T) { +func testLockWorks(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { SkipIfUnsupportedArch(t, c) ip, port, err := c.Port(defaultPort) @@ -254,7 +274,7 @@ func TestLockWorks(t *testing.T) { }) } -func TestMsiTrue(t *testing.T) { +func testMsiTrue(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { SkipIfUnsupportedArch(t, c) ip, port, err := c.Port(defaultPort) @@ -271,7 +291,7 @@ func TestMsiTrue(t *testing.T) { }) } -func TestOpenWithPasswordAndMSI(t *testing.T) { +func testOpenWithPasswordAndMSI(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { SkipIfUnsupportedArch(t, c) ip, port, err := c.Port(defaultPort) @@ -303,7 +323,7 @@ func TestOpenWithPasswordAndMSI(t *testing.T) { }) } -func TestMsiFalse(t *testing.T) { +func testMsiFalse(t *testing.T) { dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) { SkipIfUnsupportedArch(t, c) ip, port, err := c.Port(defaultPort) From f4950c144e7842eb59c91bbe3e5af1f830c0ee38 Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Mon, 15 Apr 2024 22:57:23 -0700 Subject: [PATCH 15/26] Fallback to dktest.DefaultCleanupTimeout if the dktest.Options doesn't have one specified --- dktesting/dktesting.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dktesting/dktesting.go b/dktesting/dktesting.go index 7a0785860..474bcc850 100644 --- a/dktesting/dktesting.go +++ b/dktesting/dktesting.go @@ -30,7 +30,11 @@ func (s *ContainerSpec) Cleanup() (retErr error) { retErr = fmt.Errorf("error closing Docker client: %w", err) } }() - ctx, timeoutCancelFunc := context.WithTimeout(context.Background(), s.Options.CleanupTimeout) + cleanupTimeout := s.Options.CleanupTimeout + if cleanupTimeout <= 0 { + cleanupTimeout = dktest.DefaultCleanupTimeout + } + ctx, timeoutCancelFunc := context.WithTimeout(context.Background(), cleanupTimeout) defer timeoutCancelFunc() if _, err := dc.ImageRemove(ctx, s.ImageName, types.ImageRemoveOptions{Force: true, PruneChildren: true}); err != nil { return err From 1a002d0e9e86a80c67409347498a7b5041238792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Tue, 16 Apr 2024 08:54:05 +0200 Subject: [PATCH 16/26] Set golangci-lint to 1.54.2 (latest is broken) (#1046) * Set golangci-lint to 1.54.2 (latest is broken) * Testing golangci-lint latest (1.57.1) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eea094fdf..c339251cf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,7 @@ jobs: go-version: "1.22.x" - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: latest From d1df97b2d1b80b99139de504f44e3efcf6de9555 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:18:25 +0000 Subject: [PATCH 17/26] Bump github.com/jackc/pgx/v4 from 4.18.1 to 4.18.2 Bumps [github.com/jackc/pgx/v4](https://github.com/jackc/pgx) from 4.18.1 to 4.18.2. - [Changelog](https://github.com/jackc/pgx/blob/v4.18.2/CHANGELOG.md) - [Commits](https://github.com/jackc/pgx/compare/v4.18.1...v4.18.2) --- updated-dependencies: - dependency-name: github.com/jackc/pgx/v4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- go.mod | 14 +++++++------- go.sum | 30 ++++++++++++++---------------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index b5678692c..fadb9b564 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/gocql/gocql v0.0.0-20210515062232-b7ef815b4556 github.com/google/go-github/v39 v39.2.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/jackc/pgconn v1.14.0 + github.com/jackc/pgconn v1.14.3 github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa - github.com/jackc/pgx/v4 v4.18.1 + github.com/jackc/pgx/v4 v4.18.2 github.com/jackc/pgx/v5 v5.3.1 github.com/ktrysmt/go-bitbucket v0.6.4 github.com/lib/pq v1.10.9 @@ -116,7 +116,7 @@ require ( github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgproto3/v2 v2.3.2 // indirect + github.com/jackc/pgproto3/v2 v2.3.3 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgtype v1.14.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect @@ -153,13 +153,13 @@ require ( github.com/zeebo/xxh3 v1.0.2 // indirect gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.17.0 // indirect + golang.org/x/crypto v0.20.0 // indirect golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 // indirect golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.18.0 // indirect + golang.org/x/net v0.21.0 // indirect golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/term v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/go.sum b/go.sum index f5d80e340..c879d379f 100644 --- a/go.sum +++ b/go.sum @@ -325,8 +325,8 @@ github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpT github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.14.0 h1:vrbA9Ud87g6JdFWkHTJXppVce58qPIdP7N8y0Ml/A7Q= -github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= +github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w= +github.com/jackc/pgconn v1.14.3/go.mod h1:RZbme4uasqzybK2RK5c65VsHxoyaml09lx3tXOcO/VM= github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa h1:s+4MhCQ6YrzisK6hFJUX53drDT4UsSW3DEhKn0ifuHw= github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= @@ -345,8 +345,8 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1: github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0= -github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.3 h1:1HLSx5H+tXR9pW3in3zaztoEwQYRC9SQaYUHjTSUOag= +github.com/jackc/pgproto3/v2 v2.3.3/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= @@ -369,8 +369,8 @@ github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6 github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= github.com/jackc/pgx/v4 v4.10.1/go.mod h1:QlrWebbs3kqEZPHCTGyxecvzG6tvIsYu+A5b1raylkA= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= -github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE= +github.com/jackc/pgx/v4 v4.18.2 h1:xVpYkNR5pk5bMCZGfClbO962UIqVABcAGt7ha1s/FeU= +github.com/jackc/pgx/v4 v4.18.2/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= @@ -378,7 +378,6 @@ github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= @@ -613,10 +612,9 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -679,8 +677,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -745,16 +743,16 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 2e0872f3e8e61eb2f1af90b80749e134ca4b7188 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:19:02 +0000 Subject: [PATCH 18/26] Bump google.golang.org/protobuf from 1.31.0 to 1.33.0 Bumps google.golang.org/protobuf from 1.31.0 to 1.33.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b5678692c..9ee8a5bf0 100644 --- a/go.mod +++ b/go.mod @@ -168,7 +168,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect google.golang.org/grpc v1.59.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/uint128 v1.2.0 // indirect diff --git a/go.sum b/go.sum index f5d80e340..dd12e9003 100644 --- a/go.sum +++ b/go.sum @@ -878,8 +878,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From a78d1abfa81a65e9ac972f242410656812756a03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:43:15 +0000 Subject: [PATCH 19/26] Bump github.com/jackc/pgx/v5 from 5.3.1 to 5.5.4 Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.3.1 to 5.5.4. - [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md) - [Commits](https://github.com/jackc/pgx/compare/v5.3.1...v5.5.4) --- updated-dependencies: - dependency-name: github.com/jackc/pgx/v5 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- go.mod | 4 +++- go.sum | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9da336e7b..191619462 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/jackc/pgconn v1.14.3 github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa github.com/jackc/pgx/v4 v4.18.2 - github.com/jackc/pgx/v5 v5.3.1 + github.com/jackc/pgx/v5 v5.5.4 github.com/ktrysmt/go-bitbucket v0.6.4 github.com/lib/pq v1.10.9 github.com/markbates/pkger v0.15.1 @@ -43,6 +43,8 @@ require ( modernc.org/sqlite v1.18.1 ) +require github.com/jackc/puddle/v2 v2.2.1 // indirect + require ( cloud.google.com/go v0.110.10 // indirect cloud.google.com/go/compute v1.23.3 // indirect diff --git a/go.sum b/go.sum index b4e9658e5..c0ebce34a 100644 --- a/go.sum +++ b/go.sum @@ -371,13 +371,15 @@ github.com/jackc/pgx/v4 v4.10.1/go.mod h1:QlrWebbs3kqEZPHCTGyxecvzG6tvIsYu+A5b1r github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= github.com/jackc/pgx/v4 v4.18.2 h1:xVpYkNR5pk5bMCZGfClbO962UIqVABcAGt7ha1s/FeU= github.com/jackc/pgx/v4 v4.18.2/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= -github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= -github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= +github.com/jackc/pgx/v5 v5.5.4 h1:Xp2aQS8uXButQdnCMWNmvx6UysWQQC+u1EoizjguY+8= +github.com/jackc/pgx/v5 v5.5.4/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= +github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= From f1002267588a5617925665667251bdc24d276e1f Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Tue, 16 Apr 2024 23:03:36 -0700 Subject: [PATCH 20/26] Update dktest from v0.4.0 to v0.4.1 to fix docker vulnerability --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 191619462..0ec2d300b 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/aws/aws-sdk-go v1.49.6 github.com/cenkalti/backoff/v4 v4.1.2 github.com/cockroachdb/cockroach-go/v2 v2.1.1 - github.com/dhui/dktest v0.4.0 - github.com/docker/docker v24.0.7+incompatible + github.com/dhui/dktest v0.4.1 + github.com/docker/docker v24.0.9+incompatible github.com/docker/go-connections v0.4.0 github.com/fsouza/fake-gcs-server v1.17.0 github.com/go-sql-driver/mysql v1.5.0 diff --git a/go.sum b/go.sum index c0ebce34a..841ec693a 100644 --- a/go.sum +++ b/go.sum @@ -155,15 +155,15 @@ github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dhui/dktest v0.4.0 h1:z05UmuXZHO/bgj/ds2bGMBu8FI4WA+Ag/m3ghL+om7M= -github.com/dhui/dktest v0.4.0/go.mod h1:v/Dbz1LgCBOi2Uki2nUqLBGa83hWBGFMu5MrgMDCc78= +github.com/dhui/dktest v0.4.1 h1:/w+IWuDXVymg3IrRJCHHOkMK10m9aNVMOyD0X12YVTg= +github.com/dhui/dktest v0.4.1/go.mod h1:DdOqcUpL7vgyP4GlF3X3w7HbSlz8cEQzwewPveYEQbA= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= -github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v24.0.9+incompatible h1:HPGzNmwfLZWdxHqK9/II92pyi1EpYKsAqcl4G0Of9v0= +github.com/docker/docker v24.0.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= From e428ecebea48a679dadbe5616ae946288e067972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Nowoty=C5=84ski?= Date: Wed, 10 Apr 2024 15:46:03 +0200 Subject: [PATCH 21/26] Make MySQL SetVersion compatible with sql_safe_update --- database/mysql/mysql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/mysql/mysql.go b/database/mysql/mysql.go index e0e18e7a9..c7e7ef617 100644 --- a/database/mysql/mysql.go +++ b/database/mysql/mysql.go @@ -361,7 +361,7 @@ func (m *Mysql) SetVersion(version int, dirty bool) error { return &database.Error{OrigErr: err, Err: "transaction start failed"} } - query := "DELETE FROM `" + m.config.MigrationsTable + "`" + query := "DELETE FROM `" + m.config.MigrationsTable + "` LIMIT 1" if _, err := tx.ExecContext(context.Background(), query); err != nil { if errRollback := tx.Rollback(); errRollback != nil { err = multierror.Append(err, errRollback) From 859d92bd77319005af3431d5e36741fc3d48e54d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:19:09 +0000 Subject: [PATCH 22/26] Bump golang.org/x/net from 0.21.0 to 0.23.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.21.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.21.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 0ec2d300b..8cc85c554 100644 --- a/go.mod +++ b/go.mod @@ -155,13 +155,13 @@ require ( github.com/zeebo/xxh3 v1.0.2 // indirect gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.20.0 // indirect + golang.org/x/crypto v0.21.0 // indirect golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 // indirect golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/go.sum b/go.sum index 841ec693a..918342a16 100644 --- a/go.sum +++ b/go.sum @@ -615,8 +615,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= -golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -679,8 +679,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -745,16 +745,16 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From c81eaf79183b81510a229639709ed08f96603726 Mon Sep 17 00:00:00 2001 From: Galen Abell Date: Fri, 31 May 2024 17:30:06 +0200 Subject: [PATCH 23/26] Upgrade go-sqlite3 to v1.14.22 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8cc85c554..b4074a937 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/ktrysmt/go-bitbucket v0.6.4 github.com/lib/pq v1.10.9 github.com/markbates/pkger v0.15.1 - github.com/mattn/go-sqlite3 v1.14.16 + github.com/mattn/go-sqlite3 v1.14.22 github.com/microsoft/go-mssqldb v1.0.0 github.com/mutecomm/go-sqlcipher/v4 v4.4.0 github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8 diff --git a/go.sum b/go.sum index 918342a16..0c551b794 100644 --- a/go.sum +++ b/go.sum @@ -453,8 +453,8 @@ github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peK github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/microsoft/go-mssqldb v1.0.0 h1:k2p2uuG8T5T/7Hp7/e3vMGTnnR0sU4h8d1CcC71iLHU= github.com/microsoft/go-mssqldb v1.0.0/go.mod h1:+4wZTUnz/SV6nffv+RRRB/ss8jPng5Sho2SmM1l2ts4= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= From cabb2db836aeddfc1f6612931897275685bea7bb Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Wed, 5 Jun 2024 22:42:24 +0900 Subject: [PATCH 24/26] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20impro?= =?UTF-8?q?ve=20error=20message=20for=20invalid=20source,=20database,=20re?= =?UTF-8?q?solves:=20#1102?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- migrate.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/migrate.go b/migrate.go index a57dceb5d..7763782a0 100644 --- a/migrate.go +++ b/migrate.go @@ -89,25 +89,25 @@ func New(sourceURL, databaseURL string) (*Migrate, error) { sourceName, err := iurl.SchemeFromURL(sourceURL) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to parse scheme from source URL: %w", err) } m.sourceName = sourceName databaseName, err := iurl.SchemeFromURL(databaseURL) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to parse scheme from database URL: %w", err) } m.databaseName = databaseName sourceDrv, err := source.Open(sourceURL) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to open source, %q: %w", sourceURL, err) } m.sourceDrv = sourceDrv databaseDrv, err := database.Open(databaseURL) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to open database, %q: %w", databaseURL, err) } m.databaseDrv = databaseDrv @@ -131,7 +131,7 @@ func NewWithDatabaseInstance(sourceURL string, databaseName string, databaseInst sourceDrv, err := source.Open(sourceURL) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to open source, %q: %w", sourceURL, err) } m.sourceDrv = sourceDrv @@ -149,7 +149,7 @@ func NewWithSourceInstance(sourceName string, sourceInstance source.Driver, data databaseName, err := iurl.SchemeFromURL(databaseURL) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to parse scheme from database URL: %w", err) } m.databaseName = databaseName @@ -157,7 +157,7 @@ func NewWithSourceInstance(sourceName string, sourceInstance source.Driver, data databaseDrv, err := database.Open(databaseURL) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to open database, %q: %w", databaseURL, err) } m.databaseDrv = databaseDrv From 1735cb3920798f412593029f5300425ba58253a9 Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Wed, 5 Jun 2024 23:39:14 +0900 Subject: [PATCH 25/26] =?UTF-8?q?=F0=9F=9A=A8=20golangci-lint:=20disable?= =?UTF-8?q?=20interfacer=20linter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 0419e32be..55401a171 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,7 @@ run: linters: enable: #- golint - - interfacer + #- interfacer - unconvert #- dupl - goconst From 34594af0ab71273441671b4d06448e6ea97f60f8 Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Wed, 5 Jun 2024 23:40:12 +0900 Subject: [PATCH 26/26] =?UTF-8?q?=F0=9F=9A=A8=20golangci-lint:=20fix=20for?= =?UTF-8?q?=20errcheck=20lint=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/cli/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cli/main.go b/internal/cli/main.go index f0341bc19..c7a3bd74a 100644 --- a/internal/cli/main.go +++ b/internal/cli/main.go @@ -275,7 +275,7 @@ Database drivers: `+strings.Join(database.List(), ", ")+"\n", createUsage, gotoU if needsConfirm { log.Println("Are you sure you want to apply all down migrations? [y/N]") var response string - fmt.Scanln(&response) + _, _ = fmt.Scanln(&response) response = strings.ToLower(strings.TrimSpace(response)) if response == "y" { @@ -306,7 +306,7 @@ Database drivers: `+strings.Join(database.List(), ", ")+"\n", createUsage, gotoU if !*forceDrop { log.Println("Are you sure you want to drop the entire database schema? [y/N]") var response string - fmt.Scanln(&response) + _, _ = fmt.Scanln(&response) response = strings.ToLower(strings.TrimSpace(response)) if response == "y" {