Migrating from version 1

Version 1 manifests keep working, so there's no need to migrate all at once: move one manifest at a time, and keep the others as they are. Manifests v2 is a preview until comtrya 0.13.0.

comtrya manifests upgrade <manifest> does the steps below for you and checks that both versions mean the same; it refuses what it can't rewrite safely, see Commands. To do it by hand:

  1. Add version: 2 at the top. Switch the editor hint to # yaml-language-server: $schema=https://comtrya.dev/schema-v2.json, so the editor shows what's left.
  2. Go through the table below.
  3. Check with comtrya apply -m <manifest> --dry-run.
Version 1Version 2Why
An alias, like cmd.run, dir.create, source/target or sudoThe one name: command.run, directory.create, from/to, privileged (the whole list)One way to write each thing
path: {{ user.home_dir }}/bin (unquoted)path: "{{ user.home_dir }}/bin"The file is parsed before templates are rendered, so it has to be valid YAML as it is
{% if os.name == "linux" %} around actions or keyswhere: os.name == "linux" on the action, or a variantTemplates are rendered per value; {% if %} still works inside a value
{% for %} that writes actionsOne action with a list, like list: on package.install, or one action eachTemplates can't write keys or actions
chmod: {{ variables.mode }}chmod: "{{ variables.mode }}"A value that is one template still becomes a number
A variant that repeats every field of its actionA variant with only the fields that differVariants take the rest from their action
files/zshrc next to zsh.yaml, from: zshrczshrc next to zsh.yaml, from: ./zshrcFiles next to the manifest; a plain name still looks in files/
An app's YAML config inside files/ to keep it from being read as a manifestNext to the manifest, listed in ignoreOnly needed once files leave files/
command.run writing a file that a later command.run reads backregister on the first, {{ registered.<name>.stdout }} in the later oneregister

where conditions don't change: they were Rhai before and stay Rhai. In version 1 they were also rendered as templates along with the whole file; in version 2 they aren't, so a where with {{ … }} in it has to read the context directly, like user.name == "ada".

Other fields, contexts, depends, labels and the actions themselves are the same in both versions.