Carrying a project forward
A descriptor states the version of the description model it is written in, model. It is not the
application's version: it is the version of the vocabulary. A tool asked to update a document has to know
what it is updating from, and a host asked to accept an older one has to be able to say which.
yoke-compose migrate [--to <model>]
It is explicit and never automatic. Nothing upgrades a project when it is opened or built: a migration is a dated, reviewable change to the project like any other, one diff and one review.
The chain
A migration is one step per consecutive model, applied in order. --to names the target and defaults
to the newest model this composer implements; three versions apart is three steps.
- A step changes how the application is written, and never what it is: a field renamed, a default moved, one field becoming two.
- What a step cannot carry mechanically, it names. Where a later model asks for a statement only the author can make, the place and what has to be decided there are reported, and the project is left unchanged.
- The result is validated against the target model before it is kept. A refusal at or beneath a field a step changed is a defect in the step, and the project stays as it was; what the gate finds elsewhere is the project's business, as for any verb.
migrate refuses | |
|---|---|
| a descriptor stating no model | there is nothing to carry it from |
| a descriptor at a model later than the newest this composer implements | |
| a descriptor at a model no step carries from | |
a --to beyond the newest model | |
a --to behind the descriptor's model | a migration only carries forward |
A descriptor already at the target is left as it is. With one model, as now, the chain has no steps:
migrate says the project is already there and writes nothing.
What it reports
changed core: >=0.5 -> (absent)
changed engine: (absent) -> >=0.5
changed model: 1 -> 2
carried the project from model 1 to 2
One line per field changed, with its path, its old value and its new one, (absent) for a field that
was not there or is no longer; then one line per place left, left <path>: <what has to be decided>.
| the descriptor | rewritten against the target model, model set to it |
advisories.yaml, blocks.yaml | untouched: neither is written against a model |
| a package | not built. Migrating and building are two acts, and a package carries the model its descriptor states |
A block of an older model is refused at placement rather than migrated. Carry it forward in the project that owns it, with the same verb.