pub struct FakeProvider { /* private fields */ }Implementations§
Source§impl FakeProvider
impl FakeProvider
Sourcepub async fn seed_pending_review_publication(
&self,
repository: Repository,
number: ChangeRequestNumber,
reviewer: ReviewerApplication,
submission: ReviewSubmission,
) -> Result<ReviewId>
pub async fn seed_pending_review_publication( &self, repository: Repository, number: ChangeRequestNumber, reviewer: ReviewerApplication, submission: ReviewSubmission, ) -> Result<ReviewId>
Seeds the state left after a provider created one complete draft but the caller lost the publication response before final submission.
Source§impl FakeProvider
impl FakeProvider
pub fn new() -> Self
pub async fn seed_repository( &self, facts: RepositoryFacts, settings: RepositorySettings, )
pub async fn seed_issue(&self, repository: Repository, issue: Issue)
Sourcepub async fn seed_change_request(
&self,
repository: Repository,
change_request: ChangeRequest,
)
pub async fn seed_change_request( &self, repository: Repository, change_request: ChangeRequest, )
Seeds one change request into the repository it targets.
The head it proposes is change_request.head, which names the
repository holding that branch and so can be a fork of repository.
Comment collections retain their declared order; the fake neither sorts
them nor derives order from opaque comment identifiers.
Sourcepub async fn seed_review_request_target(
&self,
repository: Repository,
target: ReviewRequestTarget,
observed: ReviewTarget,
)
pub async fn seed_review_request_target( &self, repository: Repository, target: ReviewRequestTarget, observed: ReviewTarget, )
Seeds the provider observation returned for one review-request target.
The target category is part of the lookup key while observed supplies
the actual actor or team category. Keeping them separate lets tests
model a request target that resolves to the wrong kind without the fake
inferring identity facts from the requested enum variant.
Sourcepub async fn seed_reviewer_application(
&self,
repository: Repository,
slug: String,
application: ReviewerApplication,
)
pub async fn seed_reviewer_application( &self, repository: Repository, slug: String, application: ReviewerApplication, )
Maps one lookup slug to the application and bot identity returned for a repository.
The fake does not derive this mapping from the application’s canonical slug or from a seeded review target.
Sourcepub async fn seed_check_runs(&self, repository: Repository, runs: Vec<CheckRun>)
pub async fn seed_check_runs(&self, repository: Repository, runs: Vec<CheckRun>)
Seeds observed checks, each on the commit it names, replacing whatever was already seeded on the commits this call names.
The commit comes from every run’s own head_sha, so no seeded
observation can place a run on a commit it does not name.
pub async fn seed_run(&self, repository: Repository, run: WorkflowRun)
pub async fn seed_release(&self, repository: Repository, release: Release)
pub async fn published_checks(&self) -> Vec<(Repository, String, CheckOutcome)>
pub async fn dispatches( &self, ) -> Vec<(Repository, String, String, DispatchInputs)>
Trait Implementations§
Source§impl ChangeRequestCommentsProvider for FakeProvider
impl ChangeRequestCommentsProvider for FakeProvider
Source§fn create_unanchored_comment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
body: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<ReviewCommentId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_unanchored_comment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
body: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<ReviewCommentId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
body and returns the
provider identifier assigned to that comment. Read moreSource§impl Clone for FakeProvider
impl Clone for FakeProvider
Source§fn clone(&self) -> FakeProvider
fn clone(&self) -> FakeProvider
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CodeHostingProvider for FakeProvider
impl CodeHostingProvider for FakeProvider
fn repository<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
) -> Pin<Box<dyn Future<Output = Result<RepositoryFacts>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn settings<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
) -> Pin<Box<dyn Future<Output = Result<RepositorySettings>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply_settings<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
settings: &'life2 RepositorySettings,
) -> Pin<Box<dyn Future<Output = Result<RepositorySettings>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rulesets<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
) -> Pin<Box<dyn Future<Output = Result<Vec<Ruleset>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upsert_ruleset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
ruleset: &'life2 Ruleset,
) -> Pin<Box<dyn Future<Output = Result<Ruleset>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
name: &'life2 str,
_value: SecretString,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl CodeReviewsProvider for FakeProvider
impl CodeReviewsProvider for FakeProvider
Source§fn change_request<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
) -> Pin<Box<dyn Future<Output = Result<ChangeRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn change_request<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
) -> Pin<Box<dyn Future<Output = Result<ChangeRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn open_change_requests<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
head: &'life2 ChangeRequestHead,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChangeRequestNumber>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn open_change_requests<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
head: &'life2 ChangeRequestHead,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChangeRequestNumber>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve_thread<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
thread_id: &'life2 ReviewThreadId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn resolve_finding<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
thread_id: &'life2 ReviewThreadId,
resolution: FindingResolution,
reply: &'life3 FindingResolutionReply,
) -> 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,
fn resolve_finding<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
thread_id: &'life2 ReviewThreadId,
resolution: FindingResolution,
reply: &'life3 FindingResolutionReply,
) -> 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,
Source§fn request_reviewers<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
reviewers: &'life2 [ReviewRequestTarget],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn request_reviewers<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
reviewers: &'life2 [ReviewRequestTarget],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn mark_ready<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn checks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
head_sha: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckRun>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn checks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
head_sha: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckRun>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn publish_check<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
app_name: &'life2 str,
outcome: &'life3 CheckOutcome,
) -> 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,
Source§impl Debug for FakeProvider
impl Debug for FakeProvider
Source§impl Default for FakeProvider
impl Default for FakeProvider
Source§fn default() -> FakeProvider
fn default() -> FakeProvider
Source§impl IssuesProvider for FakeProvider
impl IssuesProvider for FakeProvider
fn issue<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: IssueNumber,
) -> Pin<Box<dyn Future<Output = Result<Issue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn labels<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
) -> Pin<Box<dyn Future<Output = Result<Vec<Label>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upsert_label<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
label: &'life2 Label,
) -> Pin<Box<dyn Future<Output = Result<Label>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl JobsProvider for FakeProvider
impl JobsProvider for FakeProvider
fn dispatch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
workflow: &'life2 str,
git_ref: &'life3 str,
inputs: &'life4 DispatchInputs,
) -> 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,
'life4: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
run_id: RunId,
) -> Pin<Box<dyn Future<Output = Result<WorkflowRun>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cancel_run<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
run_id: RunId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl ReleasesProvider for FakeProvider
impl ReleasesProvider for FakeProvider
fn release_by_tag<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
tag: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Release>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_release<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
release: &'life2 NewRelease,
) -> Pin<Box<dyn Future<Output = Result<Release>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upload_asset<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
release_id: ReleaseId,
name: &'life2 str,
label: Option<&'life3 str>,
upload: AssetUpload,
) -> Pin<Box<dyn Future<Output = Result<ReleaseAsset>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn download_asset<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
asset_id: AssetId,
) -> Pin<Box<dyn Future<Output = Result<AssetStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn download_asset<'life0, 'life1, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
asset_id: AssetId,
) -> Pin<Box<dyn Future<Output = Result<AssetStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl ReviewPublishingProvider for FakeProvider
impl ReviewPublishingProvider for FakeProvider
Source§fn publish_review<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
reviewer: &'life2 ReviewerApplication,
submission: &'life3 ReviewSubmission,
) -> Pin<Box<dyn Future<Output = Result<ReviewId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn publish_review<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
reviewer: &'life2 ReviewerApplication,
submission: &'life3 ReviewSubmission,
) -> Pin<Box<dyn Future<Output = Result<ReviewId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn resume_review_publication<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
reviewer: &'life2 ReviewerApplication,
key: &'life3 ReviewPublicationKey,
) -> Pin<Box<dyn Future<Output = Result<Option<ReviewId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn resume_review_publication<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
number: ChangeRequestNumber,
reviewer: &'life2 ReviewerApplication,
key: &'life3 ReviewPublicationKey,
) -> Pin<Box<dyn Future<Output = Result<Option<ReviewId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§impl ReviewTargetsProvider for FakeProvider
impl ReviewTargetsProvider for FakeProvider
Source§fn inspect_review_request_target<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
target: &'life2 ReviewRequestTarget,
) -> Pin<Box<dyn Future<Output = Result<ReviewRequestTargetInspection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn inspect_review_request_target<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
target: &'life2 ReviewRequestTarget,
) -> Pin<Box<dyn Future<Output = Result<ReviewRequestTargetInspection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
repository. Read moreSource§impl ReviewerApplicationsProvider for FakeProvider
impl ReviewerApplicationsProvider for FakeProvider
Source§fn resolve_reviewer_application<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
slug: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<ReviewerApplication>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve_reviewer_application<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 Repository,
slug: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<ReviewerApplication>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
slug, using the credentials selected for repository, to
the application and bot actor the provider observes. Read moreSource§impl TextRecordsProvider for FakeProvider
impl TextRecordsProvider for FakeProvider
Source§fn embed_record(&self, text: &str, record: &ProviderTextRecord) -> String
fn embed_record(&self, text: &str, record: &ProviderTextRecord) -> String
Source§fn extract_records(&self, text: &str) -> Vec<ProviderTextRecord>
fn extract_records(&self, text: &str) -> Vec<ProviderTextRecord>
text in source order. Read more