Summary
Introduce a schemaVersion field to .semrel.yaml and a semrel migrate command that automatically upgrades the config file to the current schema version when breaking changes are made.
Motivation
As semrel matures, the .semrel.yaml schema will change: fields get renamed, new required keys are added, plugin args format changes. Without a migration path, every schema change is a silent breaking change that only manifests as a confusing runtime error.
Proposed design
1. Schema version in config
schemaVersion: 1 # added automatically by semrel config init / semrel migrate
tagPrefix: "v"
branches:
- name: main
plugins:
- uses: analyzer-conventional
When schemaVersion is absent, semrel assumes v1 (current) and adds it on the next semrel migrate run.
2. semrel migrate command
$ semrel migrate
Detected .semrel.yaml at schema version 1
Current schema version: 2
Changes:
[renamed] plugins[*].path → plugins[*].binary
[added] plugins[*].phase (default: "release")
? Apply migration? [Y/n/diff]
> Y
✔ .semrel.yaml migrated to schema version 2
Backup written to .semrel.yaml.bak
3. Auto-migration check on startup
When semrel detects that schemaVersion in the config is lower than the running binary expects, it:
- Prints a warning with the migration command
- In CI (no TTY), exits non-zero if the gap is more than one major schema version
4. Migration registry
Each schema change is captured as a named migration in internal/config/migrations/:
v1_to_v2.go — rename path→binary, add phase default
v2_to_v3.go — ...
Acceptance criteria
Related
This issue tracks the core migration framework. Each plugin maintains its own SEMREL_PLUGIN_* env-var schema version and migration notes — see the individual plugin issues linked below.
Summary
Introduce a
schemaVersionfield to.semrel.yamland asemrel migratecommand that automatically upgrades the config file to the current schema version when breaking changes are made.Motivation
As semrel matures, the
.semrel.yamlschema will change: fields get renamed, new required keys are added, pluginargsformat changes. Without a migration path, every schema change is a silent breaking change that only manifests as a confusing runtime error.Proposed design
1. Schema version in config
When
schemaVersionis absent, semrel assumesv1(current) and adds it on the nextsemrel migraterun.2.
semrel migratecommand3. Auto-migration check on startup
When semrel detects that
schemaVersionin the config is lower than the running binary expects, it:4. Migration registry
Each schema change is captured as a named migration in
internal/config/migrations/:Acceptance criteria
schemaVersionfield added to config struct and schemasemrel migratecommand implemented with dry-run (--dry-run) and backup (--backup, default true)Related
This issue tracks the core migration framework. Each plugin maintains its own
SEMREL_PLUGIN_*env-var schema version and migration notes — see the individual plugin issues linked below.