-
Notifications
You must be signed in to change notification settings - Fork 15
Update merge mode schema and types with backwards-compatible transform #850
Description
Summary
Replace provider-specific merge mode enum values with generic ones and add a schema-level transform for backwards compatibility.
Context
Part of #842 — decoupling merge strategy from VCS provider. The mergeBehavior.mode setting currently uses provider-specific values (github-pr, github-draft-pr, bitbucket-pr) which create a combinatorial explosion as providers are added. This issue establishes the new canonical values that all other child issues consume.
Base branch: This work builds on top of the BitBucket integration branch (PR #609), which has bitbucket-pr already in the enum.
Acceptance Criteria
mergeBehavior.modeaccepts onlylocal,pr, ordraft-pras canonical output values- Old values (
github-pr,github-draft-pr,bitbucket-pr) are accepted at parse time and automatically mapped to their generic equivalents via schema-level transform - The transform applies to both schema definitions (the one with defaults and the one without)
- Schema
.describe()text references the new generic mode names - Telemetry event type for
merge_behaviorreflects the new canonical values - Existing settings files on disk with old values continue to work without manual edits — the transform handles them transparently at load time
Shared Contracts
Produces:
mergeBehavior.modecanonical output values:'local' | 'pr' | 'draft-pr'- Schema accepts old values and transforms:
github-pr→pr,github-draft-pr→draft-pr,bitbucket-pr→pr LoomFinishedProperties.merge_behaviortype:'local' | 'pr' | 'draft-pr'
Note on telemetry continuity: After this change, analytics will receive 'pr' and 'draft-pr' instead of 'github-pr' and 'github-draft-pr'. Dashboards or queries filtering on the old values will need updating.
Scope Boundaries
- Does NOT update consumers of the mode value (other child issues handle that)
- Does NOT add a file-rewriting migration — the schema transform handles backwards compatibility at runtime
- Does NOT update code comments in files that aren't otherwise modified
Must-Haves
- substantive: src/lib/SettingsManager.ts — both Zod schemas define mode with canonical values
['local', 'pr', 'draft-pr']and a transform accepting old values - substantive: src/types/telemetry.ts —
merge_behaviortype is'local' | 'pr' | 'draft-pr'
Metadata
Metadata
Assignees
Labels
Type
Projects
Status