703 Commits

Author SHA1 Message Date
Gerard b43b3581a7 fix: reject IPv6 mixed addresses with more than six 16-bit blocks (#15764)
In the IPv6 mixed notation the IPv6 part holds at most 96 bits, that is
six 16-bit blocks, because the trailing IPv4 part occupies the remaining
32 bits. IPV6_MIXED_COMPRESSED_REGEX uses a * quantifier after '::', so
the number of blocks was unbounded and addresses longer than 128 bits
were reported as valid.

Keep the regexes unchanged and reject the IPv6 part when it holds more
than six blocks.

Fixes: #15763

Co-authored-by: GerardGao <213731635+GerardGao@users.noreply.github.com>
2026-08-24 16:13:28 +08:00
cyforkk e403aa0af8 [ISSUE #15625] Add volatile to Connection.abandon for cross-thread visibility (#15631) 2026-08-10 11:39:36 +08:00
杨翊 SionYang eedacb4315 [ISSUE #14804] Add Agent code-first publication SDK (#15643)
Expose generic Agent definition publication over HTTP and gRPC with optional ordinary auto-submit semantics.

Complete A2A client multi-version endpoint redo and exact/latest polling subscription recovery, with specifications, unit tests, and standalone integration coverage.

Assisted-by: Claude Code
2026-08-04 11:14:11 +08:00
杨翊 SionYang bd33453a99 [ISSUE #15475] Make plugin discovery conflicts deterministic (#15592)
* Remove reflective EnvUtil access from visibility plugin

Assisted-by: Claude Code

* Use first-wins plugin registration and definition normalization

Assisted-by: Claude Code
2026-07-28 12:07:09 +08:00
MajorHe1 170d3d723b [ISSUE #15549] use else-if in JdkHttpClientRequest.execute() when body is not file (#15550)
* [ISSUE #15549] use else-if in JdkHttpClientRequest.execute() when body iis not file

* [ISSUE #15549] add unit-test for JdkHttpClientRequest.execute() when body is file

* [ISSUE #15549] fix unit-test check style for JdkHttpClientRequest.execute()

* [ISSUE #15549] fix spotless problem

---------

Co-authored-by: MajorHe1 <601023364@qq.com>
2026-07-22 20:48:18 +08:00
yijie zhao 1698643749 [ISSUE #12064] Support grpc port offset from client config (#15507)
* fix: support grpc port offset from client config

* fix: refine grpc port offset config handling

* test: cover client grpc port offset property

* style: apply spotless formatting

* test: cover grpc client config default port offset

* style: format grpc client config test
2026-07-20 10:40:42 +08:00
杨翊 SionYang 70cb7290aa Use Nacos self-hosted runners for CI workflows. (#15480)
* Use Nacos self-hosted runners for CI workflows.

* Stabilize IPv6 preference tests in CI

Assisted-by: Claude Code
2026-07-09 13:29:15 +08:00
Vasiliy Mikhailov 021dc7c480 Guard BatchTaskCounter.batchSuccess against out-of-range batch index (#15425)
batchSuccess only checked the upper bound (batch <= size), so batch <= 0 passed the check and then get(batch - 1) threw IndexOutOfBoundsException (e.g. batchSuccess(0) -> get(-1)). The existing test even documents this gap. Add the missing lower-bound check so out-of-range indices are ignored consistently with batch > size, and extend the test to cover 0 and negative.
2026-07-01 13:31:32 +08:00
杨翊 SionYang 78229d6878 Remove reviewed unused Java code (#15440)
Remove confirmed unused Java methods and classes across AI, common, config, naming, persistence, copilot, CMDB, and client modules.

Mark preserved compatibility candidates as deprecated instead of removing them.

Assisted-by: Claude Code
2026-06-26 13:32:34 +08:00
杨翊 SionYang 9f5ab9a43c [ISSUE #14466] Clarify selected JSON adapter log (#15438)
Print the effective Jackson adapter version together with the configured adapter property so auto mode diagnostics show the final selected adapter.

Assisted-by: Claude Code
2026-06-26 10:18:55 +08:00
杨翊 SionYang 5f56cbbc7e [ISSUE #14466] Add JSON adapter selection diagnostics (#15434)
Log the selected JSON adapter once during client and maintainer-client initialization, then remove the temporary migration tracker document.

Assisted-by: Claude Code
2026-06-26 09:41:22 +08:00
杨翊 SionYang 162e53c6d7 Remove confirmed unused Java code follow-ups (#15432)
* Remove unused api AgentSpec group helper

* Remove unused common test field

* Remove unused ai pipeline SQL helper

* Remove unused copilot helpers

* Remove unused istio listener helper

* Remove unused lock wait queue helpers

* Remove unused core utilities

* Remove unused config code

* Remove unused naming code

* Fix ai prompt migration test isolation

Assisted-by: Codex

* Fix client test isolation

Assisted-by: Codex
2026-06-25 19:58:12 +08:00
杨翊 SionYang cc508a80be [ISSUE #14466] Add Jackson 3 SDK IT profiles (#15427)
* [ISSUE #14466] Add Jackson 3 IT workflow todo

Assisted-by: Claude Code

* [ISSUE #14466] Add Jackson 3 SDK IT profiles

Assisted-by: Claude Code

* [ISSUE #14466] Fix Jackson 3 final field deserialization

Assisted-by: Claude Code
2026-06-25 19:06:30 +08:00
杨翊 SionYang 38fa739598 [ISSUE #14466] Finalize Jackson adapter dependency checks (#15426)
Assisted-by: Claude Code
2026-06-25 13:34:59 +08:00
Vasiliy Mikhailov 74ed8fb92a Fix trailing separator in StringUtils.join when collection has null elements (#15410)
StringUtils.join(Collection, String) skips null elements but appends the
separator based on the element index (i != collection.size() - 1) rather
than on whether another non-null element follows. When the collection ends
with one or more null elements, this leaves a dangling separator, e.g.
join(["a", null], ",") returns "a," instead of "a", and
join(["a", null, "b", null], ",") returns "a,b," instead of "a,b".

Track whether any element has already been appended and emit the separator
before each subsequent non-null element, so trailing, leading, and mixed
null elements no longer produce stray separators.

Signed-off-by: Vasiliy Mikhailov <vasiliy.mikhailov@gmail.com>
2026-06-25 09:56:36 +08:00
杨翊 SionYang 0028ad6c58 [ISSUE #14466] Remove Jackson JavaType from rest template (#15369)
Resolve response handler raw classes with JDK Type APIs instead of Jackson JavaType.

Add coverage for parameterized RestResult, custom parameterized responses, and unsupported Type fallback.

Assisted-by: Claude Code
2026-06-17 11:30:44 +08:00
杨翊 SionYang 75b7a9ddf5 [ISSUE #14466] Remove Jackson byte buffer stream from GrpcUtils (#15368)
Use the neutral JSON facade in GrpcUtils and add a Nacos-owned ByteBufferInputStream helper for payload parsing.

Update the Jackson adapter migration TODO with stage 5 validation results.

Assisted-by: Claude Code
2026-06-17 09:37:35 +08:00
杨翊 SionYang 2a95081f59 [ISSUE #14466] Add Jackson 3 JSON adapter (#15363)
Add a Java 8 safe Jackson 3 adapter facade and lazy Jackson 3 delegate in nacos-common. Register the adapter through ServiceLoader with provided/optional Jackson 3 dependencies, and cover availability, selection, serialization, deserialization, subtype registration, and error mapping paths.

Assisted-by: Claude Code
2026-06-16 14:24:24 +08:00
杨翊 SionYang 714ccff2ed [ISSUE #14466] Add Jackson 2 JSON adapter (#15362)
* [ISSUE #14466] Improve JSON adapter API test coverage

Assisted-by: Claude Code

* [ISSUE #14466] Add Jackson 2 JSON adapter

Assisted-by: Claude Code
2026-06-16 12:16:57 +08:00
杨翊 SionYang 1f9f6ccc8e Remove confirmed unused Java code (#15358)
* Remove confirmed unused Java code

Remove validated unused helpers, constants, classes, and matching dedicated tests across Java modules.

Deprecate currently unused datasource mapper methods so downstream plugin usage can be confirmed before removal.

Validation:

- mvn spotless:check

- mvn -B clean compile apache-rat:check checkstyle:check spotbugs:check spotless:check -DskipTests

- mvn -B '-Prelease-nacos,!dev' clean install -Drat.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -DskipTests=false

- mvn -B clean install -Prelease-nacos -DskipTests=true

- mvn -B clean verify -Pintegration-test

- mvn -B -pl test/java-sdk-test clean verify -Pjava-sdk-integration-test -DskipTests=false

- mvn -B -pl test/maintainer-sdk-test clean verify -Pmaintainer-sdk-integration-test -DskipTests=false

Assisted-by: Codex

* Fix flaky unit test setup

Reuse the same version 0.2.0 tar.gz fixture bytes for digest validation and HTTP response payloads, and initialize EnvUtil in GlobalExecutorTest when the test runs without suite-level environment setup.

Assisted-by: Codex

* Fix config test isolation

Assisted-by: Claude Code

* Fix flaky failover reactor test

Assisted-by: Claude Code
2026-06-16 00:12:23 +08:00
blake.qiu 3f9192f3e0 fix(15265): AI skill list rejects skillName used as a query condition when it starts or ends with a hyphen. (#15273) 2026-06-04 20:25:23 +08:00
sai b8fe1c2039 [ISSUE #15221] Route AI resource trace logs through trace events (#15222)
* Refactor AI resource trace logging to subscriber

Assisted-by: Claude Code

* Ignore codegraph metadata

Assisted-by: Claude Code

* Exclude codegraph metadata from RAT checks

* Move AI trace log to default plugin

# Conflicts:
#	plugin-default-impl/nacos-default-plugin-all/pom.xml
#	plugin-default-impl/pom.xml

* Document default AI trace plugin
2026-05-25 09:47:41 +08:00
Guimu 6cf8253662 Replace printStackTrace() with proper logging in 3 silent-failure paths (#15194)
Three production code paths swallow exceptions by calling
`Throwable.printStackTrace()`. That bypasses the configured logging
framework — the stack trace goes to stderr instead of the Nacos log
files, so it does not participate in log rotation / aggregation and is
easy to miss in clustered deployments.

This is a follow-up to #15179, which fixed the same anti-pattern in
`IoUtils#tryCompress` and `NamingFuzzyWatchContextService#trimFuzzyWatchContext`.
Each site here meaningfully impairs observability for real failures:

- `client/.../ClientWorker.java`
  Inside `ClientWorker$ConfigRpcTransportClient#shutdown`, the catch
  for `RpcClient#shutdown` errors only printed the stack to stderr;
  the surrounding routine already uses `LOGGER.info` for the happy
  path of the same loop, so a failed shutdown is the only path that
  silently disappears. Switched to `LOGGER.warn` and included the
  offending rpc client name in the message so operators can correlate
  with the matching `Trying to shutdown rpc client ...` line.

- `common/utils/VersionUtils.java`
  The static initializer reads `nacos-version.txt`. If the resource is
  missing or unparseable, `version` and `clientVersion` silently remain
  unset. Added a class-level slf4j Logger and routed the failure
  through `LOGGER.warn`, including the file name and a hint that the
  version fields will remain unset.

- `core/.../OptionalTlsProtocolNegotiator.java`
  `getDefPne()` uses reflection on `ProtocolNegotiationEvent.DEFAULT`
  and falls back to `null` on failure. The caller stores that null in
  `PortUnificationServerHandler#pne` and later fires it as a user
  event, which can break gRPC TLS negotiation. Logging via slf4j makes
  the reflection failure visible at startup; behavior on the happy
  path is unchanged.

`AbilityKey#static {}` in the `api/` module uses the same pattern, but
that module has no slf4j dependency today. Touching it would change the
SDK's transitive dependency surface, so it is deliberately left out of
this PR — that change should be discussed separately.

The catch blocks are intentionally preserved in all three sites: the
failure modes are recoverable for their callers (continue shutting
down remaining clients / fall back to unset version / return null for
the reflection failure), and the original behavior should not change.

## Brief changelog

- `client/.../ClientWorker.java` — use existing `LOGGER` to log
  `RpcClient#shutdown` failures with the client name
- `common/utils/VersionUtils.java` — add slf4j logger, log
  `nacos-version.txt` load failures
- `core/.../OptionalTlsProtocolNegotiator.java` — add slf4j logger,
  log `ProtocolNegotiationEvent.DEFAULT` reflection failures

## Verifying this change

- `rg -n 'printStackTrace\(\)' client/src/main/java common/src/main/java core/src/main/java` reports no remaining hits in these three files
- `mvn -pl client,common,core -B checkstyle:check apache-rat:check spotless:check -DskipTests` — passes
- `mvn -pl client,common,core -am -B clean compile spotbugs:check -DskipTests` — passes
- Behavior unchanged on the happy paths; only the failure-mode output channel changes (stderr → slf4j)

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).
* [√] Format the pull request title like `[ISSUE #123] ...`. 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 (over 80%) to verify your logic correction. If you are creating a function or feature that affects unit-test files, please go to the `nacos-test` module to run all unit-tests to verify whether they pass.
* [√] Run `mvn -B clean package apache-rat:check checkstyle:check spotbugs:check -DskipTests` to make sure basic checks pass. Run `mvn clean install -DskipTests` to make sure all checks pass.
2026-05-20 18:13:01 +08:00
Guimu 41b7994bf9 Replace printStackTrace() with proper logging in 2 silent-failure paths (#15179)
* Replace printStackTrace with proper logging in 2 silent-failure paths

Both `IoUtils#tryCompress` and `NamingFuzzyWatchContextService#trimFuzzyWatchContext`
catch exceptions and call `Throwable.printStackTrace()`, which writes the stack
trace to stderr instead of going through the configured logging framework.
This bypasses log aggregation / rotation in production deployments and makes
the failures harder to spot or correlate with surrounding events.

The second case is also a classic dangerous pattern — `catch (Throwable t)`
followed by a swallowed stack trace can hide an `OutOfMemoryError` or any
runtime invariant violation behind a single line on stderr.

  - `common/utils/IoUtils#tryCompress`: log via a new class-level slf4j
    Logger with the encoding and original string length attached, so the
    silent-empty-byte[] return path leaves a breadcrumb operators can find.
  - `naming/core/v2/index/NamingFuzzyWatchContextService#trimFuzzyWatchContext`:
    route the swallowed Throwable through `Loggers.SRV_LOG.error(...)`
    (the file already imports `Loggers`); the broad `catch (Throwable)`
    is intentionally preserved so the scheduled task does not die on
    unexpected runtime errors, but the error is now visible.

Behavior is otherwise unchanged. The previous attempt at a similar fix
(PR #14529, for `ClientWorker`) was closed because the author's commit
identity could not be matched to a GitHub user for the CLA, not because
of the direction.

* Correct trimFuzzyWatchContext error log to reflect the scheduled task

Self-review follow-up. The previous commit logged the swallowed
Throwable as `"failed to trim watched-clients context on client release"`,
but `trimFuzzyWatchContext` is the periodic sweep wired up in
`init()` via `scheduleWithFixDelayByCommon(... , 30000)`, not the
client-release path (that flows through `onEvent` →
`removeFuzzyWatchContext`). Operators reading the original phrasing
would chase a non-existent client-release failure. Re-word the
message so it points at the scheduled task it actually runs in.
2026-05-19 20:17:27 +08:00
Guimu b60014b5bd fix(common): use ConcurrentHashMap for fileMd5Map in TlsFileWatcher (#14779)
TlsFileWatcher.fileMd5Map is accessed from both the calling thread
(in addFileChangeListener) and the scheduled executor thread (in the
periodic check task). Using a plain HashMap here is a data race that
can cause missed TLS certificate updates or ConcurrentModificationException
under concurrent access.

Replace HashMap with ConcurrentHashMap to ensure thread-safe reads
and writes to the file MD5 cache.
2026-05-12 15:53:45 +08:00
cxhello 49f645b28a [ISSUE #14815] build(style): align Checkstyle with Spotless and enable spotless:check in CI (#15117)
- Change lineWrappingIndentation from 0 to 4 to match continuation_indentation=1
- Change arrayInitIndent from 8 to 4 to match continuation_indentation_for_array_initializer=1
- Remove all // @formatter:off/on workarounds (no longer needed)
- Re-format modules affected by continuation_indentation_for_array_initializer change
- Add checkstyle:check and spotless:check to CI check step

Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-05-11 10:22:17 +08:00
cxhello 9ae296ba65 [ISSUE #14815] build(style): apply Spotless formatting to common module (#15103)
- Enable toggleOffOn in Spotless config to support @formatter:off/on
- Change continuation_indentation_for_array_initializer from 2 to 1
- Use @formatter:off/on for array initializers that conflict with
  Checkstyle IndentationCheck
- Add Javadoc to methods triggered by MissingJavadocMethod after
  formatting

Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-05-09 17:04:09 +08:00
Guimu b6135c439e fix(common): compare VersionUtils version parts numerically (#14978)
VersionUtils.compareVersion used String::compareTo on each
dot-separated version part, which compares lexicographically:

  compareVersion("1.10.0", "1.9.0") < 0     // should be > 0
  compareVersion("10.0.0", "9.0.0")  < 0    // should be > 0

As soon as any segment of the server version crosses 10, the
comparison starts returning the wrong sign. That directly affects
ConfigChangeClusterSyncRequestHandler.checkCompatity, which uses
compareVersion to decide whether to skip tenant checks for a
newer server version.

Parse each major/minor/patch segment as an int and compare with
Integer.compare instead. Non-numeric segments (e.g. "1.x.0") now
throw IllegalArgumentException, consistent with the method's
documented "x.y.z(-beta)" format. The unused STRING_COMPARATOR
constant and its Comparator/Objects imports are removed because
leaving them violates the project's no-unused-imports rule.
2026-04-24 16:20:47 +08:00
YingHao Wu 1749136f56 fix(common):fix mcpName length validation error message (#14971) 2026-04-24 09:51:02 +08:00
杨翊 SionYang 967f6a50ab Fix prompt get default scope problem (#14919)
* refactor(prompt): replace direct DB calls with AiResourceManager delegation.

* refactor(resource): centralize AiResource persistence calls in AiResourceManager.

* test(http): fix file content write method in file upload test.
2026-04-13 14:25:39 +08:00
杨翊 SionYang d4c85c2951 test(common): add tests to improve line coverage to 96.47% (#14914)
* test(common): add tests to improve line coverage to 96.47%

Add 44 tests covering:
- Base64 encoding/decoding edge cases
- JdkHttpClientRequest file upload and body handling
- TraceEventPublisher queue and exception handling
- AbstractHttpClientFactory SSL configuration
- HttpClientBeanHolder concurrent access
- TaskExecuteWorker queue processing

Line coverage: 95.47% -> 96.47% (+1.00%)
Missing lines: 231 -> 180 (-51 lines)
Tests: 842 -> 907 (+65 tests)

Remaining 180 missing lines are exempt:
- SSL exception handlers
- Static block exceptions
- Native method calls
- Edge case branches

* fix: remove garbage content from JdkHttpClientRequestTest.java
2026-04-13 11:32:41 +08:00
杨翊 SionYang 3fec3ce284 Add unit tests to improve coverage for common utilities (#14902)
* test(common): add unit tests to improve coverage from 93.27% to 95%

- New test classes:
  - BatchTaskCounterTest (6 tests)
  - ByteArrayResponseHandlerTest (3 tests)

- Extended test classes:
  - FuzzyGroupKeyPatternTest (+17 tests)
  - VersionUtilsTest (+14 tests)
  - JdkHttpClientRequestTest (+4 tests)

Total: 44 new test methods
Coverage target: 95% achieved

* test(common): add tests for CollectionUtils and DefaultParamChecker to reach 95% Line coverage

- CollectionUtilsTest: +8 tests for getCardinalityMap, isEqualCollection
- DefaultParamCheckerTest: +8 tests for checkMcpNameFormat, checkAgentNameFormat
- JdkHttpClientRequestTest: simplified SSL tests

Total: 16 new tests, +26 covered lines
Line coverage: 94.29% -> 95.15% 

* fix(common): fix failing tests - all 842 tests now pass

- BatchTaskCounterTest: remove invalid batchSuccess(0) test case
- DefaultParamCheckerTest: use Chinese characters for illegal name test
- FuzzyGroupKeyPatternTest: fix case sensitivity in pattern matching tests

Test results (JDK 17):
- Tests Run: 842
- Failures: 0
- Errors: 0
- Line Coverage: 95.59%
2026-04-10 10:23:06 +08:00
sai 9f2db21907 refactor(ai,common): extract duplicated logic from SkillOperationServiceImpl and AgentSpecOperationServiceImpl into AiResourceManager and VersionUtils (#14822)
* feat(ai): add shared types and AiResourceManager for operation service refactor (phase1 & phase2)

Phase 1 - Extract shared types:
- AiResourceConstants: shared constants (status, version status, labels, retry count)
- ResourceVersionInfo: replaces SkillVersionInfo and AgentSpecVersionInfo inner classes
- PublishPipelineInfo: replaces SkillPublishPipelineInfo and AgentSpecPublishPipelineInfo inner classes

Phase 2 - Add AiResourceManager:
- Generic CAS retry loop (doCasLoop) with CasResult enum
- CAS update methods: updateVersionInfoCas, updateBizTagsCas, metaEnableDisable, bumpMetaDescription, syncImportedMeta
- Query/validation helpers: requireMeta, requireVersionInfo, parseVersionInfo, parsePublishPipelineInfo, ensureReadableOrNotFound, buildQueryCondition, buildEmptyPage, resolveScope
- Version resolution: resolveVersion
- Pipeline callback: onPipelineComplete

* test(ai): add unit tests for AiResourceConstants and AiResourceManager

* refactor(ai,common): extract semver utilities from SkillOperationServiceImpl and AgentSpecOperationServiceImpl into VersionUtils

Move version-related helper methods (normalizeSemver, isSemver, parseSemver,
compareSemverVersion, nextSemverPatch, maxSemver, maxVNumber) from both
SkillOperationServiceImpl and AgentSpecOperationServiceImpl into
common/VersionUtils to eliminate duplication and make them reusable.

* refactor(ai): extract duplicated logic from SkillOperationServiceImpl and AgentSpecOperationServiceImpl into AiResourceManager

- Extract resolveBaseVersion, ensureNoWorkingVersion, buildPageResult,
  deleteResourceWithVersions, runPipelineExecution to AiResourceManager
- Add VersionUtils.isGreaterVersion for unified version comparison
- Inline listExistingVersions calls, remove redundant meta fetch in
  overwriteUploaded*, simplify validateTargetVersion with VersionUtils
- Unify submit pipeline execution and delete flow via shared methods
- Reduce ~900 lines of duplicated code across both service classes

* docs(skills): add npx usage option for nacos-cli in skill registry guide

* feat(common): support pre-release suffix in VersionUtils semver methods (x.y.z-xxx)

Extend semver pattern to accept optional pre-release labels like 0.0.1-beta, 1.0.0-rc.1.
Pre-release versions have lower precedence than the same version without pre-release per semver spec.

🤖 Generated with [Qoder][https://qoder.com]

* fix(console-ui-next): pre-fill existing biz tags and version label bindings when editing

BizTagEditDialog and LabelBindDialog initialised draft state only inside
the onOpenChange callback, which was not triggered when the parent set
`open` to true directly. This caused the edit dialogs to open with empty
tags / unchecked labels, and saving would wipe out existing values.

Replace the onOpenChange-based init with a useEffect keyed on `open` (and
the relevant props) so the draft state is always synchronised when the
dialog becomes visible. Affects both Skill and AgentSpec detail pages.

* test(ai): add unit tests for AgentSpecOperationServiceImpl, SkillOperationServiceImpl, and AiResourceManager

Cover version detail retrieval, delete, search, draft lifecycle, submit,
publish, force-publish, online/offline, label/bizTag updates, scope
changes, and download counting for both Skill and AgentSpec services.
Also add tests for AiResourceManager shared helpers.

* fix(ai): resolve checkstyle violations in ai module tests

- Remove unused imports (HashMap, doAnswer) in AgentSpecOperationServiceImplTest - Fix single-line lambda to multi-line block in SkillOperationServiceImplTest to satisfy LeftCurlyCheck and OneStatementPerLineCheck

* docs(ai): add English inline comments to SkillOperationServiceImpl and AgentSpecOperationServiceImpl

Add step-by-step inline comments inside method bodies to improve code readability,
covering key logic flows such as upload, bootstrap, draft CRUD, submit, publish,
and online status toggling.

* fix(common): resolve SpotBugs NP_BOOLEAN_RETURN_NULL in VersionUtils.isGreaterVersion

- Change return type from Boolean to boolean (primitive) - Return false instead of null for unrecognized version formats - Update caller in SkillOperationServiceImpl to match new primitive return type
2026-04-02 13:32:51 +08:00
sai fd9012ced7 Rename mcp-registry module to ai-registry and separate enable switches (#14797)
* [ai-registry-adaptor] Rename mcp-registry module to ai-registry

* [ai-registry-adaptor] Update unit tests for ai-registry rename

* [bootstrap] Separate mcp/skill registry enable switches and migrate port config

* fix: correct license comment indentation in AbstractNacosRestTemplate
2026-03-31 09:57:47 +08:00
sai a0200d5700 fix(common): add ByteArrayResponseHandler to fix byte[] deserialization in NacosRestTemplate (#14793) 2026-03-30 18:53:17 +08:00
杨翊 SionYang 652232b828 Merge pull request #14756 from alibaba/develop-skill-pipeline
Merge new skill feature into develop branch
2026-03-26 21:23:44 +08:00
杨翊 SionYang 455a9dce5c Fix skill name check (#14740)
* feat(param): add skillName parameter extraction and validation.

* fix(paramcheck): improve ParamCheckerFilter bad request response handling.

* feat(skills): validate skill name format during skill upload.
2026-03-26 15:53:34 +08:00
Guimu a3cd9db0bf fix: fix HttpURLConnection leak on exception in JdkHttpClientRequest (#14727) 2026-03-26 14:56:36 +08:00
shiyiyue1102 17e48d4294 update grpc version to 1.78.0 (#14714)
* update grpc version to 1.78.0

Change-Id: I75ad213dd7c8b32e24897933e8609a066c785a97

* update grpc version to 1.78.0

Change-Id: Ia465e749d70d0116b19ddb0575c1130a4215ce0a

* fix grpc version

Change-Id: I340ce9f43aa4f1f0752244ae52be9420465e2745
2026-03-26 09:32:06 +08:00
cxhello 0f5edfe0bd fix(common): add null check for grpc response in async callback (#14556)
Add null check for @Nullable grpcResponse parameter before passing
to GrpcUtils.parse() to prevent potential NullPointerException.

Remove NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE exclusion
from spotbugs-exclude.xml.

Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-03-05 19:16:22 +08:00
cxhello b0e43ebe2e refactor(common): replace new Random() with ThreadLocalRandom (#14538) (#14539)
Replace all single-use Random instances with ThreadLocalRandom to
avoid unnecessary object creation and improve randomness quality.

Affected modules: common, core, config, client, maintainer-client.
Remove DMI_RANDOM_USED_ONLY_ONCE exclusion from spotbugs-exclude.xml.

Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-03-05 15:16:37 +08:00
cxhello 8a5fb76dc9 refactor(common): remove unused cache package (#14546)
Remove the entire com.alibaba.nacos.common.cache package which has
zero production references. This package was originally created as a
replacement for Guava Cache but was abandoned after bugs were found
and the code was rolled back to Guava.

Also remove the LruCache targeted SpotBugs exclusion from
spotbugs-exclude.xml since the class no longer exists.

Fixes https://github.com/alibaba/nacos/issues/14545

Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-03-05 14:03:05 +08:00
cxhello 8edc805a64 refactor(build): use targeted SpotBugs exclusions instead of @SuppressFBWarnings (#14532)
Replace @SuppressFBWarnings annotations with class-level exclusions in
spotbugs-exclude.xml for LruCache and ApplicationUtils, as suggested
in code review.

Fixes https://github.com/alibaba/nacos/issues/14511

Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-03-04 19:00:07 +08:00
cxhello e46f4f5b27 fix(common): add explicit charset to avoid platform-dependent encoding (#14533) (#14535)
Add explicit StandardCharsets.UTF_8 to all DM_DEFAULT_ENCODING
occurrences reported by SpotBugs under threshold=High, and remove
the global exclusion from spotbugs-exclude.xml.

Affected modules: client-basic, client, common, config, core,
k8s-sync, naming, sys.

Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-03-04 16:52:48 +08:00
codez 0b49892744 Refactor: Remove obsolete p3c-pmd plugin and cleanup annotations (#14455) (#14461) 2026-02-11 13:34:53 +08:00
Lichenkang bb0079e5df refactor(common): remove ineffective ThreadLocal in MD5Utils (#14449)
ThreadLocal was removed in finally, so it never cached MessageDigest; use MessageDigest.getInstance(MD5) per call instead. Related: #14394
2026-02-06 15:31:24 +08:00
杨翊 SionYang b1ab8fb8f4 Add event for agent and mcp endpoint operation (#13996)
* feat(ai): Add tracing for endpoint operation for mcp&agent.

Change-Id: I44864013b9d53224542653e1142d9e8f399a57f3

* feat(tracing): Add tracing event for batch register service instances or batch register agent endpoints.

Change-Id: Ifce43c014de89a29c9c5f773a469ee7bbb68fd20

* feat(tracing): Use BatchRegisterInstanceTraceEvent.

Change-Id: I9ec6250ae2e8ebf882eeed106856094e3ce249ee
2025-12-02 09:28:36 +08:00
Xin Luo c2d4365997 Support merge versions when import mcp (#13945)
* feat: 增加McpCacheIndex支持以优化MCP服务器导入验证

Change-Id: I251ba630d089b824c201b012095be293d49421f8

* Refactor code structure for improved readability and maintainability

Change-Id: I9bfcfecd76478c7e3d334a05d64e0bad964ff55f

* refactor: 替换McpServerIndex为McpServerOperationService以优化服务器验证逻辑

Change-Id: I90b8c0d45a79eb78a689d304d29598a0cd6b4f4a
2025-11-20 10:03:19 +08:00
方圆 65f19905d4 [ISSUE #13922]: add thread poll allow core thread timeout config (#13937) 2025-11-17 10:18:58 +08:00
Eric Wang 24cc2166a0 optimize: update checkStyle version (#13914)
* optimize: update checkStyle version

* optimize: update checkStyle version

* optimize: update checkStyle version

* optimize: update checkStyle version
2025-11-04 13:39:07 +08:00