Repository navigation
feat(deploy): 部署自动升级 + 撤手动升级入口 + 迁移命名盘点 - #33
Merged
todosdev[bot] merged 1 commit intoNov 19, 2026
Merged
Conversation
- add automated migration step to deploy.yml with verify_version and set assertions - document fleet schema_vN migration naming standard in migrations.ts - remove POST /api/admin/setup route and adminApi.runSetup client call - clean up manual upgrade UI from admin maintenance section and setup page - remove deprecated migration i18n keys and update test suites Checkpoint: R35u49Q9afQEvx_8tyHuw
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.
Summary
5cccf86),把 Caline 的数据库升级从「管理员手动触发」改为deploy.yml部署后自动执行,并做严格迁移账本断言。POST /api/admin/setup、/admin/database升级按钮、setup 页已初始化升级表单),保留 setup 页开关与生效前缀展示。schema_v1,无功能名增量需坍缩;后续命名统一为顺序编号schema_vN。Changes
部署流水线(
.github/workflows/deploy.yml)Run database migrations步骤(与模板 main 逐字一致):verify_version前后双段退避轮询GET /api/public自证边缘版本 ==APP_VERSION;POST /api/setup(无重试,免触 429 限流);worker/src/lib/migrations.ts派生迁移集合,与响应做严格双向集合相等断言(success === true、status ∈ {applied, skipped}、无重复、无缺/多)。迁移定义(
worker/src/lib/migrations.ts)schema_vN、基线恒schema_v1、新增递增编号、取代功能名式。后端(
worker/src/routes/admin.ts)POST /api/admin/setup端点与runSetup导入;保留部署/初始化所需的POST /api/setup、GET /api/setup/state、POST /api/setup/owner。前端(
web/src/)admin/maintenance-section.tsx:删升级按钮、run()、结果回显块,保留 setup 页开关与生效前缀展示。setup.tsx:删已初始化升级表单与密钥框,只留未初始化表单 + 已初始化关闭提示。lib/api.ts:删adminApi.runSetup、AdminSetupResult、未用的MigrationResult导入。locales/{zh,en}.json:删废弃的setup.upgradeSubtitle/submitUpgrade与admin.maintenance.{run,running,done,migrations,applied,skipped}。文档与测试
README.md:更新为「部署自动升级」,移除手动点击升级描述。worker/test/setup.test.ts、admin-users.test.ts、single-mode.test.ts、web/src/pages/setup.test.tsx、admin.test.tsx、App.test.tsx中针对已删端点/按钮的用例;applied路径(新库首次迁移)与skipped路径(重复迁移)实证均保留在worker/test/setup.test.ts。Testing
pnpm lint、pnpm format:check、pnpm typecheck、pnpm check:identity、pnpm build:client && pnpm test(worker 254 + web 169 + shared 13 + client 35)、pnpm check:deploy(wrangler dry-run)。EXPECTED_MIGRATIONS动态导入实测返回["schema_v1"];严格集合断言对缺/多/重复/非法状态均正确拦截。ci.ymlValidate 已全绿(run #82)。deploy.yml(含迁移步实测)——deploy.yml仅由push main/workflow_dispatch触发,PR 不触发,需合并后由 push 兑现。