pub struct HealTarget {
pub repo: String,
pub fix_repo: Option<String>,
pub checkout: Option<Checkout>,
pub label: String,
pub base: String,
}Expand description
One repository the loop is configured to heal, and where its code lives.
The loop is not about this repository. car and car-releases are the
first configuration, not the design — every read below takes its repository
as an argument, so healing an arbitrary GitHub repo is a matter of naming
it here rather than of new machinery.
§Why a checkout is part of the target
Reading a tracker needs only a repo spec; fixing something needs a working
tree. coder.start accepts either a raw repo path or a CAR-managed
project slug, and both are legitimate here — they differ in who owns the
tree, which is a real distinction the loop must not paper over:
Checkout::Localis a path the operator already has. The coder never touches it directly (it works in its own worktree and publishes a branch), but it is the operator’s repository and the loop is a guest in it.Checkout::Projectis a CAR-managed clone. There is no separate user working tree to protect, which is what makes an unattended loop reasonable on a repo nobody is sitting in front of.
A target with no checkout is legal and means read-only: the loop can see the queue and report, but has nowhere to write a fix. That is the honest default for a repository someone wants watched but not modified.
Fields§
§repo: StringWhere the WORK QUEUE lives — the tracker this loop reads.
fix_repo: Option<String>Where a fix’s pull request lands, when that is not Self::repo.
The motivating configuration has these differ: issues on a public releases tracker, code in a separate source repo. A pull request goes where its branch was pushed — the source repo — so a coverage check (“is this issue already being worked on?”) run against the tracker queries a repository that can never hold the answer.
Getting this wrong is not an occasional duplicate. It is every daemon,
every tick, forever, because the issue can never become covered.
None means queue and fixes share one repository.
checkout: Option<Checkout>Where a fix would be written, if anywhere.
label: StringThe opt-in label. An item without it is invisible to the loop.
Per-target rather than global: one label convention does not survive contact with several repositories, and a loop that healed unlabelled items in someone else’s repo because the operator forgot to configure a label would be the worst possible default.
base: StringThe branch a fix’s pull request merges into.
Per-target and explicit because main was hardcoded in two places for
one concept — the diff the review panel read and the base the pull
request opened against — and on a master repository the first failed
silently into a panel reviewing an error string while the second failed
loudly at gh, after the push.
Implementations§
Source§impl HealTarget
impl HealTarget
Sourcepub fn coverage_repo(&self) -> &str
pub fn coverage_repo(&self) -> &str
The repository whose open pull requests answer “is this covered”.
Sourcepub fn is_cross_repo(&self) -> bool
pub fn is_cross_repo(&self) -> bool
Whether fixes land somewhere other than the queue.
Trait Implementations§
Source§impl Clone for HealTarget
impl Clone for HealTarget
Source§impl Debug for HealTarget
impl Debug for HealTarget
impl Eq for HealTarget
Source§impl PartialEq for HealTarget
impl PartialEq for HealTarget
impl StructuralPartialEq for HealTarget
Auto Trait Implementations§
impl Freeze for HealTarget
impl RefUnwindSafe for HealTarget
impl Send for HealTarget
impl Sync for HealTarget
impl Unpin for HealTarget
impl UnsafeUnpin for HealTarget
impl UnwindSafe for HealTarget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more