pilichoumao opened a new pull request, #6279:
URL: https://github.com/apache/rocketmq-dashboard/pull/6279
### Which Issue(s) This PR Fixes
- Fixes #6278
### Brief Description
Saving general settings with a previously loaded snapshot can restore an old
AI model after an AI save. Conversely, an AI save can restore old preferences
or notification settings when a general save completes between its read and
write.
Add an optional `preserveLlmConfig` request flag, enabled by the console
general-settings form, to retain the current server-side AI fields, including
the API key and clear intent. Requests that omit the flag or set it to false
retain the existing full-update contract and required-field validation. AI
saves now read, validate, merge and persist through the same synchronized
SettingsService update boundary, preserving all non-AI fields and existing key
inheritance/environment-token behavior. The request flag is neither stored nor
returned. No schema or dependency changes.
The synchronization applies within one service process; this does not add
cross-instance conflict detection. Legacy full-update callers can still
intentionally replace AI fields. The API documentation explains these
boundaries.
### How Did You Test This Change?
- Added deterministic regressions for both overwrite orders: both failed
before the production fix and pass afterward. Additional coverage verifies all
AI fields and stale key-clear intent, MVC flag routing, and frontend request
construction.
- Added real Spring/H2 persistence tests for both forms sharing one stored
settings JSON, API-key clearing, and legacy full-update compatibility.
- Backend (Java 21, isolated cache containing official RocketMQ artifacts):
```bash
mvn -B -ntp -f server/pom.xml
-Dmaven.repo.local=/tmp/rocketmq-cloud-schema-m2-20261011
-Dspring.profiles.active=dev test
```
3441 tests, 0 failures, 0 errors, 3 skipped; Checkstyle and architecture
checks pass. The focused settings/LLM suite also passes all 104 tests. Local
persistence validation uses H2; CI's existing MySQL job remains the MySQL
verification.
- Frontend:
```bash
cd web
npm ci
npm test -- --maxWorkers=2
npm run lint
npm run license:test
npm run build
```
153 test files / 1518 tests pass; lint, 5 license tests, TypeScript,
production build and license check pass.
- `mvn -B -ntp -f server/pom.xml
-Dmaven.repo.local=/tmp/rocketmq-cloud-schema-m2-20261011 package -DskipTests`
reaches the existing binary-license gate and fails for 164 missing dependency
LICENSE/COPYING files. Repeating it against the exact unmodified base
`5e4c39b053c35a5598cc79ff331b8a54e649d7b1` produces the identical 164-item
failure list. Packaging is therefore not reported as passing. The first local
full test attempt without the dev profile failed because the local MySQL
credentials do not match; the complete dev-profile run above passes.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits
- [x] Tests added or updated; new Java test methods named `...Test`
- [x] No new UI text requiring translation
- [x] Architecture constraints stay green
- [x] New source files carry the ASF license header
- [x] Documentation updated for the request contract and concurrency boundary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]