Skip to main content

Module migrate

Module migrate 

Source
Expand description

faucet migrate — upgrade a config written against an older faucet grammar to the current shape (#388).

Each migration is a pure serde_json::Value → serde_json::Value transform with a before/after unit test. The command reads a config, applies every rule, and (unless --check) rewrites it in place, printing which rules fired. Migrations are idempotent: running migrate on an already-current config changes nothing and exits 0.

Two rules ship today:

  1. Top-level source: / sink:pipeline.source / pipeline.sink (the pre-#54 shape). If the document has top-level source/sink keys and no pipeline, they move under a new pipeline: map.
  2. Legacy auth → adjacently-tagged { type, config } (the pre-#113 shape). Any auth: / credentials: object carrying a type string plus sibling fields but no config has those siblings folded into config.

Comments are not preserved (the config is parsed and re-serialized) — the same limitation faucet fmt documents.

Functions§

run
Execute the migrate subcommand.