release_kit/cli/adopt.rs
1//! Arguments for `rk adopt`.
2
3use camino::Utf8PathBuf;
4use clap::Args;
5
6/// Write the landing record for a repository that already runs the
7/// convention, landed before the record existed.
8///
9/// Strict: every rendered file must match what this payload would
10/// render, and no target file is ever changed.
11#[derive(Debug, Args)]
12pub struct AdoptArgs {
13 /// The repository to adopt.
14 #[arg(long, default_value = ".")]
15 pub target: Utf8PathBuf,
16
17 /// The technology whose payload the target runs. Defaults to
18 /// detection from the version file.
19 #[arg(long)]
20 pub tech: Option<String>,
21
22 /// The forge whose payload the target runs: github or gitlab.
23 /// Defaults to detection from the target's git remote.
24 #[arg(long)]
25 pub forge: Option<String>,
26
27 /// The project path on the forge, the parameter the candidate is
28 /// rendered under. Defaults to detection from the target's git
29 /// remote.
30 #[arg(long)]
31 pub repo: Option<String>,
32
33 /// The working-copy mode the candidate is rendered under: worktree or
34 /// branches. It chooses which candidate adoption verifies against and
35 /// never blesses the disk; the default is branches, the
36 /// compatibility-safe reading of a pre-record target.
37 #[arg(long, default_value = "branches")]
38 pub workflow: String,
39
40 /// The release style the candidate is rendered under: trunk or lines.
41 /// Required: the style changes the release workflow's bytes, and an
42 /// adoption verifies bytes against exactly one rendered candidate, so
43 /// neither value is a safe guess.
44 #[arg(long)]
45 pub style: Option<String>,
46
47 /// The target runs the Nix capability: the candidate includes its
48 /// files, and the record carries the parameter. A target whose flake
49 /// pair is its own is verified without the pair and the workflow,
50 /// exactly as a landing would have withheld them.
51 #[arg(long)]
52 pub nix: bool,
53
54 /// Write the record; without it the verification runs and nothing is
55 /// touched.
56 #[arg(long)]
57 pub apply: bool,
58
59 /// Emit one JSON object on stdout instead of the human report.
60 #[arg(long)]
61 pub json: bool,
62}