Repository navigation
[ISSUE #14833] Add AI resource trace logging and fix prompt bizTags handling in both UIs - #14852
Merged
Merged
Conversation
Add ai_resource_trace.log with JSON-formatted entries for auditing all AI resource version lifecycle operations across skill, agentspec, prompt, mcp, and a2a resource types. Designed for ELK/Loki integration with ISO 8601 timestamps. - Add AiResourceTraceService with operation constants and JSON log methods - Add AiLogUtil with dedicated logger routed to ai-resource-trace.log - Add VisibilityHelper.resolveClientIp() for request context IP extraction - Integrate trace logs in SkillOperationServiceImpl (upload, createDraft, updateDraft, deleteDraft, updateBizTags) - Integrate trace logs in AgentSpecOperationServiceImpl (upload, createDraft, updateDraft, deleteDraft, updateBizTags) - Integrate trace logs in PromptOperationServiceImpl (createDraft, updateDraft, deleteDraft, updateBizTags) - Integrate trace logs in AiResourceManager (publish, forcePublish, submitReview, reviewApproved, reviewRejected, onlineVersion, offlineVersion, deleteResource, updateLabels, updateScope, enable, disable) - Integrate trace logs in McpServerOperationService (create, update, delete) - Integrate trace logs in A2aServerOperationService (register, update, delete) - Configure RollingFileAppender in nacos-logback.xml (1GB maxFileSize, 15 days retention) 🤖 Generated with [Qoder][https://qoder.com]
…roughout - Change PromptMetaSummary.bizTags from List<String> to String to match Skill model - Remove JSON serialization/deserialization of bizTags in read and write paths - Remove parseBizTags() conversion in PromptAdminController, pass raw string directly - Update legacy method signatures in PromptOperationService/Impl to accept String bizTags This fixes bizTags not persisting after update: the read path was trying to deserialize a plain string as a JSON array, causing silent failure. Now bizTags is treated as an opaque string throughout the prompt layer, consistent with how Skill handles it. Assisted-by: Qoder
…ags handling - Add OP_UPDATE_DESCRIPTION constant to AiResourceTraceService - Add trace logging for changeOnlineStatus, updateLabels, updateDescription - Change legacy UI prompt list column from bizTags to labels display - Add inline bizTags editing support in legacy UI prompt detail page - Fix new UI bizTags type from string[] to string, add parseBizTags() utility - Update new UI PromptCard, PromptDetailPage, and tests to use parseBizTags() 🤖 Generated with [Qoder][https://qoder.com]
|
Thanks for your this PR. 🙏 感谢您提交的PR。 🙏 |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
KomachiSion
approved these changes
Apr 3, 2026
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please do not create a Pull Request without creating an issue first.
What is the purpose of the change
Add a dedicated JSON-formatted audit trace log (
ai_resource_trace.log) for all AI resource lifecycle operations (skill, agentspec, prompt, mcp, a2a), designed for ELK/Loki integration. Additionally, fix promptbizTagshandling throughout the stack — backend modeltype was mismatched with actual storage format, causing silent failures in both legacy and new console UIs.
Brief changelog
AiResourceTraceServicewith operation constants and JSON log methods,AiLogUtilwith dedicated logger, andVisibilityHelper.resolveClientIp()for IP extraction.RollingFileAppenderinnacos-logback.xml(1GB maxFileSize, 15 days retention).PromptMetaSummary.bizTagsfromList<String>toStringto match actual storage format, remove broken JSON deserialization in read/write paths.OP_UPDATE_DESCRIPTIONconstant and trace logging forchangeOnlineStatus,updateLabels,updateDescriptionoperations that were previously missing.bizTagsTypeScript type fromstring[]tostring, addparseBizTags()utility, updatePromptCard,PromptDetailPage, and related tests.Verifying this change
Backend static checks:
Unit tests:
mvn clean install -DskipITs
Manual verification:
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 https://github.
com/alibaba/nacos/tree/master/test.
[ ] Run mvn -B clean package apache-rat:check spotbugs:check -DskipTests to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.