Skip to content

Commit

Permalink
feat: upgrade to jackc/pgx/v5 (#3798)
Browse files Browse the repository at this point in the history
  • Loading branch information
alnr authored Aug 29, 2024
1 parent e2f7049 commit cd7e7ef
Show file tree
Hide file tree
Showing 18 changed files with 90 additions and 200 deletions.
7 changes: 4 additions & 3 deletions .docker/Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.20.0
FROM alpine:3.20

RUN addgroup -S ory; \
adduser -S ory -G ory -D -H -s /bin/nologin
RUN apk --no-cache --upgrade add ca-certificates
adduser -S ory -G ory -D -H -s /bin/nologin && \
apk upgrade --no-cache && \
apk add --no-cache --upgrade ca-certificates

COPY hydra /usr/bin/hydra

Expand Down
5 changes: 3 additions & 2 deletions .docker/Dockerfile-scratch
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM alpine:3.20.0
FROM alpine:3.20

RUN apk --no-cache --upgrade --latest add ca-certificates
RUN apk upgrade --no-cache && \
apk add --no-cache --upgrade ca-certificates

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
Expand Down
5 changes: 3 additions & 2 deletions .docker/Dockerfile-sqlite
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.20.0
FROM alpine:3.20

# Because this image is built for SQLite, we create /home/ory and /home/ory/sqlite which is owned by the ory user
# and declare /home/ory/sqlite a volume.
Expand All @@ -10,7 +10,8 @@ FROM alpine:3.20.0
RUN addgroup -S ory; \
adduser -S ory -G ory -D -h /home/ory -s /bin/nologin; \
chown -R ory:ory /home/ory && \
apk --no-cache --upgrade --latest add ca-certificates sqlite
apk upgrade --no-cache && \
apk add --no-cache --upgrade --latest ca-certificates sqlite

WORKDIR /home/ory

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
- sdk-generate
services:
postgres:
image: postgres:11.8
image: postgres:16
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: test
POSTGRES_USER: test
ports:
- 5432:5432
mysql:
image: mysql:8.0.26
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: test
ports:
Expand All @@ -69,7 +69,7 @@ jobs:
steps:
- run: |
docker create --name cockroach -p 26257:26257 \
cockroachdb/cockroach:v24.1.0 start-single-node --insecure
cockroachdb/cockroach:latest-v24.1 start-single-node --insecure
docker start cockroach
name: Start CockroachDB
- uses: ory/ci/checkout@master
Expand Down Expand Up @@ -150,15 +150,15 @@ jobs:
args: ["", "--jwt"]
services:
postgres:
image: postgres:11.8
image: postgres:16
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: test
POSTGRES_USER: test
ports:
- 5432:5432
mysql:
image: mysql:8.0.26
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: test
ports:
Expand All @@ -170,7 +170,7 @@ jobs:
steps:
- run: |
docker create --name cockroach -p 26257:26257 \
cockroachdb/cockroach:v24.1.0 start-single-node --insecure
cockroachdb/cockroach:latest-v24.1 start-single-node --insecure
docker start cockroach
name: Start CockroachDB
- uses: ory/ci/checkout@master
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ test-resetdb: node_modules
docker rm --force --volumes hydra_test_database_mysql || true
docker rm --force --volumes hydra_test_database_postgres || true
docker rm --force --volumes hydra_test_database_cockroach || true
docker run --rm --name hydra_test_database_mysql --platform linux/amd64 -p 3444:3306 -e MYSQL_ROOT_PASSWORD=secret -d mysql:8.0.26
docker run --rm --name hydra_test_database_postgres --platform linux/amd64 -p 3445:5432 -e POSTGRES_PASSWORD=secret -e POSTGRES_DB=postgres -d postgres:11.8
docker run --rm --name hydra_test_database_cockroach --platform linux/amd64 -p 3446:26257 -d cockroachdb/cockroach:v22.1.10 start-single-node --insecure
docker run --rm --name hydra_test_database_mysql -p 3444:3306 -e MYSQL_ROOT_PASSWORD=secret -d mysql:8.0
docker run --rm --name hydra_test_database_postgres -p 3445:5432 -e POSTGRES_PASSWORD=secret -e POSTGRES_DB=postgres -d postgres:16
docker run --rm --name hydra_test_database_cockroach -p 3446:26257 -d cockroachdb/cockroach:latest-v24.1 start-single-node --insecure

# Build local docker images
.PHONY: docker
Expand Down
2 changes: 1 addition & 1 deletion driver/registry_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
prometheus "github.com/ory/x/prometheusx"

"github.com/gobuffalo/pop/v6"
_ "github.com/jackc/pgx/v4/stdlib"
_ "github.com/jackc/pgx/v5/stdlib"
"github.com/luna-duclos/instrumentedsql"

"go.opentelemetry.io/otel/trace"
Expand Down
16 changes: 9 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ toolchain go1.22.5

replace github.com/ory/hydra-client-go/v2 => ./internal/httpclient

replace github.com/gobuffalo/pop/v6 => github.com/ory/pop/v6 v6.2.0

require (
github.com/ThalesIgnite/crypto11 v1.2.5
github.com/bradleyjkemp/cupaloy/v2 v2.8.0
Expand All @@ -23,7 +25,7 @@ require (
github.com/gorilla/securecookie v1.1.2
github.com/gorilla/sessions v1.3.0
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/jackc/pgx/v4 v4.18.3
github.com/jackc/pgx/v5 v5.6.0
github.com/julienschmidt/httprouter v1.3.0
github.com/luna-duclos/instrumentedsql v1.1.3
github.com/miekg/pkcs11 v1.1.1
Expand Down Expand Up @@ -129,7 +131,7 @@ require (
github.com/gobuffalo/github_flavored_markdown v1.1.4 // indirect
github.com/gobuffalo/helpers v0.6.7 // indirect
github.com/gobuffalo/nulls v0.4.2 // indirect
github.com/gobuffalo/plush/v4 v4.1.19 // indirect
github.com/gobuffalo/plush/v4 v4.1.21 // indirect
github.com/gobuffalo/tags/v3 v3.1.4 // indirect
github.com/gobuffalo/validate/v3 v3.3.3 // indirect
github.com/goccy/go-json v0.10.3 // indirect
Expand All @@ -140,7 +142,7 @@ require (
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/pprof v0.0.0-20230808223545-4887780b67fb // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
Expand All @@ -155,12 +157,12 @@ require (
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // 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/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jandelgado/gcov2lcov v1.0.5 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jmoiron/sqlx v1.3.5 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
Expand All @@ -177,7 +179,7 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-sqlite3 v1.14.16 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/mattn/goveralls v0.0.12 // indirect
github.com/microcosm-cc/bluemonday v1.0.26 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand Down
Loading

0 comments on commit cd7e7ef

Please sign in to comment.