feat: add schema version gating to wl sync#22
Open
fkautz wants to merge 1 commit intogastownhall:mainfrom
Open
feat: add schema version gating to wl sync#22fkautz wants to merge 1 commit intogastownhall:mainfrom
fkautz wants to merge 1 commit intogastownhall:mainfrom
Conversation
Compare local and upstream _meta.schema_version before pulling: - MINOR bumps (e.g. 1.1 → 1.2) auto-apply with a log message - MAJOR bumps (e.g. 1.x → 2.x) block unless --upgrade is passed - --dry-run warns about major bumps but still shows the diff - Missing or corrupt versions degrade gracefully (sync proceeds) Closes w-wl-004. Co-Authored-By: Claude Opus 4.6 <[email protected]>
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
_meta.schema_versionbefore pulling duringwl sync--upgradeis passed--dry-runwarns about major bumps but still shows the diff (doesn't block)Closes w-wl-004.
Changes
internal/commons/schema.gointernal/commons/schema_test.gocmd/wl/cmd_sync.go--upgradeflag,checkSchemaVersion()with dry-run awarenesstest/integration/offline/sync_test.gotest/integration/commons_test.goREADME.md--upgradeflag and schema version gatingTest plan
go vet -tags integrationcleanTestSyncSameVersion— no schema message when versions matchTestSyncLocalAhead— warns when local is aheadTestSyncMinorVersionBump— auto-applies with messageTestSyncMajorVersionBlocked— errors without--upgradeTestSyncMajorVersionWithUpgrade— succeeds with--upgradeTestSyncDryRunMajorVersion— warns but doesn't blockTestSyncMissingSchemaVersion— graceful degradationTestSyncCorruptSchemaVersion— doesn't crash on garbage🤖 Generated with Claude Code