Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): upgrade pgx to v5 #6916

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -6,6 +6,7 @@ TESTFLAGS=-race -p 4
BASE_DIR=$(CURDIR)
BENCHTIME ?= 1x
BENCHTIMEOUT ?= 20m
BENCHCOUNT ?= 1

ifeq (,$(findstring podman,$(shell docker --version 2>/dev/null)))
# Podman DTRT by running processes unprivileged in containers,
Expand Down Expand Up @@ -506,7 +507,7 @@ go-postgres-unit-tests: build-prep test-prep
go-postgres-bench-tests: build-prep test-prep
@# The -p 1 passed to go test is required to ensure that tests of different packages are not run in parallel, so as to avoid conflicts when interacting with the DB.
set -o pipefail ; \
CGO_ENABLED=1 GODEBUG=cgocheck=2 MUTEX_WATCHDOG_TIMEOUT_SECS=30 ROX_POSTGRES_DATASTORE=true GOTAGS=$(GOTAGS),test,sql_integration scripts/go-test.sh -p 1 -run=nonthing -bench=. -benchtime=$(BENCHTIME) -benchmem -timeout $(BENCHTIMEOUT) -v \
CGO_ENABLED=1 GODEBUG=cgocheck=2 MUTEX_WATCHDOG_TIMEOUT_SECS=30 ROX_POSTGRES_DATASTORE=true GOTAGS=$(GOTAGS),test,sql_integration scripts/go-test.sh -p 1 -run=nonthing -bench=. -benchtime=$(BENCHTIME) -benchmem -timeout $(BENCHTIMEOUT) -count $(BENCHCOUNT) -v \
$(shell git grep -rl "testing.B" central pkg migrator tools | sed -e 's@^@./@g' | xargs -n 1 dirname | sort | uniq | xargs go list -tags sql_integration | grep -v '^github.com/stackrox/rox/tests$$' | grep -Ev $(UNIT_TEST_IGNORE)) \
| tee $(GO_TEST_OUTPUT_PATH)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/administration/usage/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/alert/datastore/internal/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/auth/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/blob/datastore/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/blob/datastore/store/store.go
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"io"

"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v5"
"github.com/pkg/errors"
"github.com/stackrox/rox/central/blob/datastore/store/postgres"
v1 "github.com/stackrox/rox/generated/api/v1"
Expand Down
2 changes: 1 addition & 1 deletion central/cluster/store/cluster/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/cluster/store/clusterhealth/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/clusterinit/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/complianceoperator/rules/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/complianceoperator/scans/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/cve/cluster/datastore/store/postgres/full_store.go
Expand Up @@ -6,7 +6,7 @@ import (
"time"

protoTypes "github.com/gogo/protobuf/types"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v5"
"github.com/stackrox/rox/central/cve/cluster/datastore/store"
"github.com/stackrox/rox/central/cve/converter/v2"
"github.com/stackrox/rox/central/metrics"
Expand Down
2 changes: 1 addition & 1 deletion central/cve/cluster/datastore/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/cve/image/datastore/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/cve/node/datastore/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions central/debug/service/service_test.go
Expand Up @@ -9,7 +9,6 @@ import (
"testing"
"time"

"github.com/driftprogramming/pgxpoolmock"
"github.com/pkg/errors"
configMocks "github.com/stackrox/rox/central/config/datastore/mocks"
"github.com/stackrox/rox/central/globaldb"
Expand All @@ -19,6 +18,7 @@ import (
"github.com/stackrox/rox/generated/storage"
permissionsMocks "github.com/stackrox/rox/pkg/auth/permissions/mocks"
"github.com/stackrox/rox/pkg/httputil/mock"
pkgmocks "github.com/stackrox/rox/pkg/mocks/github.com/jackc/pgx/v5/mocks"
"github.com/stackrox/rox/pkg/postgres/mocks"
"github.com/stackrox/rox/pkg/sac"
"github.com/stackrox/rox/pkg/version/testutils"
Expand Down Expand Up @@ -188,9 +188,7 @@ func (s *debugServiceTestSuite) TestGetBundle() {
w := mock.NewResponseWriter()
testutils.SetVersion(s.T(), testutils.GetExampleVersion(s.T()))
db := mocks.NewMockDB(s.mockCtrl)
pgxRows := pgxpoolmock.NewRows([]string{"server_version"}).AddRow("15.1").ToPgxRows()
// Workaround for https://github.com/driftprogramming/pgxpoolmock/issues/8
pgxRows.Next()
pgxRows := pkgmocks.NewRows([]string{"server_version"}).AddRow("15.1").ToPgxRows()
db.EXPECT().QueryRow(gomock.Any(), "SHOW server_version;").Return(pgxRows)
globaldb.SetPostgresTest(s.T(), db)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions central/deployment/datastore/search_comparison_test.go
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"go.uber.org/mock/gomock"
)

var (
Expand All @@ -33,7 +32,6 @@ func TestSearchComparison(t *testing.T) {
type SearchComparisonTestSuite struct {
suite.Suite

mockCtrl *gomock.Controller
testDB *pgtest.TestPostgres
imageDatastore imageDataStore.DataStore
deploymentDatastore DataStore
Expand Down
2 changes: 1 addition & 1 deletion central/deployment/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/externalbackups/internal/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/group/datastore/internal/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.