Skip to content

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

chore: rollback go version to 1.21.6 (#10785)

Danny Xub62ef9b22e99
diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml
index a064386d08..95de210830 100644
--- a/.github/workflows/backend-tests.yml
+++ b/.github/workflows/backend-tests.yml
@@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
- go-version: 1.22.0
+ go-version: 1.21.6
cache: false
- name: Verify go.mod is tidy
run: |
diff --git a/.github/workflows/build-artifacts-and-draft-release.yml b/.github/workflows/build-artifacts-and-draft-release.yml
index f1c3b2f4c1..95f4dab7c6 100644
--- a/.github/workflows/build-artifacts-and-draft-release.yml
+++ b/.github/workflows/build-artifacts-and-draft-release.yml
@@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
- go-version: 1.22.0
+ go-version: 1.21.6
- uses: pnpm/[email protected]
with:
version: 8.12.1
@@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
- go-version: 1.22.0
+ go-version: 1.21.6
- name: Make directories
run: |
mkdir -p ./bytebase-build/linux
diff --git a/.github/workflows/test_link.yml b/.github/workflows/test_link.yml
index 7edc9d0f4d..215856ddc7 100644
--- a/.github/workflows/test_link.yml
+++ b/.github/workflows/test_link.yml
@@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
- go-version: 1.22.0
+ go-version: 1.21.6
cache: false
- name: Validate links
run: go test -timeout 600s -v ./scripts/... | tee test.log; exit ${PIPESTATUS[0]}
diff --git a/README.md b/README.md
index 7b130c731b..f141c015e8 100644
--- a/README.md
+++ b/README.md
@@ -256,7 +256,7 @@ Below diagram describes a typical mapping between an engineering org and the cor
### Prerequisites
-- [Go](https://golang.org/doc/install) (1.22.0 or later)
+- [Go](https://golang.org/doc/install) (1.21.6 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 6cdf0eb1da..f4a47f1f99 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/bytebase/bytebase
-go 1.22.0
+go 1.21.6
require (
cloud.google.com/go/spanner v1.57.0
diff --git a/scripts/.air.toml b/scripts/.air.toml
index b49f9adede..fb22da8faf 100644
--- a/scripts/.air.toml
+++ b/scripts/.air.toml
@@ -10,6 +10,7 @@ bin = './.air/bytebase --port 8080 --data . --debug --disable-sample --developme
cmd = """
go build \
-p=8 \
+ -gcflags="all=-N -l" \
--tags "minimal" \
-o ./.air/bytebase ./backend/bin/server/main.go"""
delay = 500
diff --git a/scripts/.goreleaser-for-darwin.yaml b/scripts/.goreleaser-for-darwin.yaml
index 2343469ab3..443c3ef9c9 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.22.0"
+ - GO_VERSION="1.21.6"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
@@ -41,7 +41,7 @@ builds:
- release
env:
- VERSION="development"
- - GO_VERSION="1.22.0"
+ - GO_VERSION="1.21.6"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
diff --git a/scripts/.goreleaser-for-linux.yaml b/scripts/.goreleaser-for-linux.yaml
index 04316af603..28325f63d1 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.22.0"
+ - GO_VERSION="1.21.6"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
@@ -46,7 +46,7 @@ builds:
- release
env:
- VERSION="development"
- - GO_VERSION="1.22.0"
+ - GO_VERSION="1.21.6"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
index 93ea8fadb6..5615dd8ba1 100644
--- a/scripts/Dockerfile
+++ b/scripts/Dockerfile
@@ -18,14 +18,14 @@ COPY . .
RUN pnpm --dir frontend install --frozen-lockfile
RUN pnpm --dir frontend release-docker
-FROM golang:1.22.0 as backend
+FROM golang:1.21.6 as backend
ADD go.mod go.sum /
RUN go mod download
ARG TARGETARCH
ARG VERSION="development"
ARG VERSION_SUFFIX=""
-ARG GO_VERSION="1.22.0"
+ARG GO_VERSION="1.21.6"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
diff --git a/scripts/Dockerfile.aws b/scripts/Dockerfile.aws
index a758a239fa..c42183c2e6 100644
--- a/scripts/Dockerfile.aws
+++ b/scripts/Dockerfile.aws
@@ -19,13 +19,13 @@ COPY . .
RUN pnpm --dir frontend install --frozen-lockfile
RUN pnpm --dir frontend release-aws
-FROM golang:1.22.0 as backend
+FROM golang:1.21.6 as backend
ADD go.mod go.sum /
RUN go mod download
ARG VERSION="development"
ARG VERSION_SUFFIX=""
-ARG GO_VERSION="1.22.0"
+ARG GO_VERSION="1.21.6"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
diff --git a/scripts/Dockerfile.bb b/scripts/Dockerfile.bb
index b30a9099a5..8f2e2ed609 100644
--- a/scripts/Dockerfile.bb
+++ b/scripts/Dockerfile.bb
@@ -5,12 +5,12 @@
# $ docker run --init --rm --name bb bytebase/bb
-FROM golang:1.22.0 as bb
+FROM golang:1.21.6 as bb
ADD go.mod go.sum /
RUN go mod download
ARG VERSION="development"
-ARG GO_VERSION="1.22.0"
+ARG GO_VERSION="1.21.6"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
diff --git a/scripts/Dockerfile.depot b/scripts/Dockerfile.depot
index 7d0b2caffa..78454df7ed 100644
--- a/scripts/Dockerfile.depot
+++ b/scripts/Dockerfile.depot
@@ -1,10 +1,10 @@
-FROM golang:1.22.0 as backend
+FROM golang:1.21.6 as backend
ADD go.mod go.sum /
RUN go mod download
ARG VERSION="development"
ARG VERSION_SUFFIX=""
-ARG GO_VERSION="1.22.0"
+ARG GO_VERSION="1.21.6"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
diff --git a/scripts/Dockerfile.render-demo b/scripts/Dockerfile.render-demo
index 2cbacc8602..8ce059fd3f 100644
--- a/scripts/Dockerfile.render-demo
+++ b/scripts/Dockerfile.render-demo
@@ -12,11 +12,11 @@ COPY . .
RUN cd frontend && pnpm install --frozen-lockfile && pnpm release-docker
-FROM golang:1.22.0 as backend
+FROM golang:1.21.6 as backend
ADD go.mod go.sum /
RUN go mod download
-ARG GO_VERSION="1.22.0"
+ARG GO_VERSION="1.21.6"
# RENDER_GIT_COMMIT is a render.com provided env var during build.
# https://render.com/docs/environment-variables
ARG RENDER_GIT_COMMIT="unknown"
diff --git a/scripts/Dockerfile.sql-service b/scripts/Dockerfile.sql-service
index b399e984db..47712bc0d4 100644
--- a/scripts/Dockerfile.sql-service
+++ b/scripts/Dockerfile.sql-service
@@ -5,12 +5,12 @@
# $ docker run --init --rm --name sql-service --publish 8081:8081 bytebase/sql
-FROM golang:1.22.0 as sql
+FROM golang:1.21.6 as sql
ADD go.mod go.sum /
RUN go mod download
ARG VERSION="development"
-ARG GO_VERSION="1.22.0"
+ARG GO_VERSION="1.21.6"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
diff --git a/scripts/build_bytebase.sh b/scripts/build_bytebase.sh
index 88650477a3..73c6db865f 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.22.0)" ];
+if [ "$(version ${GO_VERSION})" -lt "$(version 1.21.6)" ];
then
- echo "${RED}Precheck failed.${NC} Require go version >= 1.22.0. Current version ${GO_VERSION}."; exit 1;
+ echo "${RED}Precheck failed.${NC} Require go version >= 1.21.6. Current version ${GO_VERSION}."; exit 1;
fi
NODE_VERSION=`node -v | { read v; echo ${v#v}; }`