Skip to main content

GitBackend

Struct GitBackend 

Source
pub struct GitBackend { /* private fields */ }
Expand description

Pure local git backend wrapping a GitRepo.

Uses GitRepo for all operations including smart fetching. Cannot access GitHub API, so PR/Issue queries will return Unsupported.

Implementations§

Source§

impl GitBackend

Source

pub const fn new(repo: GitRepo) -> Self

Create a GitBackend from an existing GitRepo.

Source

pub const fn git_repo(&self) -> &GitRepo

Get a reference to the underlying GitRepo.

Source

pub fn set_notice_callback(&mut self, cb: NoticeCallback)

Set the notice callback for emitting operational messages.

Trait Implementations§

Source§

impl Backend for GitBackend

Source§

fn find_commit<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = WtgResult<CommitInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find commit by hash (short or full).
Source§

fn enrich_commit<'life0, 'async_trait>( &'life0 self, commit: CommitInfo, ) -> Pin<Box<dyn Future<Output = CommitInfo> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Enrich commit with additional info (author URLs, commit URL, etc.).
Source§

fn find_file<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, branch: &'life1 str, path: &'life2 str, ) -> Pin<Box<dyn Future<Output = WtgResult<FileInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find file and its history in the repository.
Source§

fn find_tag<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = WtgResult<TagInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find a specific tag by name.
Source§

fn find_previous_tag<'life0, 'life1, 'async_trait>( &'life0 self, tag_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = WtgResult<Option<TagInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find the previous tag before the given tag. Read more
Source§

fn commits_between_tags<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, from_tag: &'life1 str, to_tag: &'life2 str, limit: usize, ) -> Pin<Box<dyn Future<Output = WtgResult<Vec<CommitInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get commits between two tags (from_tag exclusive, to_tag inclusive). Read more
Source§

fn disambiguate_query<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 ParsedQuery, ) -> Pin<Box<dyn Future<Output = WtgResult<Query>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Disambiguate a parsed query into a concrete query.
Source§

fn find_release_for_commit<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, commit_hash: &'life1 str, _commit_date: Option<DateTime<Utc>>, filter: &'life2 ReleaseFilter, ) -> Pin<Box<dyn Future<Output = Option<TagInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find a release/tag that contains the given commit. Read more
Source§

fn changelog_for_version<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Parse changelog for a specific version from repository root. Read more
Source§

fn commit_url(&self, hash: &str) -> Option<String>

Generate URL to view a commit.
Source§

fn tag_url(&self, tag: &str) -> Option<String>

Generate URL to view a tag (tree view for plain git tags).
Source§

fn release_tag_url(&self, tag: &str) -> Option<String>

Generate URL to view a release (releases page for tags with releases).
Source§

fn author_url_from_email(&self, email: &str) -> Option<String>

Generate author profile URL from email address.
Source§

fn emit_notice(&self, _notice: Notice)

Emit a notice to the registered callback. Used by resolution code to surface warnings to the user.
Source§

fn backend_for_pr<'life0, 'life1, 'async_trait>( &'life0 self, _pr: &'life1 PullRequestInfo, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn Backend>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a backend for fetching PR data if the PR is from a different repository. Returns None if same repo or cross-project not supported.
Source§

fn find_commit_for_pr<'life0, 'life1, 'async_trait>( &'life0 self, pr: &'life1 PullRequestInfo, ) -> Pin<Box<dyn Future<Output = WtgResult<CommitInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find commit info from a PR (using merge commit SHA).
Source§

fn fetch_release_body<'life0, 'life1, 'async_trait>( &'life0 self, _tag_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the body/description of a GitHub release by tag name.
Source§

fn fetch_issue<'life0, 'async_trait>( &'life0 self, _number: u64, ) -> Pin<Box<dyn Future<Output = WtgResult<ExtendedIssueInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch issue details including closing PRs.
Source§

fn fetch_pr<'life0, 'async_trait>( &'life0 self, _number: u64, ) -> Pin<Box<dyn Future<Output = WtgResult<PullRequestInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch PR details.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more