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>,
}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 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.