Skip to content

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

chore: go 1.22.3 (#12034)

Danny Xu9162641d4535
diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml
index bc370f4534..825b202951 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.21.6
+ go-version: 1.22.3
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 d35360e62f..fe0b502cd2 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.21.6
+ go-version: 1.22.3
- uses: pnpm/[email protected]
with:
version: 9
@@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
- go-version: 1.21.6
+ go-version: 1.22.3
- name: Make directories
run: |
mkdir -p ./bytebase-build/linux
diff --git a/.github/workflows/test_link.yml b/.github/workflows/test_link.yml
index 215856ddc7..1be58187d4 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.21.6
+ go-version: 1.22.3
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 648f058bfe..34cf0ebc91 100644
--- a/README.md
+++ b/README.md
@@ -257,7 +257,7 @@ Below diagram describes a typical mapping between an engineering org and the cor
### Prerequisites
-- [Go](https://golang.org/doc/install) (1.21.6 or later)
+- [Go](https://golang.org/doc/install) (1.22.3 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 c05840a183..f3a5379f04 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/bytebase/bytebase
-go 1.21.6
+go 1.22.3
require (
cloud.google.com/go/cloudsqlconn v1.9.0
diff --git a/scripts/.air.toml b/scripts/.air.toml
index 3cd63ff260..404320a64e 100644
--- a/scripts/.air.toml
+++ b/scripts/.air.toml
@@ -8,9 +8,10 @@ bin = './.air/bytebase --port 8080 --data . --debug --disable-sample'
## Use -gcflags="all=-N -l" to disable inlining and optimization
cmd = """
+ CGO_ENABLED=1 \
go build \
-p=8 \
- -ldflags="-X 'github.com/bytebase/bytebase/backend/bin/server/cmd.gitcommit=$(git rev-parse HEAD)'" \
+ -ldflags="-debugtextsize=1073741824 -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.gitcommit=$(git rev-parse HEAD)'" \
--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 93e712cb40..1185d943d5 100644
--- a/scripts/.goreleaser-for-darwin.yaml
+++ b/scripts/.goreleaser-for-darwin.yaml
@@ -14,7 +14,7 @@ builds:
- embed_frontend
env:
- VERSION="development"
- - GO_VERSION="1.21.6"
+ - GO_VERSION="1.22.3"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
diff --git a/scripts/.goreleaser-for-linux.yaml b/scripts/.goreleaser-for-linux.yaml
index 884b489078..385d82c139 100644
--- a/scripts/.goreleaser-for-linux.yaml
+++ b/scripts/.goreleaser-for-linux.yaml
@@ -14,7 +14,7 @@ builds:
- embed_frontend
env:
- VERSION="development"
- - GO_VERSION="1.21.6"
+ - GO_VERSION="1.22.3"
- CGO_ENABLED=1
- GIT_COMMIT="unknown"
- BUILD_TIME="unknown"
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
index 8622dfc7c4..199294e295 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.21.6 as backend
+FROM golang:1.22.3 as backend
ADD go.mod go.sum /
RUN go mod download
ARG TARGETARCH
ARG VERSION="development"
ARG VERSION_SUFFIX=""
-ARG GO_VERSION="1.21.6"
+ARG GO_VERSION="1.22.3"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
diff --git a/scripts/Dockerfile.aws b/scripts/Dockerfile.aws
index 3df0551017..e28ddd2721 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.21.6 as backend
+FROM golang:1.22.3 as backend
ADD go.mod go.sum /
RUN go mod download
ARG VERSION="development"
ARG VERSION_SUFFIX=""
-ARG GO_VERSION="1.21.6"
+ARG GO_VERSION="1.22.3"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
diff --git a/scripts/Dockerfile.depot b/scripts/Dockerfile.depot
index 9bd2bf9c3b..0da639409e 100644
--- a/scripts/Dockerfile.depot
+++ b/scripts/Dockerfile.depot
@@ -1,10 +1,10 @@
-FROM golang:1.21.6 as backend
+FROM golang:1.22.3 as backend
ADD go.mod go.sum /
RUN go mod download
ARG VERSION="development"
ARG VERSION_SUFFIX=""
-ARG GO_VERSION="1.21.6"
+ARG GO_VERSION="1.22.3"
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 0c6e28b9d0..956b810e9b 100644
--- a/scripts/Dockerfile.render-demo
+++ b/scripts/Dockerfile.render-demo
@@ -16,11 +16,11 @@ COPY . .
ENV BB_GIT_COMMIT_ID_FE="${RENDER_GIT_COMMIT}"
RUN cd frontend && pnpm install --frozen-lockfile && pnpm release-docker
-FROM golang:1.21.6 as backend
+FROM golang:1.22.3 as backend
ADD go.mod go.sum /
RUN go mod download
-ARG GO_VERSION="1.21.6"
+ARG GO_VERSION="1.22.3"
# 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/build_bytebase.sh b/scripts/build_bytebase.sh
index fd388c5f08..03baf5c09a 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.21.6)" ];
+if [ "$(version ${GO_VERSION})" -lt "$(version 1.22.3)" ];
then
- echo "${RED}Precheck failed.${NC} Require go version >= 1.21.6. Current version ${GO_VERSION}."; exit 1;
+ echo "${RED}Precheck failed.${NC} Require go version >= 1.22.3. Current version ${GO_VERSION}."; exit 1;
fi
NODE_VERSION=`node -v | { read v; echo ${v#v}; }`
@@ -58,8 +58,7 @@ flags="-X 'github.com/bytebase/bytebase/backend/bin/server/cmd.version=${VERSION
-X 'github.com/bytebase/bytebase/backend/bin/server/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
-X 'github.com/bytebase/bytebase/backend/bin/server/cmd.builduser=$(id -u -n)'"
-# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
-go build -p=8 --tags "release,embed_frontend" -ldflags "-w -s $flags" -o ${OUTPUT_BINARY} ./backend/bin/server/main.go
+CGO_ENABLED=1 go build -p=8 --tags "release,embed_frontend" -ldflags "-w -s $flags" -o ${OUTPUT_BINARY} ./backend/bin/server/main.go
echo "Completed building Bytebase backend."