Skip to content

[ISSUE #15315] Optimize Skill upload precheck and conflict handling#15316

Merged
KomachiSion merged 7 commits into
alibaba:developfrom
saynoword:fix/upload-skill-optimization
Jun 17, 2026
Merged

[ISSUE #15315] Optimize Skill upload precheck and conflict handling#15316
KomachiSion merged 7 commits into
alibaba:developfrom
saynoword:fix/upload-skill-optimization

Conversation

@saynoword

@saynoword saynoword commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Please do not create a Pull Request without creating an issue first.

What is the purpose of the change

Optimize Skill ZIP upload by adding a lightweight precheck flow for Skill name/version conflicts before the full package upload, making draft/reviewing conflict handling explicit, and keeping multi-skill ZIP parsing consistent when nested skill-like folders or invalid/non-skill folders are present.

Brief changelog

  • Add Skill upload precheck request/result models and wire the admin/console/maintainer-client upload precheck APIs.
  • Update Skill upload service logic so overwrite=true handles single and batch draft overwrite consistently, blocks reviewing versions, and uses a valid uploaded version when it should create a newer draft.
  • Improve Skill ZIP parsing for nested Skill directories, wrapper directories, macOS metadata files, invalid skill-like folders, and non-skill folders in multi-skill packages.
  • Update the console upload dialog to parse Skill metadata locally, auto-run precheck after file selection, present draft overwrite/skip choices, and distinguish invalid/non-skill folders from blocked Skill conflicts.
  • Add and update unit tests, console handler/proxy tests, OpenAPI scenario coverage, and Skill specs for the new upload behavior.

Verifying this change

  • mvn -pl api,ai,console,maintainer-client,test/openapi-test spotless:apply
  • mvn -pl api,ai,console,maintainer-client,test/openapi-test spotless:check
  • mvn -pl ai,console,maintainer-client -am -Dtest=SkillOperationServiceImplTest,SkillResourceOperatorTest,SkillZipParserTest,ConsoleSkillControllerTest,SkillProxyTest,SkillInnerHandlerTest,SkillRemoteHandlerTest,SkillNoopHandlerTest,SkillMaintainerServiceImplTest -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn -pl ai -Dtest=SkillOperationServiceImplTest -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn -pl ai -Dtest=SkillZipParserTest -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn -pl ai spotless:check
  • mvn -pl test/openapi-test -DskipTests validate
  • mvn -pl test -DskipTests apache-rat:check
  • ./node_modules/.bin/vitest --run src/utils/__tests__/skillUploadParser.test.ts
  • ./node_modules/.bin/eslint src/utils/skillUploadParser.ts src/utils/__tests__/skillUploadParser.test.ts src/pages/skillManagement/components/UploadSkillDialog.tsx
  • ./node_modules/.bin/tsc -b
  • npm run build

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean package apache-rat:check spotbugs:check -DskipTests to make sure basic checks pass. Run mvn clean install to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API , Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API新增配置参数修改默认配置等操作。
如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。

* @return result of the upload precheck
* @throws NacosException if the precheck fails
*/
@Since("3.2.2")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

3.2.3。

3.2.2是已经发布的版本

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

* @return upload precheck result
* @throws NacosException if fail to precheck upload
*/
@Since("3.2.2")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

3.2.3。

3.2.2是已经发布的版本

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

* @return skill name
* @throws NacosException if fail to upload skill
*/
@Since("3.2.2")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

3.2.3。

3.2.2是已经发布的版本

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

* @return result of the upload precheck
* @throws NacosException if the precheck fails
*/
@Since("3.2.2")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

3.2.3。

3.2.2是已经发布的版本

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@saynoword saynoword force-pushed the fix/upload-skill-optimization branch 3 times, most recently from ba74668 to d1bfa8e Compare June 10, 2026 11:17
@saynoword saynoword force-pushed the fix/upload-skill-optimization branch from d1bfa8e to 59eaf49 Compare June 12, 2026 11:53
…tMsg support

- Add precheck endpoint for upload validation before actual upload
- Support uploadAction parameter (create_draft/overwrite_draft/create_version)
- Support commitMsg parameter for version commit messages
- Add SkillUploadPrecheckRequest/Result models in API module
- Refactor SkillOperationServiceImpl upload flow with UploadVersionCandidate
- Update SkillZipParser to extract version from skillMd front-matter
- Add upload precheck support to Console/Admin/Maintainer layers
- Update skill-spec documentation for new upload workflow
- Add integration tests for upload precheck scenarios
- Refactor UploadSkillDialog to use precheck-then-upload two-step flow
- Add client-side ZIP parsing with skillUploadParser utility
- Show parsed skill info (name, version, description) before upload
- Handle conflict scenarios: version exists, no permission, etc.
- Add uploadAction selection UI for overwrite/create options
- Support commitMsg input for version publishing
- Update locales (en-US, zh-CN) with new upload dialog strings
- Add unit tests for skillUploadParser
Regenerated from source changes in the previous commit.

# Conflicts:
#	console/src/main/resources/static/next/js/main.js
@saynoword saynoword force-pushed the fix/upload-skill-optimization branch from 59eaf49 to d86a6cb Compare June 15, 2026 12:42
@saynoword saynoword changed the title [ISSUE #15315] Optimize Skill upload with precheck, uploadAction and commitMsg [ISSUE #15315] Optimize Skill upload precheck and conflict handling Jun 15, 2026
@KomachiSion KomachiSion merged commit 2f8d884 into alibaba:develop Jun 17, 2026
6 checks passed
@KomachiSion KomachiSion added kind/enhancement Category issues or prs related to enhancement. area/Skill labels Jun 17, 2026
@KomachiSion KomachiSion added this to the 3.3.0 milestone Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/Skill kind/enhancement Category issues or prs related to enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants