diff --git a/.github/sync.yml b/.github/sync.yml
index 03454c165..4e9f9d17e 100644
--- a/.github/sync.yml
+++ b/.github/sync.yml
@@ -94,9 +94,6 @@ group:
- source: .github/workflows/cla.yml
dest: .github/workflows/cla.yml
replace: false
- - source: .github/workflows/
- dest: .github/workflows/
- replace: false
- source: .github/workflows/auto-assign-issue.yml
dest: .github/workflows/auto-assign-issue.yml
replace: false
diff --git a/.github/workflows/check-coverage.yml b/.github/workflows/check-coverage.yml
index 21c383076..cc596a0e0 100644
--- a/.github/workflows/check-coverage.yml
+++ b/.github/workflows/check-coverage.yml
@@ -1,45 +1,45 @@
-# name: Check-Coverage
+name: Check-Coverage
-# on:
-# workflow_dispatch:
-# push:
-# branches: [ "main" ]
-# paths-ignore:
-# - "docs/**"
-# - "**/*.md"
-# - "**/*.yaml"
-# - "CONTRIBUTORS"
-# - "CHANGELOG/**"
-# pull_request:
-# branches: [ "*" ]
-# paths-ignore:
-# - "docs/**"
-# - "**/*.md"
-# - "**/*.yaml"
-# - "CONTRIBUTORS"
-# - "CHANGELOG/**"
-# env:
-# # Common versions
-# GO_VERSION: "1.20"
+on:
+ workflow_dispatch:
+ push:
+ branches: [ "main" ]
+ paths-ignore:
+ - "docs/**"
+ - "**/*.md"
+ - "**/*.yaml"
+ - "CONTRIBUTORS"
+ - "CHANGELOG/**"
+ pull_request:
+ branches: [ "*" ]
+ paths-ignore:
+ - "docs/**"
+ - "**/*.md"
+ - "**/*.yaml"
+ - "CONTRIBUTORS"
+ - "CHANGELOG/**"
+env:
+ # Common versions
+ GO_VERSION: "1.20"
-# jobs:
-# coverage:
-# runs-on: ubuntu-20.04
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v3
+jobs:
+ coverage:
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
-# - name: Setup Golang with cache
-# uses: magnetikonline/action-golang-cache@v3
-# with:
-# go-version: ${{ env.GO_VERSION }}
-# token: ${{ secrets.BOT_GITHUB_TOKEN }}
+ - name: Setup Golang with cache
+ uses: magnetikonline/action-golang-cache@v3
+ with:
+ go-version: ${{ env.GO_VERSION }}
-# - name: Install Dependencies
-# run: sudo apt update && sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
+ - name: Install Dependencies
+ run: sudo apt update && sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
-# - name: Run Cover
-# run: make cover
+ - name: Run Cover
+ run: make cover
+ continue-on-error: true
-# - name: Upload Coverage to Codecov
-# uses: codecov/codecov-action@v3
+ - name: Upload Coverage to Codecov
+ uses: codecov/codecov-action@v3
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml
index 65497a106..5776a47be 100644
--- a/.github/workflows/cla.yml
+++ b/.github/workflows/cla.yml
@@ -41,7 +41,7 @@ jobs:
remote-repository-name: ${{ env.REMOTE_REPOSITORY }}
create-file-commit-message: '📚 Docs: Creating file for storing ${{ github.event.repository.name }} CLA Signatures'
- custom-notsigned-prcomment: '💕 Thank you for your contribution and please kindly read and sign our [🎯https://github.com/openim-sigs/cla/blob/main/README.md](https://github.com/openim-sigs/cla/blob/main/README.md)
'
+ custom-notsigned-prcomment: '💕 Thank you for your contribution and please kindly read and sign our [🎯https://github.com/openim-sigs/cla/blob/main/README.md](https://github.com/openim-sigs/cla/blob/main/README.md).
If you wish to sign the CRA, **please comment on this sentence:**'
custom-pr-sign-comment: 'I have read the CLA Document and I hereby sign the CLA'
custom-allsigned-prcomment: '🤖 All Contributors have signed the [${{ github.event.repository.name }} CLA](https://github.com/openim-sigs/cla/blob/main/README.md).
The signed information is recorded [🤖here](https://github.com/openim-sigs/cla/tree/main/signatures/${{ env.OPEN_IM_SERVER_ALLOWLIST }}/cla.json)'
# lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index 6b9f79d51..a3451d6aa 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -1,2 +1,2 @@
+# name: OpenIM e2e Test
-# name: OpenIM e2e Test
\ No newline at end of file
diff --git a/.github/workflows/openimci.yml b/.github/workflows/openimci.yml
index e0546515e..cd055b5b7 100644
--- a/.github/workflows/openimci.yml
+++ b/.github/workflows/openimci.yml
@@ -90,11 +90,19 @@ jobs:
echo "Run unit test and get test coverage successfully"
continue-on-error: true
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: go
+
- name: Build source code for host platform
run: |
sudo make build
echo "Build source code for host platform successfully"
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
+
- name: OpenIM verify copyright
run: |
sudo make verify-copyright
diff --git a/.golangci.yml b/.golangci.yml
index ef7c1f811..296bd0dc0 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -58,6 +58,7 @@ run:
skip-files:
- ".*\\.my\\.go$"
- _test.go
+ - ".*\\.pb\\.go"
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
diff --git a/internal/api/msg.go b/internal/api/msg.go
index 8ad7943e9..41ab4dc48 100644
--- a/internal/api/msg.go
+++ b/internal/api/msg.go
@@ -250,7 +250,6 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) {
return
}
-
var recvIDs []string
var err error
if req.IsSendAll {
diff --git a/internal/msggateway/hub_server.go b/internal/msggateway/hub_server.go
index deb8c3d77..4e1586969 100644
--- a/internal/msggateway/hub_server.go
+++ b/internal/msggateway/hub_server.go
@@ -16,6 +16,7 @@ package msggateway
import (
"context"
+
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
diff --git a/internal/push/offlinepush/offlinepush_interface.go b/internal/push/offlinepush/offlinepush_interface.go
index 5aa7e089f..a5d4051f9 100644
--- a/internal/push/offlinepush/offlinepush_interface.go
+++ b/internal/push/offlinepush/offlinepush_interface.go
@@ -18,12 +18,12 @@ import (
"context"
)
-// OfflinePusher Offline Pusher
+// OfflinePusher Offline Pusher.
type OfflinePusher interface {
Push(ctx context.Context, userIDs []string, title, content string, opts *Opts) error
}
-// Opts opts
+// Opts opts.
type Opts struct {
Signal *Signal
IOSPushSound string
@@ -31,7 +31,7 @@ type Opts struct {
Ex string
}
-// Signal message id
+// Signal message id.
type Signal struct {
ClientMsgID string
}
diff --git a/internal/rpc/msg/send.go b/internal/rpc/msg/send.go
index dd02083fa..a568154c7 100644
--- a/internal/rpc/msg/send.go
+++ b/internal/rpc/msg/send.go
@@ -16,6 +16,7 @@ package msg
import (
"context"
+
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext"
diff --git a/scripts/build.cmd b/scripts/build.cmd
index f0d5475b4..f3c086a32 100644
--- a/scripts/build.cmd
+++ b/scripts/build.cmd
@@ -1,11 +1,12 @@
-go build -o api.exe ../cmd/openim-api/main.go
-go build -o auth.exe ../cmd/openim-rpc/openim-rpc-auth/main.go
-go build -o conversation.exe ../cmd/openim-rpc/openim-rpc-conversation/main.go
-go build -o friend.exe ../cmd/openim-rpc/openim-rpc-friend/main.go
-go build -o group.exe ../cmd/openim-rpc/openim-rpc-group/main.go
-go build -o msg.exe ../cmd/openim-rpc/openim-rpc-msg/main.go
-go build -o third.exe ../cmd/openim-rpc/openim-rpc-third/main.go
-go build -o user.exe ../cmd/openim-rpc/openim-rpc-user/main.go
-go build -o push.exe ../cmd/openim-push/main.go
-go build -o msgtransfer.exe ../cmd/openim-msgtransfer/main.go
-go build -o msggateway.exe ../cmd/openim-msggateway/main.go
+set output_dir=%~dp0..\_output\bin\platforms\windows
+go build -o %output_dir%\api.exe ../cmd/openim-api/main.go
+go build -o %output_dir%\auth.exe ../cmd/openim-rpc/openim-rpc-auth/main.go
+go build -o %output_dir%\conversation.exe ../cmd/openim-rpc/openim-rpc-conversation/main.go
+go build -o %output_dir%\friend.exe ../cmd/openim-rpc/openim-rpc-friend/main.go
+go build -o %output_dir%\group.exe ../cmd/openim-rpc/openim-rpc-group/main.go
+go build -o %output_dir%\msg.exe ../cmd/openim-rpc/openim-rpc-msg/main.go
+go build -o %output_dir%\third.exe ../cmd/openim-rpc/openim-rpc-third/main.go
+go build -o %output_dir%\user.exe ../cmd/openim-rpc/openim-rpc-user/main.go
+go build -o %output_dir%\push.exe ../cmd/openim-push/main.go
+go build -o %output_dir%\msgtransfer.exe ../cmd/openim-msgtransfer/main.go
+go build -o %output_dir%\msggateway.exe ../cmd/openim-msggateway/main.go
\ No newline at end of file
diff --git a/scripts/start_all.sh b/scripts/start_all.sh
index b49997aa2..6470ae910 100755
--- a/scripts/start_all.sh
+++ b/scripts/start_all.sh
@@ -36,7 +36,7 @@ echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"
-bin_dir="$BIN_DIR"
+bin_dir="$OPENIM_ROOT/_output/bin"
logs_dir="$OPENIM_ROOT/logs"
sdk_db_dir="$OPENIM_ROOT/sdk/db/"