Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: Go 1.21.0 (#7646)

Danny Xud5d2395ccfa0
diff --git a/README.md b/README.md
index e3c61410f4..9039bac24b 100644
--- a/README.md
+++ b/README.md
@@ -263,7 +263,7 @@ Below diagram describes a typical mapping between an engineering org and the cor
### Prerequisites
-- [Go](https://golang.org/doc/install) (1.20.1 or later)
+- [Go](https://golang.org/doc/install) (1.21.0 or later)
- [pnpm](https://pnpm.io/installation)
- [Air](https://github.com/bytebase/air) (**our forked repo @87187cc with the proper signal handling**). This is for backend live reload.
```bash
diff --git a/go.mod b/go.mod
index d6b9973185..d66a7f35ff 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/bytebase/bytebase
-go 1.20
+go 1.21
require (
cloud.google.com/go/spanner v1.47.0
diff --git a/scripts/.goreleaser-for-darwin.yaml b/scripts/.goreleaser-for-darwin.yaml
index b838a52317..bb6d97e3ac 100644
--- a/scripts/.goreleaser-for-darwin.yaml
+++ b/scripts/.goreleaser-for-darwin.yaml
@@ -17,7 +17,7 @@ builds:
- embed_frontend
env:
- VERSION="development"
- - GO_VERSION="1.20.1"
+ - GO_VERSION="1.21.0"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
@@ -41,7 +41,7 @@ builds:
- release
env:
- VERSION="development"
- - GO_VERSION="1.20.1"
+ - GO_VERSION="1.21.0"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
diff --git a/scripts/.goreleaser-for-linux.yaml b/scripts/.goreleaser-for-linux.yaml
index bcb6828e5b..d880dad73e 100644
--- a/scripts/.goreleaser-for-linux.yaml
+++ b/scripts/.goreleaser-for-linux.yaml
@@ -17,7 +17,7 @@ builds:
- embed_frontend
env:
- VERSION="development"
- - GO_VERSION="1.20.1"
+ - GO_VERSION="1.21.0"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
@@ -46,7 +46,7 @@ builds:
- release
env:
- VERSION="development"
- - GO_VERSION="1.20.1"
+ - GO_VERSION="1.21.0"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
index 6e52aa2128..1b91266967 100644
--- a/scripts/Dockerfile
+++ b/scripts/Dockerfile
@@ -26,11 +26,11 @@ COPY ./backend/enterprise/api/plan.yaml ./src/types/
# Build frontend
RUN pnpm "${RELEASE}-docker"
-FROM golang:1.20.3 as backend
+FROM golang:1.21.0 as backend
ARG VERSION="development"
ARG VERSION_SUFFIX=""
-ARG GO_VERSION="1.20.1"
+ARG GO_VERSION="1.21.0"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
@@ -39,7 +39,7 @@ ARG RELEASE="release"
# Need gcc for CGO_ENABLED=1
RUN if [ "$TARGETARCH" = "arm64" ]; then \
- apt-get update && apt-get install -y gcc-aarch64-linux-gnu; \
+ apt-get install -y gcc-aarch64-linux-gnu; \
else \
apt-get install -y gcc ;\
fi
@@ -65,7 +65,7 @@ fi && \
./backend/bin/server/main.go
# Use debian because mysql requires glibc.
-FROM debian:bullseye-slim as monolithic
+FROM debian:bookworm-slim as monolithic
ARG VERSION="development"
ARG GIT_COMMIT="unknown"
diff --git a/scripts/Dockerfile.bb b/scripts/Dockerfile.bb
index 4f9e63b5dc..30673fabc0 100644
--- a/scripts/Dockerfile.bb
+++ b/scripts/Dockerfile.bb
@@ -5,10 +5,10 @@
# $ docker run --init --rm --name bb bytebase/bb
-FROM golang:1.20.3 as bb
+FROM golang:1.21.0 as bb
ARG VERSION="development"
-ARG GO_VERSION="1.20.1"
+ARG GO_VERSION="1.21.0"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
@@ -25,7 +25,7 @@ RUN GOOS=linux GOARCH=amd64 go build \
./backend/bin/bb/main.go
# Use debian because mysql requires glibc.
-FROM debian:bullseye-slim as monolithic
+FROM debian:bookworm-slim as monolithic
ARG VERSION="development"
ARG GIT_COMMIT="unknown"
diff --git a/scripts/Dockerfile.render-demo b/scripts/Dockerfile.render-demo
index 65a3af4fc9..7ec22239ad 100644
--- a/scripts/Dockerfile.render-demo
+++ b/scripts/Dockerfile.render-demo
@@ -20,9 +20,9 @@ COPY ./backend/enterprise/api/plan.yaml ./src/types/
# Build frontend
RUN pnpm "${RELEASE}-docker"
-FROM golang:1.20.3 as backend
+FROM golang:1.21.0 as backend
-ARG GO_VERSION="1.20.1"
+ARG GO_VERSION="1.21.0"
# RENDER_GIT_COMMIT is a render.com provided env var during build.
# https://render.com/docs/environment-variables
ARG RENDER_GIT_COMMIT="unknown"
@@ -52,7 +52,7 @@ RUN VERSION=`cat ./VERSION` && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
./backend/bin/server/main.go
# Use debian because mysql requires glibc.
-FROM debian:bullseye-slim as monolithic
+FROM debian:bookworm-slim as monolithic
ARG VERSION="development"
ARG RENDER_GIT_COMMIT="unknown"
diff --git a/scripts/Dockerfile.sql-service b/scripts/Dockerfile.sql-service
index 22d981e7f7..7f7b50ec0a 100644
--- a/scripts/Dockerfile.sql-service
+++ b/scripts/Dockerfile.sql-service
@@ -5,10 +5,10 @@
# $ docker run --init --rm --name sql-service --publish 8081:8081 bytebase/sql
-FROM golang:1.20.3 as sql
+FROM golang:1.21.0 as sql
ARG VERSION="development"
-ARG GO_VERSION="1.20.1"
+ARG GO_VERSION="1.21.0"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
@@ -33,7 +33,7 @@ RUN VERSION=`cat ./VERSION` && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
./backend/bin/sql-service/main.go
# Use debian because mysql requires glibc.
-FROM debian:bullseye-slim as monolithic
+FROM debian:bookworm-slim as monolithic
ARG VERSION="development"
ARG GIT_COMMIT="unknown"
diff --git a/scripts/build_bytebase.sh b/scripts/build_bytebase.sh
index 0d1136249b..1c95fc1791 100755
--- a/scripts/build_bytebase.sh
+++ b/scripts/build_bytebase.sh
@@ -14,9 +14,9 @@ OUTPUT_DIR=$(mkdir_output "$1")
OUTPUT_BINARY=$OUTPUT_DIR/bytebase
GO_VERSION=`go version | { read _ _ v _; echo ${v#go}; }`
-if [ "$(version ${GO_VERSION})" -lt "$(version 1.20.1)" ];
+if [ "$(version ${GO_VERSION})" -lt "$(version 1.21.0)" ];
then
- echo "${RED}Precheck failed.${NC} Require go version >= 1.20.1. Current version ${GO_VERSION}."; exit 1;
+ echo "${RED}Precheck failed.${NC} Require go version >= 1.21.0. Current version ${GO_VERSION}."; exit 1;
fi
NODE_VERSION=`node -v | { read v; echo ${v#v}; }`
@@ -31,7 +31,7 @@ then
fi
# Step 1 - Build the frontend release version into the backend/server/dist folder
-# Step 2 - Build the monolithic app by building backend release version together with the backend/server/dist (leveraing embed introduced in Golang 1.20.1).
+# Step 2 - Build the monolithic app by building backend release version together with the backend/server/dist (leveraing embed introduced in Golang 1.21.0).
echo "Start building Bytebase monolithic ${VERSION}..."
echo ""