pub struct Ctx {
pub target: Utf8PathBuf,
pub repo: String,
pub forge: Option<Forge>,
pub declared_forge: Option<String>,
pub profile: ProfileSnapshot,
pub capabilities: CapabilityRequests,
pub host: Option<String>,
pub required_check: Option<String>,
pub required_workflow: 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, empty where the profile names none.
forge: Option<Forge>The forge adapter the run acts through, where the profile names a forge this release drives. A target with no forge, or one this release has no adapter for, carries none: its local steps still run and its forge steps report as not applicable.
declared_forge: Option<String>The forge the profile declares, preserved whatever the adapter says, so an unknown name stays readable.
profile: ProfileSnapshotWhat the project is, as the target configuration resolves it.
capabilities: CapabilityRequestsWhich optional products the target requests.
host: Option<String>The remote host, where one was detected.
required_check: Option<String>The value of --required-check, where given.
required_workflow: Option<String>The committed setup.required_workflow, on GitHub alone. No flag
answers it: the setup never writes it, it reads it to prove that
the workflow the release gate waits on is the workflow that carries
the check the gate judges.
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 require_cli(&mut self, steps: &[&StepSpec]) -> Result<(), RkError>
pub fn require_cli(&mut self, steps: &[&StepSpec]) -> Result<(), RkError>
Resolve the forge CLI where this run will call the forge for one of
steps, and refuse where it cannot be found.
The prerequisite belongs to the call, not to the command. A step is only a caller when the target’s configuration selects it, the target has not excluded it, and the step reaches the forge at this particular forge. A preview writes nothing, and asks anyway for the steps it would act on, because it names the command it would run and a CLI nothing could find is worth saying then.
§Errors
Propagates the refusal when the forge CLI cannot be resolved.
SATISFIES forge-setup:applicability-follows-the-target-configuration
Sourcepub fn landed_destinations(&self) -> Option<&[String]>
pub fn landed_destinations(&self) -> Option<&[String]>
The destinations the landing record names, or None where nothing
landed here.
Sourcepub const fn has_adapter(&self) -> bool
pub const fn has_adapter(&self) -> bool
Whether the run has a forge adapter to act through.
Sourcepub fn adapter(&self) -> Result<Forge, RkError>
pub fn adapter(&self) -> Result<Forge, RkError>
The forge adapter, or the refusal a forge operation answers where the profile names no forge this release drives.
§Errors
A prerequisite-unmet refusal naming the declared forge and the
ones this release drives.
Sourcepub const fn automatic_release(&self) -> bool
pub const fn automatic_release(&self) -> bool
Whether this target’s release is one release-kit drives.
Sourcepub fn declared_forge(&self) -> Option<&str>
pub fn declared_forge(&self) -> Option<&str>
The forge the profile declares, whatever the adapter says.
Sourcepub const fn reporting_policy(&self) -> bool
pub const fn reporting_policy(&self) -> bool
Whether the target requested the landed reporting policy.
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 excluded(&self, step: &str) -> Option<&str>
pub fn excluded(&self, step: &str) -> Option<&str>
Why this target does not run the named step, where it declared an exclusion for it. The reason is what the report prints, so an excluded step is always visible with the answer behind it.
Sourcepub fn excluded_count(&self) -> usize
pub fn excluded_count(&self) -> usize
How many steps this target declared it does not run.
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 safety_ruleset(&self) -> &str
pub fn safety_ruleset(&self) -> &str
The ruleset that keeps the trunk undeletable and unrewritable.
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 const fn integration(&self) -> Integration
pub const fn integration(&self) -> Integration
Which authority carries an implementation onto this trunk.
Sourcepub const fn protection(&self) -> &Protection
pub const fn protection(&self) -> &Protection
The floored policy this target states, already judged at load.
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.