Skip to content

[ISSUE #15946] Preserve empty Skill resources and multiline descriptions - #15948

Merged
KomachiSion merged 1 commit into
alibaba:developfrom
saynoword:fix/skill-content-roundtrip
Oct 27, 2026
Merged

KomachiSion merged 1 commit into
alibaba:developfrom
saynoword:fix/skill-content-roundtrip

Conversation

@saynoword

@saynoword saynoword commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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

Fixes #15946
Fixes #15947
Fixes #15945

What is the purpose of the change

Skill creation/upload accepts an empty resource file, but the Config read path treats its content as missing and breaks subsequent version reads or downloads. Multiline YAML descriptions are also normalized to | and can generate spurious fields such as description.Triggers. Preserve empty resources and return the complete parsed description from Skill list/detail APIs.

Existing incorrect description metadata is refreshed by a content update or re-upload; this change does not backfill historical metadata.

Brief changelog

  • Treat only null formal configuration content as absent; preserve empty and whitespace-only content and response metadata.
  • Parse literal/folded YAML block scalars with the existing SnakeYAML dependency and reuse the parser during frontmatter normalization, preserving other fields' existing representation.
  • Add unit coverage for missing versus empty content, YAML chomping/indentation, and create/upload followed by list/detail reads.
  • Add HTTP integration scenarios for creation/upload, description metadata, empty resource reads, and ZIP downloads; update English/Chinese specs and the API coverage registry.

Verifying this change

  • JDK 17: the five focused test classes pass (146 tests):
    mvn -pl config,ai -Dtest=FormalHandlerTest,SkillZipParserTest,SkillRequestUtilTest,SkillFrontMatterTest,NacosConfigAiResourceStorageTest -Dsurefire.failIfNoSpecifiedTests=false test
  • Spotless apply/check passes for the seven changed Java implementation/unit-test files. Module-scoped Checkstyle, Apache RAT, and SpotBugs pass for config and ai.
  • mvn -pl test/openapi-test -Pintegration-test -DskipTests test-compile passes. The new HTTP scenarios have not been executed against a running server.
  • The full repository test suite and full integration suite were not run.

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 spotless:apply to format your code. Run mvn -B clean compile apache-rat:check checkstyle:check spotbugs:check spotless: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.

…scriptions

Treat only null formal configuration content as missing so empty Skill
resource files remain readable. Parse YAML block scalars with SnakeYAML
and reuse the result during Skill frontmatter normalization.

Add regression and HTTP integration coverage and clarify the corresponding
Skill and configuration query contracts.

Fixes alibaba#15946
Fixes alibaba#15947

Assisted-by: Codex
@github-actions

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格式)。

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@KomachiSion
KomachiSion merged commit 1e6d4dd into alibaba:develop Oct 27, 2026
9 checks passed
@KomachiSion KomachiSion added area/Skill kind/bug Category issues or prs related to bug. labels Oct 27, 2026
@KomachiSion KomachiSion added this to the 3.3.0 milestone Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

3 participants