Skip to content

feat: config schema versioning and migration support #17

@mwaldheim

Description

@mwaldheim

Summary

Document the current SEMREL_PLUGIN_* configuration schema for this plugin with a formal version number, and implement a migration guide (and tooling where applicable) so users can safely upgrade when the schema changes.

Background

As part of the semrel-wide config migration initiative (SemRels/semrel#195), every plugin needs to:

  1. Declare a schema version for its SEMREL_PLUGIN_* env-var contract
  2. Publish a JSON Schema to the semrel registry (SemRels/semrel-registry#11) so editors can validate plugin config inline
  3. Document breaking changes with a migration guide in CHANGELOG.md and the README whenever env-var names change, new required vars are added, or semantics change
  4. Provide a migration snippet (or semrel migrate hook) for each breaking change

Tasks

  • Audit current SEMREL_PLUGIN_* env vars and their types / defaults — this is schema v1
  • Write JSON Schema describing all env vars for schema v1 and open a PR to publish it to the registry
  • Add PLUGIN_SCHEMA_VERSION=1 to the plugin binary output (stdout structured field or log line) so semrel core can detect mismatches
  • Process: for every future breaking change to the env-var contract, bump the schema version and add a migration entry to CHANGELOG.md

Example schema (JSON Schema draft 2020-12)

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://registry.semrel.io/schemas/plugins/updater-python/v1.json",
  "title": "updater-python plugin configuration",
  "type": "object",
  "properties": {
    "SEMREL_PLUGIN_EXAMPLE_VAR": {
      "type": "string",
      "description": "Example variable — replace with actual vars for this plugin.",
      "default": ""
    }
  }
}

Acceptance criteria

  • JSON Schema for current env vars written and reviewed
  • Schema published to registry (see semrel-registry#11)
  • README has a $schema URL example for editor support
  • CHANGELOG updated with "Schema v1 baseline" entry
  • Future breaking env-var changes bump schema version and include migration notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions