Skip to content

Conversation

@c121914yu
Copy link
Collaborator

No description provided.

YYH211 and others added 12 commits December 5, 2025 15:24
* add query optimize and bill

* perf: query extension

* fix: embe model

* remove log

* remove log

* fix: test

---------

Co-authored-by: xxyyh <2289112474@qq>
Co-authored-by: archer <545436317@qq.com>
* feat: record user's language

* feat: notice points/dataset indexes; support count limit; update docker-compose.yml

* fix: ts error

* feat: send auth code i18n

* chore: dataset notice limit

* chore: adjust

* fix: ts

* fix: countLimit race condition; i18n en-prefix locale fallback to en

---------

Co-authored-by: archer <545436317@qq.com>
* feat: add ip region for chat logs

* refactor: use Geolite2.mmdb

* fix: export chat logs

* fix: return location directly

* test: add unit test
* plan frontend

* plan limit

* coupon

* discount coupon

* fix

* type

* fix audit

* type

* plan name

* legacy plan

* track

* feat: add discount coupon

* fix

* fix discount coupon

* openapi

* type

* type

* env

* api type

* fix
* fix: replace gridfs multer operations with s3 compatible ops

* wip: s3 features

* refactor: remove gridfs

* fix
Copilot AI review requested due to automatic review settings December 5, 2025 07:26
@gru-agent
Copy link
Contributor

gru-agent bot commented Dec 5, 2025

There is too much information in the pull request to test.

@cla-assistant
Copy link

cla-assistant bot commented Dec 5, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
4 out of 5 committers have signed the CLA.

✅ newfish-cmyk
✅ c121914yu
✅ FinleyGe
✅ xqvvu
❌ YYH211
You have signed the CLA already but the status is still pending? Let us recheck it.

@cla-assistant
Copy link

cla-assistant bot commented Dec 5, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
4 out of 5 committers have signed the CLA.

✅ c121914yu
✅ FinleyGe
✅ xqvvu
✅ newfish-cmyk
❌ YYH211
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot finished reviewing on behalf of c121914yu December 5, 2025 07:28
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Preview mcp_server Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_mcp_server_b4adc63d5e2dbb696613846dea44d829823ca39c

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Preview sandbox Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_sandbox_b4adc63d5e2dbb696613846dea44d829823ca39c

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 24.69% 16644 / 67399
🔵 Statements 24.69% 16644 / 67399
🔵 Functions 35.56% 500 / 1406
🔵 Branches 69.96% 1619 / 2314
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/global/common/error/code/team.ts 100% 100% 100% 100%
packages/global/common/file/constants.ts 100% 100% 100% 100%
packages/global/common/middle/tracks/constants.ts 100% 100% 100% 100%
packages/global/common/string/tools.ts 62.58% 58.62% 46.66% 62.58% 6-9, 49-50, 73-74, 80-81, 102-103, 111-116, 137-142, 177-185, 197-203, 206-232
packages/global/core/app/logs/constants.ts 100% 100% 100% 100%
packages/global/core/chat/utils.ts 7% 100% 0% 7% 16-23, 27-34, 38-84, 88-132, 136-166, 169-181, 184-187, 190-206, 214-253
packages/global/openapi/index.ts 0% 0% 0% 0% 1-44
packages/global/openapi/tag.ts 0% 0% 0% 0% 1-12
packages/global/openapi/support/wallet/index.ts 0% 100% 100% 0% 2-8
packages/global/openapi/support/wallet/bill/api.ts 0% 0% 0% 0% 1-95
packages/global/openapi/support/wallet/bill/index.ts 0% 0% 0% 0% 1-164
packages/global/openapi/support/wallet/discountCoupon/api.ts 0% 0% 0% 0% 1-31
packages/global/openapi/support/wallet/discountCoupon/index.ts 0% 100% 100% 0% 2-23
packages/global/support/user/inform/constants.ts 0% 0% 0% 0% 1-37
packages/global/support/wallet/bill/type.ts 0% 0% 0% 0% 1-40
packages/global/support/wallet/sub/constants.ts 100% 100% 100% 100%
packages/global/support/wallet/sub/discountCoupon/constants.ts 0% 0% 0% 0% 1-33
packages/service/common/file/multer.ts 0% 0% 0% 0% 1-138
packages/service/common/file/gridfs/controller.ts 0% 0% 0% 0% 1-30
packages/service/common/file/gridfs/utils.ts 0% 0% 0% 0% 1-38
packages/service/common/file/image/controller.ts 21.76% 20% 20% 21.76% 20-63, 80-93, 101-126, 132-183
packages/service/common/geo/constants.ts 100% 100% 100% 100%
packages/service/common/geo/index.ts 74.72% 88.23% 42.85% 74.72% 78-80, 83-87, 90-99, 102-107
packages/service/common/geo/type.ts 0% 0% 0% 0%
packages/service/common/geo/utils.ts 100% 100% 100% 100%
packages/service/common/middle/tracks/processor.ts 0% 0% 0% 0% 1-117
packages/service/common/middle/tracks/utils.ts 12.31% 100% 0% 12.31% 13-28, 32-63, 67-77, 79-94, 96-106, 108-112, 114-128, 130-136, 138-149, 151-159
packages/service/common/mongo/init.ts 4.83% 100% 0% 4.83% 10-82
packages/service/common/s3/constants.ts 88.88% 0% 0% 88.88% 40, 42, 52-54
packages/service/common/s3/type.ts 100% 100% 100% 100%
packages/service/common/s3/utils.ts 17.96% 100% 8.33% 17.96% 26-53, 62-67, 70-80, 83-141, 144-160, 165-175, 179-196, 200-211, 214-219, 222-223
packages/service/common/s3/buckets/base.ts 5% 0% 0% 5% 20-256
packages/service/common/s3/sources/dataset/index.ts 0% 0% 0% 0% 1-264
packages/service/common/s3/sources/dataset/type.ts 0% 0% 0% 0% 1-69
packages/service/common/system/countLimit/const.ts 0% 0% 0% 0% 1-29
packages/service/common/system/countLimit/controller.ts 0% 100% 100% 0% 3-81
packages/service/common/system/countLimit/schema.ts 0% 0% 0% 0% 1-34
packages/service/common/system/countLimit/type.ts 0% 0% 0% 0% 1-16
packages/service/common/system/timerLock/constants.ts 0% 0% 0% 0% 1-19
packages/service/common/system/timerLock/schema.ts 0% 0% 0% 0% 1-25
packages/service/common/system/timerLock/utils.ts 0% 100% 100% 0% 2-48
packages/service/core/ai/functions/queryExtension.ts 13.81% 0% 0% 13.81% 122-282
packages/service/core/ai/hooks/useTextCosine.ts 94.69% 85.71% 88.88% 94.69% 26-27, 41-42, 134-135
packages/service/core/app/controller.ts 0% 100% 100% 0% 2-248
packages/service/core/chat/controller.ts 8.33% 100% 0% 8.33% 8-64, 67-93
packages/service/core/chat/saveChat.ts 4.56% 100% 0% 4.56% 52-57, 59-141, 144-187, 190-405, 408-607
packages/service/core/dataset/controller.ts 18.69% 50% 25% 18.69% 21-58, 65-66, 71-127, 130-168
packages/service/core/dataset/apiDataset/custom/api.ts 2.82% 100% 0% 2.82% 31-242
packages/service/core/dataset/collection/controller.ts 7.66% 100% 0% 7.66% 38-303, 307-434
packages/service/core/dataset/image/controller.ts 0% 0% 0% 0% 1-25
packages/service/core/dataset/migration/schema.ts 0% 0% 0% 0% 1-255
packages/service/core/dataset/search/controller.ts 3.44% 100% 0% 3.44% 95-137, 139-927, 935-972
packages/service/core/dataset/search/utils.ts 6.15% 100% 0% 6.15% 7-82
packages/service/core/workflow/dispatch/dataset/search.ts 4.38% 100% 0% 4.38% 46-286
packages/service/core/workflow/dispatch/tools/queryExternsion.ts 9.87% 100% 0% 9.87% 24-105
packages/service/core/workflow/dispatch/tools/readFiles.ts 9.87% 100% 0% 9.87% 34-52, 55-103, 106-123, 126-296
packages/service/support/appRegistration/schema.ts 0% 0% 0% 0% 1-33
packages/service/support/permission/teamLimit.ts 34.09% 15.38% 33.33% 34.09% 13-25, 28-41, 64-65, 69-77, 79-100, 104-123, 136-137, 141-147, 151-158
packages/service/support/permission/auth/file.ts 0% 100% 100% 0% 2-60
packages/service/support/permission/dataset/auth.ts 67.9% 87.5% 75% 67.9% 63-64, 72-77, 155-156, 178-226
packages/service/support/user/controller.ts 66.66% 40% 50% 66.66% 6-14, 30-33, 38-39
packages/service/support/user/schema.ts 95.58% 66.66% 66.66% 95.58% 76-78
packages/service/support/user/audit/schema.ts 100% 100% 0% 100%
packages/service/support/wallet/discountCoupon/schema.ts 0% 0% 0% 0% 1-42
packages/service/support/wallet/sub/schema.ts 96.2% 0% 0% 96.2% 104-106
packages/service/support/wallet/sub/utils.ts 32.56% 37.5% 30% 32.56% 26-27, 29-30, 35, 56, 62-78, 100-114, 138-222, 225-229, 232-234, 236-251, 254-278
packages/web/i18n/utils.ts 17.77% 100% 20% 17.77% 8-13, 16-23, 26-27, 30-56
projects/app/src/instrumentation.ts 0% 0% 0% 0% 1-95
projects/app/src/pages/api/admin/clearInvalidData.ts 0% 100% 100% 0% 2-113
projects/app/src/pages/api/admin/initv4143.ts 0% 0% 0% 0% 1-1051
projects/app/src/pages/api/admin/initv4144.ts 0% 0% 0% 0% 1-1049
projects/app/src/pages/api/admin/support/appRegistration/create.ts 0% 100% 100% 0% 2-93
projects/app/src/pages/api/common/file/read/[filename].ts 0% 0% 0% 0% 1-73
projects/app/src/pages/api/core/app/create.ts 88.44% 66.66% 100% 88.44% 56-57, 98, 160-161, 163-164, 171, 174, 176-191
projects/app/src/pages/api/core/app/exportChatLogs.ts 93.76% 47.05% 29.41% 93.76% 61-62, 111-117, 394, 397, 401, 425-430, 432-437, 439, 469-471
projects/app/src/pages/api/core/app/getChatLogs.ts 0% 100% 100% 0% 2-317
projects/app/src/pages/api/core/app/folder/create.ts 0% 0% 0% 0% 1-77
projects/app/src/pages/api/core/app/httpTools/create.ts 0% 0% 0% 0% 1-71
projects/app/src/pages/api/core/app/mcpTools/create.ts 0% 100% 100% 0% 2-79
projects/app/src/pages/api/core/chat/chatTest.ts 0% 100% 100% 0% 2-283
projects/app/src/pages/api/core/chat/clearHistories.ts 0% 100% 100% 0% 2-82
projects/app/src/pages/api/core/chat/delHistory.ts 0% 100% 100% 0% 2-48
projects/app/src/pages/api/core/dataset/searchTest.ts 0% 100% 100% 0% 2-154
projects/app/src/pages/api/core/dataset/collection/detail.ts 0% 100% 100% 0% 5-68
projects/app/src/pages/api/core/dataset/collection/read.ts 0% 100% 100% 0% 2-114
projects/app/src/pages/api/core/dataset/collection/create/backup.ts 0% 100% 100% 0% 2-93
projects/app/src/pages/api/core/dataset/collection/create/fileId.ts 0% 0% 0% 0% 1-54
projects/app/src/pages/api/core/dataset/collection/create/images.ts 0% 0% 0% 0% 1-102
projects/app/src/pages/api/core/dataset/collection/create/localFile.ts 0% 100% 100% 0% 2-70
projects/app/src/pages/api/core/dataset/collection/create/template.ts 0% 100% 100% 0% 2-93
projects/app/src/pages/api/core/dataset/collection/create/text.ts 0% 100% 100% 0% 3-60
projects/app/src/pages/api/core/dataset/data/insertImages.ts 0% 100% 100% 0% 2-121
projects/app/src/pages/api/core/dataset/data/v2/list.ts 0% 0% 0% 0% 1-109
projects/app/src/pages/api/core/dataset/training/getTrainingDataDetail.ts 91.17% 25% 100% 91.17% 44-45, 53
projects/app/src/pages/api/support/user/account/loginByPassword.ts 100% 100% 100% 100%
projects/app/src/pages/api/support/user/account/tokenLogin.ts 0% 0% 0% 0% 1-47
projects/app/src/pages/api/support/user/account/update.ts 0% 0% 0% 0% 1-49
projects/app/src/pages/api/support/user/team/plan/getTeamPlanStatus.ts 0% 100% 100% 0% 2-67
projects/app/src/pages/api/v1/audio/transcriptions.ts 0% 100% 100% 0% 2-76
projects/app/src/pages/api/v1/chat/completions.ts 0% 100% 100% 0% 2-629
projects/app/src/pages/api/v2/chat/completions.ts 0% 100% 100% 0% 2-625
projects/app/src/service/common/system/cron.ts 0% 0% 0% 0% 1-73
projects/app/src/service/common/system/cronTask.ts 0% 0% 0% 0% 1-128
projects/app/src/service/common/system/index.ts 26.81% 100% 15.38% 26.81% 27-47, 53-55, 58-59, 62-64, 67-69, 71-73, 75-77, 88-108, 131-222
projects/app/src/service/core/dataset/data/controller.ts 0% 0% 0% 0% 1-442
projects/app/src/service/support/wallet/usage/push.ts 0% 0% 0% 0% 1-336
projects/app/src/web/common/api/request.ts 64.7% 96.87% 36.36% 64.7% 82-94, 134-142, 173-205, 215-216, 219-220, 223-224, 227-228
projects/app/src/web/common/file/api.ts 0% 0% 0% 0% 1-49
projects/app/src/web/common/hooks/useSpeech.ts 0% 0% 0% 0% 1-537
projects/app/src/web/core/app/api/evaluation.ts 0% 0% 0% 0% 1-55
projects/app/src/web/core/dataset/api.ts 0% 0% 0% 0% 1-319
projects/app/src/web/core/dataset/image/api.ts 0% 0% 0% 0% 1-57
projects/app/src/web/support/user/api.ts 98.7% 100% 95.45% 98.7% 36
projects/app/src/web/support/user/useUserStore.ts 0% 0% 0% 0% 1-115
projects/app/src/web/support/wallet/bill/api.ts 0% 0% 0% 0% 1-42
projects/app/src/web/support/wallet/sub/discountCoupon/api.ts 0% 0% 0% 0% 1-5
Generated in workflow #2998 for commit b4adc63 by the Vitest Coverage Report Action

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Docs Preview:


🚀 FastGPT Document Preview Ready!

🔗 👀 Click here to visit preview

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces V4.14.4 features with significant refactoring of the test infrastructure, billing system enhancements, language preference management, and various API improvements.

Key Changes:

  • Comprehensive test infrastructure reorganization with modularized mocks
  • Enhanced billing system with discount coupons, bill cancellation, and repayment features
  • User language preference persistence across login and settings
  • Geolocation support for tracking user regions in chat logs
  • Removal of legacy GridFS file handling in favor of S3-only storage

Reviewed changes

Copilot reviewed 189 out of 207 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/setup.ts Refactored to remove inline mocks, simplified MongoDB connection handling
test/mocks/* Modularized mock structure for better organization and reusability
projects/app/src/pages/api/support/user/account/loginByPassword.ts Added language parameter to persist user language preference on login
projects/app/src/web/support/wallet/bill/api.ts Enhanced with cancel bill and bill detail endpoints
projects/app/src/pageComponents/price/Standard.tsx Added discount coupon integration and custom plan support
projects/app/src/pages/api/core/dataset/* Migrated from GridFS to S3-only file storage
projects/app/src/pages/api/v1/chat/completions.ts Added IP geolocation tracking and QPM metrics
projects/app/src/components/Select/I18nLngSelector.tsx Added user preference persistence when changing language
projects/app/.env.template Added new configuration options for S3, discount coupons, and app registration
projects/app/Dockerfile Added GeoLite2-City.mmdb for geolocation support
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Preview fastgpt Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_b4adc63d5e2dbb696613846dea44d829823ca39c

@c121914yu c121914yu requested a review from Copilot December 5, 2025 08:51
Copilot finished reviewing on behalf of c121914yu December 5, 2025 08:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 192 out of 210 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants