chstercc opened a new pull request, #5657:
URL: https://github.com/apache/rocketmq-dashboard/pull/5657
<!-- Make sure the base branch is `rocketmq-studio`: that is the RocketMQ
Studio trunk. -->
### Which Issue(s) This PR Fixes
<!-- Link the issue with a keyword so it closes on merge. Trivial fixes need
no issue.
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->
- Fixes #4034
### Brief Description
<!-- What changes and why. Keep it short — the diff already shows how. -->
Add direct regression coverage for the agent engine store's default
selection, persistence and restoration of all three supported engines, and
migration of version-zero preferences back to `claude-code`.
The tests assert the persisted state and schema version, then reload the
module to verify that a fresh store restores the saved preference. Migration
covers both a previously supported engine and an obsolete engine name,
including the rewritten storage and a subsequent reload.
Only `web/src/stores/engineStore.test.ts` is added; no runtime code,
dependencies, lockfiles, or CI changes are included. Existing store tests are
preserved.
Earlier PR #5173 was closed without being merged by the inactivity workflow.
AI assistance was used for this change. The diff was reviewed and the checks
below were executed.
### How Did You Test This Change?
<!-- Paste the commands you ran and what they printed. Typical verification:
backend `cd server && mvn -B -ntp test` (integration tests need
MySQL 8, see CONTRIBUTING.md)
frontend `cd web && npm test && npm run lint && npm run build`
A pull request with no verification will not be merged. -->
Validated in a fresh worktree based on upstream `rocketmq-studio`.
In `web`, using Windows Node:
- `node node_modules/vitest/vitest.mjs run src/stores/engineStore.test.ts
src/stores/dataModeStore.test.ts`: 2 test files passed, 10 tests passed (6 new
engine-store tests and 4 existing data-mode tests); exit code 0.
- `node node_modules/typescript/bin/tsc -b`: no output; exit code 0.
- `node node_modules/eslint/bin/eslint.js src/stores/engineStore.test.ts`:
no output; exit code 0.
- `node node_modules/prettier/bin/prettier.cjs --check
src/stores/engineStore.test.ts`: formatting check passed; exit code 0.
- Mutation check: temporarily replaced the migration's engine reset with an
identity migration. Both version-zero migration cases failed with assertion
errors. The original source was restored byte-for-byte, and all 10 focused
tests passed again.
At the repository root:
- `git diff --check upstream/rocketmq-studio...HEAD`: no output; exit code 0.
- `git diff --stat upstream/rocketmq-studio...HEAD`: only
`web/src/stores/engineStore.test.ts`, with 78 insertions.
The pre-commit ESLint and Prettier checks passed. Full test suites,
production builds, and backend architecture checks were not run.
The new test file carries the ASF license header. UI translations and
behavior documentation updates are not applicable to this test-only change.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` /
`refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [x] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
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]