From 4373d7b332d4db3ad078c060b720d83e3e645032 Mon Sep 17 00:00:00 2001 From: pikachu0310 Date: Fri, 20 Sep 2024 00:43:10 +0900 Subject: [PATCH 1/3] =?UTF-8?q?:bug:=20CI=20=E3=81=A7=20integration-test?= =?UTF-8?q?=20=E3=82=92=E5=AE=9F=E8=A1=8C=E3=81=97=E3=81=AA=E3=81=84=20(?= =?UTF-8?q?=E3=81=BE=E3=81=A0=E7=84=A1=E3=81=84=E3=81=AE=E3=81=A7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e405cc..7ea8651 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,17 +45,17 @@ jobs: go-version-file: ./go.mod - run: make test-unit - test-integration: - name: Integration Test - runs-on: ubuntu-latest - needs: - - build - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: ./go.mod - - run: make test-integration +# test-integration: +# name: Integration Test +# runs-on: ubuntu-latest +# needs: +# - build +# steps: +# - uses: actions/checkout@v4 +# - uses: actions/setup-go@v5 +# with: +# go-version-file: ./go.mod +# - run: make test-integration dependabot-automerge: name: Dependabot Automerge @@ -67,7 +67,7 @@ jobs: - build - lint - test-unit - - test-integration +# - test-integration if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Dependabot metadata From 271f39dbbb7be8b2facbe7f71d432647dd7ea8f8 Mon Sep 17 00:00:00 2001 From: pikachu0310 Date: Fri, 20 Sep 2024 00:43:29 +0900 Subject: [PATCH 2/3] =?UTF-8?q?:bug:=20make=20test=20=E3=81=A7=E3=82=82=20?= =?UTF-8?q?integration=20=E3=82=92=E5=AE=9F=E8=A1=8C=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=20(=E3=81=BE=E3=81=A0=E3=81=AA=E3=81=84=E3=81=AE?= =?UTF-8?q?=E3=81=A7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5a533dd..4efcb3e 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ build: $(GO_FILES) ## Compile the binary go build -o $(APP_NAME) .PHONY: test -test: test-unit test-integration ## Run all the tests +test: test-unit #test-integration ## Run all the tests .PHONY: test-unit test-unit: ## Run the unit tests From bcceafeabc67baf18169ea361378b989d000e72e Mon Sep 17 00:00:00 2001 From: pikachu0310 Date: Fri, 20 Sep 2024 00:43:56 +0900 Subject: [PATCH 3/3] =?UTF-8?q?:bug:=20lint=20=E3=82=92=E9=80=9A=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=20(=E4=BD=BF?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E3=82=B3?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E3=81=97=E3=81=9F=E3=81=A0=E3=81=91?= =?UTF-8?q?(=E5=BE=AE=E5=A6=99))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/bot/bot.go | 49 +++++++++++++++++++++++---------------------- internal/gpt/gpt.go | 24 +++++++++++----------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/internal/bot/bot.go b/internal/bot/bot.go index f368a18..bd032c3 100644 --- a/internal/bot/bot.go +++ b/internal/bot/bot.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "github.com/traPtitech/go-traq" - _ "github.com/traPtitech/go-traq" traqwsbot "github.com/traPtitech/traq-ws-bot" "log" "os" @@ -83,6 +82,7 @@ func IsBotJoined(ChannelID string) (bool, error) { return true, nil } } + return false, nil } @@ -96,26 +96,27 @@ func GetBots() []traq.Bot { return Bots } -func botToUser(bot traq.Bot) traq.User { - user := traq.User{ - Id: bot.Id, - Name: bot.BotUserId, - DisplayName: "", - IconFileId: "", - Bot: true, - State: botStateToUserState(bot.State), - UpdatedAt: bot.UpdatedAt, - } - - return user -} - -func botStateToUserState(botState traq.BotState) traq.UserAccountState { - switch botState { - case traq.BOTSTATE_deactivated: - return traq.USERACCOUNTSTATE_deactivated - case traq.BOTSTATE_active: - return traq.USERACCOUNTSTATE_active - } - return traq.USERACCOUNTSTATE_suspended -} +//func botToUser(bot traq.Bot) traq.User { +// user := traq.User{ +// Id: bot.Id, +// Name: bot.BotUserId, +// DisplayName: "", +// IconFileId: "", +// Bot: true, +// State: botStateToUserState(bot.State), +// UpdatedAt: bot.UpdatedAt, +// } +// +// return user +//} +// +//func botStateToUserState(botState traq.BotState) traq.UserAccountState { +// switch botState { +// case traq.BOTSTATE_deactivated: +// return traq.USERACCOUNTSTATE_deactivated +// case traq.BOTSTATE_active: +// return traq.USERACCOUNTSTATE_active +// } +// +// return traq.USERACCOUNTSTATE_suspended +//} diff --git a/internal/gpt/gpt.go b/internal/gpt/gpt.go index 5a9a8ad..915934b 100644 --- a/internal/gpt/gpt.go +++ b/internal/gpt/gpt.go @@ -271,18 +271,18 @@ func addSystemMessageIfNotExist(channelID, message string) { } } -func updateSystemRoleMessage(channelID, message string) { - addSystemMessageIfNotExist(channelID, message) - ChannelMessages[channelID][0] = Message{ - Role: "system", - Content: message, - } - - index := 0 - if err := repository.SaveMessage(channelID, index, ChannelMessages[channelID][0]); err != nil { - fmt.Println(err) - } -} +//func updateSystemRoleMessage(channelID, message string) { +// addSystemMessageIfNotExist(channelID, message) +// ChannelMessages[channelID][0] = Message{ +// Role: "system", +// Content: message, +// } +// +// index := 0 +// if err := repository.SaveMessage(channelID, index, ChannelMessages[channelID][0]); err != nil { +// fmt.Println(err) +// } +//} //func ChatDebug(channelID string) { // returnString := "```\n"