pub struct Ctx {
pub target: Utf8PathBuf,
pub repo: String,
pub forge: Forge,
pub host: Option<String>,
pub required_check: Option<String>,
pub cli: PathBuf,
pub tech: Option<&'static str>,
/* private fields */
}Expand description
One resolved run context.
Fields§
§target: Utf8PathBufThe repository being set up.
repo: StringThe project path on the forge.
forge: ForgeThe forge the run acts on.
host: Option<String>The remote host, where one was detected.
required_check: Option<String>The value of --required-check, where given.
cli: PathBufThe resolved forge CLI binary.
tech: Option<&'static str>The detected technology, where the version file names one.
Implementations§
Source§impl Ctx
impl Ctx
Sourcepub fn resolve(
target: &Utf8PathBuf,
repo_flag: Option<&str>,
forge_flag: Option<&str>,
required_check: Option<&str>,
) -> Result<Self, RkError>
pub fn resolve( target: &Utf8PathBuf, repo_flag: Option<&str>, forge_flag: Option<&str>, required_check: Option<&str>, ) -> Result<Self, RkError>
Resolve detection, overrides, and the forge CLI in one pass, before any step runs.
§Errors
Refuses when the target is missing, when no remote resolves and no
override covers the gap, when the host is unrecognized, and when the
forge CLI is not on PATH.
Sourcepub fn line_prefix(&self) -> &str
pub fn line_prefix(&self) -> &str
The release-line prefix this run asserts.
Sourcepub fn retired_branches(&self) -> &[String]
pub fn retired_branches(&self) -> &[String]
The long-lived branches this run’s single-trunk step retires.
Sourcepub const fn release_lines(&self) -> bool
pub const fn release_lines(&self) -> bool
Whether a full apply runs the release-line protection.
Sourcepub fn bot_app_id(&self) -> Option<&str>
pub fn bot_app_id(&self) -> Option<&str>
The bot App’s public identifier this target states, where it does.
Sourcepub fn trunk_ruleset(&self) -> &str
pub fn trunk_ruleset(&self) -> &str
The ruleset that protects the trunk.
Sourcepub fn tag_ruleset(&self) -> &str
pub fn tag_ruleset(&self) -> &str
The ruleset that makes published tags immutable.
Sourcepub fn lines_ruleset(&self) -> &str
pub fn lines_ruleset(&self) -> &str
The ruleset that protects the release lines.
Sourcepub fn title_check(&self) -> &str
pub fn title_check(&self) -> &str
The context the landed title job reports under.
Sourcepub fn self_hosted_gitlab(&self) -> bool
pub fn self_hosted_gitlab(&self) -> bool
Whether this run targets a GitLab instance that is not gitlab.com, where registry trusted publishing cannot reach.
Sourcepub fn child_env(&self, step: &str) -> Vec<(OsString, OsString)>
pub fn child_env(&self, step: &str) -> Vec<(OsString, OsString)>
The constructed environment a step receives. Secrets enter only for the step that consumes them; the caller records their handling.
Sourcepub fn secret_values() -> Vec<Zeroizing<Vec<u8>>>
pub fn secret_values() -> Vec<Zeroizing<Vec<u8>>>
The secret bytes a run must keep out of its own output: the values the environment carries. Every buffer is scrubbed on drop; none is ever logged or echoed.
Key material is not read here. The step that transmits a key adds the very bytes it sends, so the needle cannot describe one file while the child receives another.