Skip to main content

GitHubBackend

Struct GitHubBackend 

Source
pub struct GitHubBackend { /* private fields */ }

Implementations§

Source§

impl GitHubBackend

Source

pub fn new(repo: String) -> Result<Self>

Trait Implementations§

Source§

impl ExternalBackend for GitHubBackend

Source§

fn sync_to_project<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ExternalId, status: Status, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sync a task to the GitHub Project board (if configured).

Called when a task is first ingested to ensure it appears on the project board immediately, not just when status changes later. Returns Some(node_id) if the item was added to the project board.

Source§

fn update_status<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ExternalId, status: Status, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Override default update_status to add project board sync after label update.

Source§

fn list_all_tasks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all tasks (open and closed) in a single API call.

This fetches all issues with state=all and filters by status labels locally. More efficient than making 7 separate calls to list_by_status.

Source§

fn list_routable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List open issues that have no status:* label (unprocessed) or have status:new.

Source§

fn list_active_open_issues<'life0, 'life1, 'async_trait>( &'life0 self, since: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<(ExternalTask, Option<Status>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Single-call override: fetches all open issues once and partitions by status label locally, replacing the 1 (list_routable) + 5 (list_by_status per active status) fan-out with a single list_all_open_issues request. When since is Some(ts), uses GitHub’s ?since filter for efficiency.

Source§

fn set_labels<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 ExternalId, labels: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Additive: uses POST (gh.add_labels), so existing labels like bug, priority:high are preserved.

Source§

fn name(&self) -> &str

Human-readable name (e.g. “github”, “linear”, “jira”)
Source§

fn create_task<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, title: &'life1 str, body: &'life2 str, labels: &'life3 [String], ) -> Pin<Box<dyn Future<Output = Result<ExternalId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Create a task in the external system.
Source§

fn get_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ExternalId, ) -> Pin<Box<dyn Future<Output = Result<ExternalTask>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a task by its external ID.
Source§

fn ensure_status_label<'life0, 'life1, 'async_trait>( &'life0 self, label: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Ensure a status label exists in the backend system. Read more
Source§

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

Repair project display state from authoritative external labels. Called by periodic and webhook-triggered sync, independent of ingestion. Does not transition tasks or dispatch agents. Default is a no-op.
Source§

fn sync_estimate_to_project<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ExternalId, estimate: u8, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sync a task’s estimate to the project board Estimate field. Read more
Source§

fn get_project_item_estimates<'life0, 'life1, 'async_trait>( &'life0 self, issue_node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Batch-fetch project item estimates for a list of issue node IDs. Read more
Source§

fn list_by_status<'life0, 'async_trait>( &'life0 self, status: Status, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List tasks by status.
Source§

fn list_reconciliation_candidates<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List tasks for closed-issue reconciliation fallback. Read more
Source§

fn post_comment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 ExternalId, body: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Post a comment / activity note.
Source§

fn remove_label<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 ExternalId, label: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove a label / tag.
Source§

fn get_sub_issues<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ExternalId, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get sub-issues (children) of a task. Read more
Source§

fn create_sub_task<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, parent_id: &'life1 ExternalId, title: &'life2 str, body: &'life3 str, labels: &'life4 [String], ) -> Pin<Box<dyn Future<Output = Result<ExternalId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Create a child task and link it as a sub-issue of the parent. Read more
Source§

fn has_open_issue_with_title<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, title: &'life1 str, label: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Check if an open issue with the given title already exists. Read more
Source§

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

Check if connected and authenticated.
Source§

fn is_pr_merged<'life0, 'life1, 'async_trait>( &'life0 self, branch: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a PR/merge request for the given branch has been merged. Read more
Source§

fn batch_is_pr_merged<'life0, 'life1, 'async_trait>( &'life0 self, branches: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, bool>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if PRs for the given branches have been merged, in a single batch. Read more
Source§

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

Get the authenticated user’s username. Read more
Source§

fn get_mentions<'life0, 'life1, 'async_trait>( &'life0 self, since: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Mention>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get recent mentions/comments since a given timestamp. Read more
Source§

fn list_issue_comments<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ExternalId, ) -> Pin<Box<dyn Future<Output = Result<Vec<Mention>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all comments for a specific task/issue. Read more
Source§

fn acknowledge_issue<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ExternalId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Acknowledge a newly detected issue (e.g., add a reaction emoji). Read more
Source§

fn acknowledge_mention<'life0, 'life1, 'async_trait>( &'life0 self, comment_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Acknowledge a mention (comment) by reacting with the eyes emoji. Read more
Source§

fn blocked_by<'life0, 'life1, 'async_trait>( &'life0 self, repo: &'life1 str, issue_number: i64, ) -> Pin<Box<dyn Future<Output = Result<BlockedByFetch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Native blocked-by issues for issue_number in repo. Read more
Source§

fn issue_close_state<'life0, 'life1, 'async_trait>( &'life0 self, repo: &'life1 str, issue_number: i64, ) -> Pin<Box<dyn Future<Output = Result<Option<(String, Option<String>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Close state of an issue orch may not track. Read more
Source§

fn post_comment_in_repo<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, repo: &'life1 str, id: &'life2 ExternalId, body: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Post a comment on an issue in repo, which may differ from this backend’s repo. Read more
Source§

fn pull_request_completion<'life0, 'life1, 'async_trait>( &'life0 self, repo: &'life1 str, pr_number: i64, ) -> Pin<Box<dyn Future<Output = Result<Option<PullRequestCompletion>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Review and merge state of pull request pr_number in repo. Read more
Source§

fn add_dependency<'life0, 'life1, 'async_trait>( &'life0 self, issue_number: i64, blocking_repo: &'life1 str, blocking_number: i64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record that issue_number in this backend’s repo is blocked by another issue. Read more

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: Sized + 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: Sized + 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 = !

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

fn try_from(value: U) -> Result<T, !>

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