Repository navigation
feat(migrations): freeze cumulative schema drafts at release - #2713
Conversation
…hema-migration # Conflicts: # release/upgrade-support.json
AlexStocks
left a comment
There was a problem hiding this comment.
审查了 5ce729af。本地跑过:schema_release.py check exit 0、check --release exit 0、check --base-ref f6eed7d0 exit 0,pytest tests/test_schema_release.py tests/test_schema_draft.py 33 passed,upgrade_release_gate.py exit 0;preserve_history 用变异测试验证过有效(往 v1_5_0_005_plugin_interfaces.py 追加内容 → 报 Frozen migration resources changed: server/v1_5_0_005、exit 1),check_release_wheel 也确实接在了 run_upgrade_release_gate.py 与 upgrade_release_gate.py 两处。整体方向没问题。
下面一条是门禁本身的 fail-open 缺口。另外提请作者注意:本 PR 当前 mergeable = dirty(与 master 有冲突),CI 的 CI result / script-installation / installation (macos-latest) 还是红的,需要先解决冲突再重跑一次。
…hema-migration # Conflicts: # docs/en/docs/operate/database-migrations.md # docs/zh/docs/operate/database-migrations.md # release/upgrade-support.json
|
Post-merge validation note for e0bf754: the empty-baseline and native-checkpoint findings are fixed, but the final-head Main run is not green. The vector upgrade job failed while uploading evidence ( |
Which issue or RFC does this PR close?
Refs #2673, #2692 and RFC #1771.
Rationale for this change
Schema-changing PRs contribute to one shared unpublished
000migration. Each merged result is validated before release preparation freezes that cumulative migration asv<major>_<minor>_<patch>. This avoids assigning a new revision per PR and avoids assembling independent SQL files at publication time.Only supported released-version upgrades are promised. Development databases and recovery plans created by mutable
000must be rebuilt when it changes or freezes; no development-to-release compatibility bridge or stamp operation is provided.What changes are included in this PR?
make schema-check,make schema-freeze VERSION=X.Y.Z, andmake schema-release-check.vX_Y_Znames while preserving legacy sequence names and PR-based names.000has no software version; both draft and frozen cumulative names have a null sequence.Are there any user-facing changes?
New schema work uses
server_resources/versions/000.pyand the corresponding native entry plus registered snapshots, data tasks and recovery resources. Aftermake version-bump VERSION=X.Y.Z, the release PR runsmake schema-freeze VERSION=X.Y.Z, reviews compatibility and release notes, and validates the final artifacts.Existing production scripts, frozen resources, database IDs and plans are unchanged; the current registered Server head remains
v1_5_2_pr2639, followingv1_5_0_005. This PR adds no empty production draft because it introduces no storage change. Development upgrades between different contents of000are explicitly unsupported.GitHub required-check and up-to-date-branch/merge-queue settings must be configured by repository administrators; this PR does not change branch protection. Existing PR installed-release acceptance selects SQLite; native acceptance remains scheduled/manual and release-gated.
Transition and merge coordination
This policy can merge before an open schema PR such as #2674. After updating against master containing this policy, that PR must fold its unpublished
v1_5_2_pr2674changes into the existing shared000, or create000after the latest frozen head if absent. Keep only changes not already in master, reconcile SQL order and dependencies, replace the superseded unpublished SQLite/native entries, and update resource names, manifests, fingerprints, checkpoints, domain tasks and source/vector/Code registrations together. Rebuild development databases and plans created from the unpublished revision, then run baseline comparison, migration tests and selected upgrade acceptance on the merged result before merging.Legacy revisions already in the master baseline, including
v1_5_2_pr2639, retain their IDs, resources and dependencies. If a legacy revision was merged before policy adoption, it is protected baseline history. Published revisions must never be renamed to000. PR opening dates grant no exemption: the gate continues to accept only the shared draft or its release-frozen identity as new revisions. No merge-first requirement or revision-name allowlist is introduced. AGENTS.md and both migration guides document this transition; release PRs freeze the cumulative draft normally.How was this change tested?
uv run --locked pytest tests/test_release_version.py tests/test_schema_release.py tests/test_schema_draft.py -q— 50 passed.uv run --locked prek run --files AGENTS.md docs/en/docs/operate/database-migrations.md docs/zh/docs/operate/database-migrations.md— passed, including type checks.node --test desktop/scripts/prepare-openapi-generator.test.mjs— 8 passed, including primary 404/429 fallback, checksum rejection and cleanup when both endpoints fail.uv run --locked pytest tests/e2e/test_statistics_flow.py tests/builtin/runtime/test_model_usage_recorder.py -q— 42 passed, 2 skipped.git diff --check— passed.0ca58ec14, including all Python test versions, website checks and selected SQLite installed-release upgrade acceptance. CI for the current head, including the generator download fallback and statistics acceptance budget, is tracked on this PR.Regression coverage executes real SQLite SQL before and after freezing, preserves historical rows and literal
000defaults, validates source overlays and native checkpoint registrations, rejects historical resource changes and collisions, rejects mutable drafts in wheels, rejects empty baseline arguments, and exercises reuse of000in the next development cycle. Native layout checks verify registration consistency; they do not establish live seekDB/OceanBase upgrade acceptance. Branch protection still requires repository administration.AI usage statement
OpenAI Codex assisted with implementation, documentation, regression tests and local review. Executed checks and remaining validation limits are listed above.