fix: add ChatUIProject & SessionProjectRelation to shared constants & test cases#7414
Conversation
There was a problem hiding this comment.
Code Review
This pull request integrates ChatUIProject and SessionProjectRelation into the backup system by updating the core constants and the associated test suite. The review feedback identifies an opportunity to improve test coverage by including several other missing tables in the expected_tables list to ensure all models defined in the backup process are correctly tracked.
| "chatui_projects", | ||
| "session_project_relations", |
There was a problem hiding this comment.
While adding chatui_projects and session_project_relations is correct, the expected_tables list is still missing several other tables that are currently defined in MAIN_DB_MODELS (specifically persona_folders, platform_message_history, platform_sessions, command_configs, and command_conflicts). To ensure the test provides full coverage and correctly tracks all models included in the backup process, it is recommended to include all keys from MAIN_DB_MODELS in this list.
"persona_folders",
"platform_message_history",
"platform_sessions",
"chatui_projects",
"session_project_relations",
"command_configs",
"command_conflicts",
Will fix #7376
Modifications / 改动点
This PR fixes a backup/restore issue where WebChat project data was not included in the shared backup model registry.
Core changes:
Added chatui_projects and session_project_relations to the backup model mapping in astrbot/core/backup/constants.py
Updated backup-related test expectations in tests/test_backup.py
As a result, WebChat projects and their session relationships can now be exported and restored correctly.
Screenshots or Test Results / 运行截图或测试结果
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Ensure WebChat project data is included in the shared backup/restore model registry.
Bug Fixes:
Tests: