fix(seeder): 统一数据初始化幂等性,使用 DB 标记替代文件标记#348
Open
xingyipeng wants to merge 1 commit intodataelement:mainfrom
Open
fix(seeder): 统一数据初始化幂等性,使用 DB 标记替代文件标记#348xingyipeng wants to merge 1 commit intodataelement:mainfrom
xingyipeng wants to merge 1 commit intodataelement:mainfrom
Conversation
问题: - agent_seeder 使用 .seeded 文件标记判断是否已初始化,换环境/连远程 DB 时标记丢失导致重复创建 - template/tool/skill seeder 每次启动都会重建被用户删除的数据 修复: - 4 个 seeder 统一使用 system_settings 表的 DB 标记(跟随数据库,跨环境有效) - 幂等三重检查:DB 标记 → DB 数据存在性 → 首次创建 - 用户删除数据后不再重建(标记存在即跳过) - seed_atlassian_rovo_config 同步加入 DB 标记保护 - push_default_skills_to_existing_agents 在技能未变化时跳过文件扫描 - 更新 ALEMBIC_GUIDELINES.md 补充数据初始化规范 涉及的 DB 标记 key: - builtin_tools_seeded - builtin_templates_seeded - builtin_skills_seeded - default_agents_seeded - atlassian_rovo_config_seeded
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.
问题
agent_seeder使用.seeded文件标记判断是否已初始化,换环境或连接远程数据库时标记丢失导致重复创建默认 Agenttemplate_seeder/tool_seeder/skill_seeder每次启动都会重建被用户手动删除的数据,不尊重用户操作修复方案
4 个 Seeder 统一使用
system_settings表的 DB 标记,替代文件标记:builtin_tools_seededatlassian_rovo_config_seededbuiltin_templates_seededbuiltin_skills_seededdefault_agents_seeded幂等三重检查逻辑
其他改进
seed_atlassian_rovo_config()同步加入 DB 标记保护push_default_skills_to_existing_agents()在技能未变化时跳过文件系统扫描,减少无意义 I/OALEMBIC_GUIDELINES.md补充数据初始化(Seeder)规范章节,约束团队后续开发测试方式
system_settings表中写入了 5 个*_seeded标记DELETE FROM agent_templates WHERE is_builtin = true)→ 重启 → 确认不会重建DELETE FROM system_settings WHERE key = 'builtin_templates_seeded')→ 重启 → 确认会重新创建