Skip to content

feat: migrate to fastgpt storage sdk#324

Merged
c121914yu merged 11 commits intolabring:v0.4.0-devfrom
xqvvu:main
Jan 6, 2026
Merged

feat: migrate to fastgpt storage sdk#324
c121914yu merged 11 commits intolabring:v0.4.0-devfrom
xqvvu:main

Conversation

@xqvvu
Copy link
Contributor

@xqvvu xqvvu commented Dec 19, 2025

No description provided.

@xqvvu xqvvu force-pushed the main branch 3 times, most recently from 5a9130f to 2adb9ae Compare December 23, 2025 10:33
@github-actions
Copy link

github-actions bot commented Dec 23, 2025

Build Successful - Preview Images for this PR:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin-pr:c3f8d91d6c388ebb6d18337a1af8b774dc464888

Changed packages:
base64Decode dalle3 dbops docDiff drawing gptImage markdownTransform mineru minimax openrouterMultiModal stability

@xqvvu xqvvu force-pushed the main branch 5 times, most recently from 8c43628 to 3520ec3 Compare December 25, 2025 10:11
Copy link
Contributor

@c121914yu c121914yu left a comment

Choose a reason for hiding this comment

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

试试改一个版本号

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 migrates the codebase from a custom MinIO-based S3 implementation to the @fastgpt-sdk/storage SDK, which provides unified support for multiple cloud storage vendors including MinIO, AWS S3, Alibaba Cloud OSS, and Tencent Cloud COS.

Key Changes:

  • Replaced custom S3 client implementation with @fastgpt-sdk/storage SDK
  • Refactored environment variable configuration to support multiple storage vendors
  • Updated storage-related APIs to use the new SDK's interface
  • Added new version entries for multiple tool packages

Reviewed changes

Copilot reviewed 38 out of 40 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
sdk/package.json Bumped package version from 0.2.16 to 0.2.17
scripts/deploy-marketplace.ts Migrated S3Client usage to createStorage API with multi-vendor support
runtime/index.ts Removed initializeS3() call as initialization is now handled in lib/s3/index.ts
runtime/.env.template Replaced old S3 environment variables with new STORAGE_* variables for multi-vendor support
package.json Added @fastgpt-sdk/storage ^0.5.1 and proxy-agent dependencies
modules/tool/utils/uploadFile.ts Added global prefix handling for worker-based file uploads
modules/tool/type/req.ts Added optional prefix field to tool system variables
modules/tool/parseMod.ts Updated to use new SDK's generateExternalUrl method
modules/tool/loadToolDev.ts Removed await from generateExternalUrl calls (now synchronous)
modules/tool/constants.ts Removed leading slash from PluginBaseS3Prefix constant
modules/tool/build/build-json.ts Updated icon path generation to use new SDK
modules/tool/api/upload/confirmUpload.ts Added debug logging for downloaded tools
modules/model/avatars.ts Removed await from generateExternalUrl (now synchronous)
lib/worker/worker.ts Added global.currentToolPrefix for cross-import state management
lib/worker/loadTool.ts Moved LoadToolsByFilename implementation from loadToolProd and removed icon path generation
lib/worker/index.ts Added getInheritEnv helper to pass all environment variables to workers
lib/utils/setupProxy.ts Simplified proxy setup to use undici's EnvHttpProxyAgent
lib/type/env.d.ts Removed old S3_* environment variable declarations
lib/s3/index.ts Completely refactored to use @fastgpt-sdk/storage with lazy initialization
lib/s3/controller.ts Migrated from minio.Client to IStorage interface
lib/s3/const.ts Removed PublicBucketBaseURL constant (now handled by SDK)
lib/s3/config.ts Replaced S3ConfigType with createDefaultStorageOptions function supporting multiple vendors
lib/package.json Added @fastgpt-sdk/storage 0.5.7 dependency
.github/workflows/deploy-marketplace.yml Updated environment variables from S3_* to STORAGE_*
.env.marketplace.template Added comprehensive STORAGE_* configuration options
Multiple tool config files Added new version entries (0.1.1, 0.1.2, etc.) with updated configurations
modules/tool/packages/dbops/children/oracle/src/index.ts Improved Oracle DB error handling and result sanitization

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

@xqvvu xqvvu force-pushed the main branch 2 times, most recently from 0c61cc8 to d924356 Compare January 6, 2026 07:37
@c121914yu c121914yu changed the base branch from main to v0.4.0-dev January 6, 2026 09:03
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 37 out of 39 changed files in this pull request and generated 2 comments.


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

Comment on lines +122 to 126
storage.uploadObject({
key: `${UploadToolsS3Path}/${toolId}/${childId}/logo`,
body: Buffer.from(await Bun.file(childLogo).arrayBuffer()),
contentType: mimeMap[ext]
});
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Missing await keyword on storage.uploadObject() call. This async operation is not being awaited, which could result in incomplete uploads when the child has its own logo.

Copilot uses AI. Check for mistakes.
@c121914yu c121914yu merged commit 8d871b1 into labring:v0.4.0-dev Jan 6, 2026
2 checks passed
c121914yu pushed a commit that referenced this pull request Jan 8, 2026
* chore: more logs

* feat: migrate to fastgpt storage sdk

* chore: add systemVar types

* chore: rename env variable

* fix: oracle db operation

* fix: global proxy agent

* fix: incorrect config load timing

* fix: incorrect fastgpt storage sdk version

* fix: update COS proxy

* chore: upgrade tools' version which using 'uploadFile' function

* clean code
c121914yu added a commit that referenced this pull request Jan 9, 2026
* feat: migrate to fastgpt storage sdk (#324)

* chore: more logs

* feat: migrate to fastgpt storage sdk

* chore: add systemVar types

* chore: rename env variable

* fix: oracle db operation

* fix: global proxy agent

* fix: incorrect config load timing

* fix: incorrect fastgpt storage sdk version

* fix: update COS proxy

* chore: upgrade tools' version which using 'uploadFile' function

* clean code

* fix: use "minio" for minio adapter (#337)

* chore: more logs

* clean code

* fix: use "minio" for minio adapter

* fix: remove log client when ensure public policy failed (#338)

* chore: more logs

* clean code

* fix: remove log client when ensure public policy failed

* fix: use minio client to delete files when using minio vendor

* chore: bump @fastgpt-sdk/storage (#339)

* chore: more logs

* clean code

* chore: bump @fastgpt-sdk/storage

* fix: bump storage sdk (#340)

* chore: more logs

* clean code

* fix: bump storage sdk

* perf: worker in tool (#342)

* remove run in worker

* update plugin version

* perf: worker in tool

* adapt v1

* adapt v1

* adapt v1

* adapt v1

* update lock

* worker

* log

* log

* log

* mongo (#343)

* mongo

* fix: ts

* fix: add async context for non-worker environment (#344)

* chore: more logs

* clean code

* fix: add async context for non-worker environment

* fix: bundle pkgs without mongo and storage dependencies

* fix: force throw error when there is no prefix passing in

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>

* fix: mssql authentication (#345)

* chore: more logs

* clean code

* fix: mssql authentication

---------

Co-authored-by: roy <whoeverimf5@gmail.com>
Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
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.

2 participants