[ISSUE#14907] feat(ai): support targetVersion parameter for skill upload API #14979
Conversation
|
Thanks for your this PR. 🙏 感谢您提交的PR。 🙏 |
|
meta.info文件并非skill spec中定义的文件, 而是skillhub的自定义文件, 面向spec标准的话不应该支持。 不过nacos在规划新功能就是设置导入来源, 若是选择直接从skillhub导入的话, 在对应部分代码中是应该支持的。 但是不是通过文件上传导入支持, 文件上传导入还是应该面向标准 |
KomachiSion
left a comment
There was a problem hiding this comment.
如issue表述的, 针对meta.info这种非标准定义中的内容,不应该在文件导入中支持。
通过api和ui导入时指定版本号确实需要, 因此辛苦重新修改一下PR,仅api,ui导入时支持制定版本(可选项)。
顺序为:
frontmatter.metadata.version -> target version -> default version 0.0.1.
|
okok, please review again |
|
@LiyunZhang10 Sorry for my mistack, I forgot loading meta.json is current supported features, might you rollback to old implementation. |
…oad API Add optional targetVersion parameter to skill upload API and UI, allowing users to specify a version when the ZIP content has no version info. Version resolution priority: SKILL.md frontmatter -> meta.json in ZIP -> targetVersion -> default 0.0.1 Changes: - Add targetVersion parameter to upload API endpoints (SkillAdminController, ConsoleSkillController) - Thread targetVersion through SkillHandler, SkillProxy, SkillOperationService - Add targetVersion as fallback in resolveUploadVersion after meta.json - Add test for targetVersion fallback behavior
f65685f to
45be3a7
Compare
|
ok,please review again |
…romZip signature The uploadSkillFromZip method in SkillOperationService was updated to accept a targetVersion parameter (4 params: namespaceId, zipBytes, overwrite, targetVersion). The SkillInnerHandler delegates to this 4-param method, but the test was still stubbing and verifying the old 3-param overload, causing a PotentialStubbingProblem in Mockito strict mode. Fix: update when() and verify() to use the 4-param signature with isNull() for targetVersion.
|
Also please update the api document. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Docs PR submitted: nacos-group/nacos-group.github.io#1077 |
The skill upload REST APIs (/nacos/v3/admin/ai/skills/upload and /v3/console/ai/skills/upload) now accept an optional targetVersion form field. Version resolution order: SKILL.md frontmatter metadata.version -> meta.json in ZIP -> targetVersion parameter -> default 0.0.1 Aligns docs with nacos PR alibaba/nacos#14979. Co-authored-by: LiyunZhang10 <LiyunZhang10@users.noreply.github.com>
What is the purpose of the change
Closes #14907
When uploading a skill via ZIP file, if the ZIP content does not contain version information (neither in
SKILL.mdYAML front-matter normeta.json), the version defaults to0.0.1. This makes it impossible for users to specify a custom version during upload.This PR adds an optional
targetVersionrequest parameter to the skill upload API, allowing users to explicitly specify a version as a fallback.Version resolution priority:
SKILL.md YAML front-matter>meta.json in ZIP>user-specified targetVersion>default "0.0.1"Brief changelog
targetVersionparameter toSkillAdminController.uploadSkill()andConsoleSkillController.uploadSkill()SkillOperationServiceinterface with new overloadeduploadSkillFromZipmethods that accepttargetVersionSkillOperationServiceImpl.resolveUploadVersion()to usetargetVersionas fallbackSkillHandlerinterface and all implementations (SkillInnerHandler,SkillNoopHandler,SkillRemoteHandler)SkillProxywith new overloaded methodtestUploadSkillFromZipUsesTargetVersionWhenCannotInferVerifying this change
This change is already covered by existing tests and a new test case:
SkillOperationServiceImplTest#testUploadSkillFromZipUsesTargetVersionWhenCannotInfer— verifies that when ZIP content has no version info, the user-specifiedtargetVersionis used.Checklist
null)