Skip to content

Commit

Permalink
[chore] Bump tooling versions, bump go -> v1.23.0 (#3258)
Browse files Browse the repository at this point in the history
* [chore] Bump tooling versions, bump go -> v1.23.0

* undo silly change

* sign

* bump go version in go.mod

* allow overflow in imaging

* goreleaser deprecation notices

* bump versions

* undo accidental rebase change

* update container versions to just use latest major version

* update swagger to our release with go1.23 fix

* update goreleaser to use our vendored swagger version

---------

Co-authored-by: kim <grufwub@gmail.com>
  • Loading branch information
tsmethurst and NyaaaWhatsUpDoc authored Nov 25, 2024
1 parent da4db81 commit c454b1b
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 23 deletions.
12 changes: 6 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ steps:
# We use golangci-lint for linting.
# See: https://golangci-lint.run/
- name: lint
image: golangci/golangci-lint:v1.57.2
image: golangci/golangci-lint:v1.62.0
volumes:
- name: go-build-cache
path: /root/.cache/go-build
Expand All @@ -28,7 +28,7 @@ steps:
- pull_request

- name: test
image: golang:1.22-alpine
image: golang:1.23-alpine
volumes:
- name: go-build-cache
path: /root/.cache/go-build
Expand Down Expand Up @@ -94,7 +94,7 @@ steps:
- pull_request

- name: snapshot
image: superseriousbusiness/gotosocial-drone-build:0.6.2 # https://github.com/superseriousbusiness/gotosocial-drone-build
image: superseriousbusiness/gotosocial-drone-build:0.7.0 # https://github.com/superseriousbusiness/gotosocial-drone-build
volumes:
- name: go-build-cache
path: /root/.cache/go-build
Expand Down Expand Up @@ -141,7 +141,7 @@ steps:
- main

- name: release
image: superseriousbusiness/gotosocial-drone-build:0.6.2 # https://github.com/superseriousbusiness/gotosocial-drone-build
image: superseriousbusiness/gotosocial-drone-build:0.7.0 # https://github.com/superseriousbusiness/gotosocial-drone-build
volumes:
- name: go-build-cache
path: /root/.cache/go-build
Expand Down Expand Up @@ -210,7 +210,7 @@ clone:

steps:
- name: mirror
image: superseriousbusiness/gotosocial-drone-build:0.6.2
image: superseriousbusiness/gotosocial-drone-build:0.7.0
environment:
ORIGIN_REPO: https://github.com/superseriousbusiness/gotosocial
TARGET_REPO: https://codeberg.org/superseriousbusiness/gotosocial
Expand All @@ -223,6 +223,6 @@ steps:

---
kind: signature
hmac: 1b89e3a538fbca72eb9a0b398cd82f09a774ba3649013e19d36012eda327e83f
hmac: 9810bf692fb1029c13b0a1e2f556e2306d16f7d3eec9ca6163a0499c147280c1

...
5 changes: 3 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# https://goreleaser.com
# Version 2 of GoReleaser: https://goreleaser.com/errors/version/
version: 2
project_name: gotosocial
version: 2

# https://goreleaser.com/customization/hooks/
before:
hooks:
# generate the swagger.yaml file using go-swagger and bundle it into the assets directory
- swagger generate spec --scan-models --exclude-deps -o web/assets/swagger.yaml
- go run ./vendor/github.com/go-swagger/go-swagger/cmd/swagger generate spec --scan-models --exclude-deps -o web/assets/swagger.yaml
- sed -i "s/REPLACE_ME/{{ incpatch .Version }}/" web/assets/swagger.yaml
# Install web deps + bundle web assets
- yarn --cwd ./web/source install
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Dockerfile reference: https://docs.docker.com/engine/reference/builder/

# stage 1: generate up-to-date swagger.yaml to put in the final container
FROM --platform=${BUILDPLATFORM} golang:1.22-alpine AS swagger
FROM --platform=${BUILDPLATFORM} golang:1.23-alpine AS swagger

RUN \
### Installs goswagger for building swagger definitions inside this container
Expand All @@ -28,7 +28,7 @@ RUN yarn --cwd ./web/source install && \
rm -rf ./web/source

# stage 3: build the executor container
FROM --platform=${TARGETPLATFORM} alpine:3.19.1 as executor
FROM --platform=${TARGETPLATFORM} alpine:3.20 as executor

# switch to non-root user:group for GtS
USER 1000:1000
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module github.com/superseriousbusiness/gotosocial

go 1.22.2
go 1.23

// Replace go-swagger with our version that fixes (ours particularly) use of Go1.23
replace github.com/go-swagger/go-swagger => github.com/superseriousbusiness/go-swagger v0.31.0-gts-go1.23-fix

// Replace modernc/sqlite with our version that fixes the concurrency INTERRUPT issue
replace modernc.org/sqlite => gitlab.com/NyaaaWhatsUpDoc/sqlite v1.33.1-concurrency-workaround
Expand Down
6 changes: 2 additions & 4 deletions go.sum

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

11 changes: 5 additions & 6 deletions internal/db/bundb/bundb.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,12 @@ func maxOpenConns() int {
// deriveBunDBPGOptions takes an application config and returns either a ready-to-use set of options
// with sensible defaults, or an error if it's not satisfied by the provided config.
func deriveBunDBPGOptions() (*pgx.ConnConfig, error) {
url := config.GetDbPostgresConnectionString()

// if database URL is defined, ignore other DB related configuration fields
if url != "" {
cfg, err := pgx.ParseConfig(url)
return cfg, err
// If database URL is defined, ignore
// other DB-related configuration fields.
if url := config.GetDbPostgresConnectionString(); url != "" {
return pgx.ParseConfig(url)
}

// these are all optional, the db adapter figures out defaults
address := config.GetDbAddress()

Expand Down
2 changes: 1 addition & 1 deletion test/swagger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -eu

swagger_cmd() {
go run github.com/go-swagger/go-swagger/cmd/swagger "$@"
go run ./vendor/github.com/go-swagger/go-swagger/cmd/swagger "$@"
}
swagger_spec='docs/api/swagger.yaml'

Expand Down
2 changes: 2 additions & 0 deletions vendor/github.com/go-swagger/go-swagger/codescan/schema.go

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

3 changes: 2 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ github.com/go-playground/universal-translator
# github.com/go-playground/validator/v10 v10.20.0
## explicit; go 1.18
github.com/go-playground/validator/v10
# github.com/go-swagger/go-swagger v0.31.0
# github.com/go-swagger/go-swagger v0.31.0 => github.com/superseriousbusiness/go-swagger v0.31.0-gts-go1.23-fix
## explicit; go 1.21
github.com/go-swagger/go-swagger/cmd/swagger
github.com/go-swagger/go-swagger/cmd/swagger/commands
Expand Down Expand Up @@ -1344,6 +1344,7 @@ modernc.org/token
# mvdan.cc/xurls/v2 v2.5.0
## explicit; go 1.19
mvdan.cc/xurls/v2
# github.com/go-swagger/go-swagger => github.com/superseriousbusiness/go-swagger v0.31.0-gts-go1.23-fix
# modernc.org/sqlite => gitlab.com/NyaaaWhatsUpDoc/sqlite v1.33.1-concurrency-workaround
# go.opentelemetry.io/otel => go.opentelemetry.io/otel v1.29.0
# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc => go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0
Expand Down

0 comments on commit c454b1b

Please sign in to comment.