Skip to content

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

fix: several fix (#5016)

ecmadao0566ed280486
diff --git a/.github/workflows/build-push-ci-image.yml b/.github/workflows/build-push-ci-image.yml
index 52ca8bffd6..53f305508c 100644
--- a/.github/workflows/build-push-ci-image.yml
+++ b/.github/workflows/build-push-ci-image.yml
@@ -13,6 +13,12 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
+ - uses: actions/checkout@v3
+ - name: Extract build args
+ run: |
+ echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
+ echo "BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
+ echo "BUILD_USER=$(id -u -n)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
@@ -31,5 +37,7 @@ jobs:
RELEASE=release
VERSION_SUFFIX=-release-ci
GIT_COMMIT=${{ env.GITHUB_SHA }}
+ BUILD_TIME=${{ env.BUILD_TIME }}
+ BUILD_USER=${{ env.BUILD_USER }}
- name: Image digest
run: echo "Successfully pushed bytebase/bytebase:release-ci " ${{ steps.docker_build.outputs.digest }}
diff --git a/backend/server/auth.go b/backend/server/auth.go
index 41c81c5969..b8f21991db 100644
--- a/backend/server/auth.go
+++ b/backend/server/auth.go
@@ -220,7 +220,7 @@ func trySignUp(ctx context.Context, s *Server, signUp *api.SignUp, creatorID int
return nil, echo.NewHTTPError(http.StatusInternalServerError, "Failed to list users").SetInternal(err)
}
if len(users) != 0 {
- return nil, echo.NewHTTPError(http.StatusBadRequest, "Email %s is already existed", signUp.Email)
+ return nil, echo.NewHTTPError(http.StatusConflict, "Email %s is already existed", signUp.Email)
}
user, err := s.store.CreateUser(ctx, &store.UserMessage{
Email: signUp.Email,
diff --git a/backend/server/principal.go b/backend/server/principal.go
index f112a4c185..2fc8db1180 100644
--- a/backend/server/principal.go
+++ b/backend/server/principal.go
@@ -169,7 +169,7 @@ func (s *Server) registerPrincipalRoutes(g *echo.Group) {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to get principal list").SetInternal(err)
}
if len(users) != 0 {
- return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Email %s is already existed", *principalPatch.Email))
+ return echo.NewHTTPError(http.StatusConflict, fmt.Sprintf("Email %s is already existed", *principalPatch.Email))
}
} else {
principalPatch.Email = nil