config: enforce the .profiles 'version' key — reject unsupported versions, add a migration hook

Aperta
#151 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start with schema.py:211 and trace how collect_config_issues surfaces validation errors in the editor Problems panel. The issue proposes rejecting unsupported versions and a migration registry, but leaves the migration behavior and scope to decide. Done means unsupported versions produce a clear reported error and the intended migration path is defined and handled.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Idea

version is parsed (schema.py:211, version: int = 1) and the starter template ships version: 1, but nothing enforces it: verified — AppConfigYaml.model_validate({'version': 999}) succeeds and parses as v1. No reader anywhere in src/ consults the field.

Suggested implementation

  1. Gate it now: a model_validator rejecting unsupported versions with a clear message — unsupported config version 999 (this build supports 1) — surfaced through collect_config_issues so the editor Problems panel shows it.
  2. Longer term: a small migration registry applied before validation, MIGRATIONS: dict[int, Callable[[dict], dict]], walking version → version+1 until current. This is what makes future config-format changes (and the #145 semantics decisions) shippable without breaking old files.

Fits the domain: ProFiles configs live on shared drives and outlive app versions.

Lingua principale
Python
Stelle
1
Fork
1
Merge medio
4h 46m
PR unite (30g)
55

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di falbany/ProFiles

Tutte le issue di falbany/ProFiles

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.