Skip to main content

Module migrate

Module migrate 

Source
Expand description

The archive-first migration from another release tool.

A migration moves every predecessor file into a workspace under this tool’s state root, lands a clean greenfield instance, and carries what the project still needs from the archive one group at a time. The workspace is the one place a run keeps state across runs: the archived files, the snapshots no Git holds, and registry.yaml, which only the rk migrate verbs write and whose per-item history is the migration’s log. An open migration is visible to every clone through the migration key of the committed configuration.

inventory is the one detector of predecessor files, registry owns the workspace’s record, and git is the scrubbed git these verbs read the repository through.

Modules§

git
The git a migration reads the repository through.
inventory
The one detector of predecessor files.
registry
The migration’s record: registry.yaml in the workspace.

Constants§

MIGRATIONS_DIR
The directory below the state root that holds every workspace.
REFS_DIR
The directory inside a workspace that holds the Git snapshots: the bundle of the long-lived branches and the tag list.
REGISTRY_FILE
The registry file inside a workspace.
SCHEMA
The machine shape every rk migrate report carries.
SOURCES_DIR
The directory inside a workspace that holds the archived files, at their target-relative paths.

Functions§

at
A history time: UTC to the second, %Y-%m-%dT%H:%M:%SZ.
claim
Claim a fresh workspace below runs for a migration opened at stamp, and return its identifier with its path.
free_id
The identifier a claim below runs would take now, read without creating anything: what a preview reports.
is_id
Whether word is a migration identifier.
none_open
The refusal for a target with no open migration.
open_id
The migration the committed configuration names as open, if any.
open_workspace
The workspace of the open migration, where one is open and a state root resolves.
runs
The directory that holds every migration workspace of one target: <state root>/migrations/<repo key>/.
stamp
A migration identifier: the UTC second it opened, %Y%m%dT%H%M%SZ.
workspace
The workspace of migration id at a target, below the state root: <state root>/migrations/<repo key>/<id>/.
workspace_missing
The refusal for an open migration whose workspace this host does not hold: the workspace is local state, and another clone rebuilds it.