Skip to main content

GithubBuildProvider

Struct GithubBuildProvider 

Source
pub struct GithubBuildProvider<R, P, A = NoVerifiedArtifactStore, C = SystemProviderClock> { /* private fields */ }
Expand description

Concrete GitHub Actions implementation of the runtime-neutral build-provider contract.

Implementations§

Source§

impl<R, P> GithubBuildProvider<R, P, NoVerifiedArtifactStore, SystemProviderClock>

Source

pub fn new( config: GithubProviderConfig, transport: GithubTransport<R>, publisher: P, ) -> Self

Construct the provider without artifact ingestion.

Artifact listing/download capabilities remain false and GitHub success is reported as verification-pending, never as protocol success.

Source§

impl<R, P, A, C> GithubBuildProvider<R, P, A, C>

Source

pub fn with_artifact_store_and_clock( config: GithubProviderConfig, transport: GithubTransport<R>, publisher: P, artifacts: A, clock: C, ) -> Self

Construct with explicit verified artifact ingestion and clock.

Source

pub fn with_checkpoint_sink( self, sink: impl GithubJobCheckpointSink + 'static, ) -> Self

Attach an atomic durable checkpoint sink without changing the protocol-v1 provider type.

Source

pub const fn workflow_run_trigger(&self) -> WorkflowRunTrigger

Configured workflow trigger governing publication-to-run mapping.

Source

pub fn wait_for_github_run( &self, job_id: &str, cancellation: &CancellationToken, ) -> RemoteBuildResult<RunSnapshot>
where R: GhRunner,

Explicitly poll one mapped run to terminal using the configured bounded policy.

This does not synthesize protocol success; a later events call still requires verified artifact manifests. Cancellation is checked before and after the bounded transport poll.

§Errors

Returns a typed provider failure for an unknown/unmapped job or transport failure.

Source

pub fn durable_identity(&self) -> RemoteBuildResult<GithubDurableIdentityV1>
where R: GhRunner,

Resolve the exact secret-free identity for a local durable record before submission.

This performs only bounded GitHub metadata reads. It never publishes a ref, starts a run, cancels a run, or deletes remote state. Repository-scoped credentials are rejected until a stable installation principal ID can be proven.

§Errors

Returns a typed transport or stable-identity failure.

Source

pub fn precompute_git_snapshot_graph( &self, inputs: &mut GitSnapshotPrecomputeInputs, operation_id: &str, source_created_at_ms: u64, cancellation: &CancellationToken, ) -> RemoteBuildResult<GitSnapshotObjectGraphV1>

Precompute one initial snapshot’s exact six-object graph without mutation.

This specialized boundary validates provider snapshot support and the operation-derived source ref, then delegates only to the retained-byte no-write publisher primitive. It does not create a stage, write a Git object, mutate a ref, access the network, or submit a job.

§Errors

Returns a typed cancellation, unsupported-capability, unsafe-operation, retained-stage, object-format, fixed-Git, or canonical graph failure.

Source

pub fn discover_uncheckpointed_git_snapshot_stages( &self, ) -> RemoteBuildResult<Vec<GithubGitSnapshotRecoveryCandidateV1>>

Discover complete provider-unowned snapshot stages using bounded private reads only.

This method neither adopts nor deletes any candidate. Provider jobs and in-process reservations are excluded, but the controller must separately prove that no on-disk JobStore record owns the operation before atomically creating that owner and invoking fresh-reconsent submission.

§Errors

Returns a typed failure when snapshot support is unavailable or any private store entry is partial, unknown, over the fixed bound, non-canonical, rebound, or configuration-mismatched.

Source

pub fn submit_git_snapshot( &self, submission: GithubGitSnapshotSubmissionV1, cancellation: &CancellationToken, ) -> RemoteBuildResult<JobHandle>

Submit one explicit-consent unsigned Git snapshot without an ordinary clean-Git fallback.

The first Prepared checkpoint is synchronously durable before this method permits a Git object write, ref mutation, or network request. Same-invocation stages must carry the exact accepted consent SHA. Restart adoption is available only through the distinct fresh- reconsent constructor and is no-mutation until that same checkpoint succeeds.

§Errors

Returns a typed validation, checkpoint, retained-stage, Git, identity, transport, or publication failure. A checkpointed job remains resumable after any later failure.

Source

pub fn precompute_exact_git_snapshot_retry( &self, parent_job_id: &str, child_operation_id: &str, child_source_created_at_ms: u64, cancellation: &CancellationToken, ) -> RemoteBuildResult<GithubGitSnapshotExactRetryPlanV1>

Derive one immutable exact-retry child request without creating a stage or mutating Git.

The terminal parent’s archive blob and keepalive are verified before and after bounded offline no-write hashing. The returned request and graph can therefore be persisted in the parent/child lineage before any child stage write.

§Errors

Returns a typed failure for a nonterminal or releasing parent, missing/conflicting keepalive, invalid child identity, parent blob mismatch, or deterministic graph failure.

Source

pub fn stage_exact_git_snapshot_retry( &self, authorization: &GithubGitSnapshotExactRetryAuthorizationV1, expected_plan: &GithubGitSnapshotExactRetryPlanV1, cancellation: &CancellationToken, ) -> RemoteBuildResult<GithubGitSnapshotExactRetryStageV1>

Create one exact child retry stage from a verified terminal parent’s private archive blob.

The caller must durably bind the parent/child retry lineage before invoking this method. No workspace is recaptured and no Git object or ref is mutated. The parent keepalive is required at its exact commit before and after the bounded child stage is published.

§Errors

Returns a typed failure for missing lineage authority, a nonterminal or releasing parent, a missing/conflicting keepalive, parent blob size/SHA/object mismatch, or child stage and descriptor/graph failure.

Source

pub fn release_git_snapshot_keepalive_for_prune( &self, authorization: &GithubGitSnapshotKeepaliveReleaseAuthorizationV1, cancellation: &CancellationToken, ) -> RemoteBuildResult<()>

Release one exact local snapshot keepalive under complete-lineage prune authority.

The caller remains responsible for proving complete-lineage prune authority and retaining every controller/store lease until this method returns. The provider binds the stable lineage IDs/edges/cutoff digest into its own checkpoint before any local ref mutation, verifies the exact expected commit, and checkpoints confirmed absence before returning.

§Errors

Returns a typed failure unless the exact restored job has completed terminal cleanup, its remote source ref is already absent or conflict-proven, checkpoints are durable, and the local keepalive can be reconciled and removed without conflict.

Source

pub fn restore_job_resumes_offline( &self, resumes: Vec<GithubJobResumeV1>, expected: &GithubDurableIdentityV1, ) -> RemoteBuildResult<()>

Restore durable jobs using only their stored identity and local provider configuration.

This method performs no transport or publisher operation. Call Self::revalidate_restored_job_live after any controller-owned mutation intent is durable and before relying on live GitHub state.

§Errors

Rejects any configuration, principal, repository, request, ref, run, event, or state mismatch, duplicate job, capacity violation, or existing provider-state conflict.

Source

pub fn revalidate_restored_job_live( &self, job_id: &str, cancellation: &CancellationToken, ) -> RemoteBuildResult<()>
where R: GhRunner,

Revalidate one offline-restored job against the current principal, repository, and run.

This performs bounded read-only GitHub requests and persists any refreshed exact run snapshot through the configured checkpoint sink. It never publishes, cancels, or cleans.

§Errors

Returns a typed identity, transport, checkpoint, or restored-state failure.

Source

pub fn restored_terminal_job_log_identity( &self, job_id: &str, ) -> RemoteBuildResult<Option<GithubDurableRunAttemptLogIdentity>>

Recover an offline-only identity for an exact terminal attempt restored from durable state.

This performs no transport or publisher operation. The returned type can validate an append-last durable log marker but cannot be passed to the network log fetcher.

§Errors

Returns a typed restored-state or terminal-run identity failure.

Source

pub fn export_job_resumes(&self) -> RemoteBuildResult<Vec<GithubJobResumeV1>>
where R: GhRunner,

Export all current jobs as strictly validated, secret-free durable records.

The current credential and stable execution-repository ID are revalidated before records are emitted.

§Errors

Returns a typed identity, transport, state, or serialization failure.

Source

pub fn restore_job_resumes( &self, resumes: Vec<GithubJobResumeV1>, ) -> RemoteBuildResult<()>
where R: GhRunner,

Restore an atomic batch of durable jobs after strict live identity revalidation.

Existing jobs and reservations are never overwritten.

§Errors

Rejects unknown schema fields during deserialization and rejects any repository, principal, configuration, request, ref, run, attempt, event, or state mismatch here.

Source

pub fn reconcile_restored_job( &self, job_id: &str, cancellation: &CancellationToken, ) -> RemoteBuildResult<GithubJobReconciliation>

Reconcile one restored pre-publication intent without issuing a duplicate push.

§Errors

Returns a typed provider or read-only publisher failure. Exact remote bytes must match before a dispatch commit is adopted.

Source

pub fn reconcile_restored_job_get_only( &self, job_id: &str, cancellation: &CancellationToken, ) -> RemoteBuildResult<GithubJobReconciliation>

Reconcile one restored publication using reads only, never cancellation dispatch.

This is the restart-safe path for a durable cancellation whose provider checkpoint already records cancellation intent but not dispatch acknowledgement.

§Errors

Returns a typed provider or read-only publisher failure. Exact remote bytes must match before a dispatch commit is adopted.

Source

pub fn refresh_restored_job_get_only( &self, job_id: &str, cancellation: &CancellationToken, ) -> RemoteBuildResult<()>
where R: GhRunner,

Refresh one restored job through bounded GET requests without cancellation dispatch.

Provider state and its checkpoint may advance from exact run observations, including to a terminal state. No remote mutation is issued even when durable cancellation intent exists.

§Errors

Returns a typed identity, transport, checkpoint, or restored-state failure.

Trait Implementations§

Source§

impl<R, P, A, C> BuildProvider for GithubBuildProvider<R, P, A, C>

Source§

fn id(&self) -> &str

Stable provider identifier used in events and errors.
Source§

fn capabilities(&self) -> &ProviderCapabilities

Capabilities active for this provider configuration.
Source§

fn handshake( &self, request: HandshakeRequest, cancellation: CancellationToken, ) -> ProviderFuture<'_, HandshakeResponse>

Negotiate protocol and worker compatibility.
Source§

fn doctor( &self, request: ProviderDoctorRequest, cancellation: CancellationToken, ) -> ProviderFuture<'_, ProviderDoctorReport>

Inspect provider, worker, and optional signing readiness.
Source§

fn submit( &self, request: IosDeviceBuildRequest, cancellation: CancellationToken, ) -> ProviderFuture<'_, JobHandle>

Submit one declarative physical-iPhone build.
Source§

fn events( &self, request: EventRequest, cancellation: CancellationToken, ) -> ProviderFuture<'_, EventPage>

Retrieve a bounded ordered page of events.
Source§

fn cancel( &self, request: CancellationRequest, cancellation: CancellationToken, ) -> ProviderFuture<'_, CancellationAck>

Request cancellation of an active job.
Source§

fn list_artifacts( &self, request: ArtifactListRequest, cancellation: CancellationToken, ) -> ProviderFuture<'_, Vec<ArtifactManifest>>

List verified artifact manifests for a job.
Source§

fn download_artifact( &self, request: ArtifactDownloadRequest, cancellation: CancellationToken, ) -> ProviderFuture<'_, ArtifactDownloadResult>

Download and independently verify one artifact.
Source§

fn cleanup( &self, request: CleanupRequest, cancellation: CancellationToken, ) -> ProviderFuture<'_, CleanupConfirmation>

Delete provider-owned workspace, signing material, and optional retained artifacts.

Auto Trait Implementations§

§

impl<R, P, A = NoVerifiedArtifactStore, C = SystemProviderClock> !Freeze for GithubBuildProvider<R, P, A, C>

§

impl<R, P, A, C> RefUnwindSafe for GithubBuildProvider<R, P, A, C>

§

impl<R, P, A, C> Send for GithubBuildProvider<R, P, A, C>
where Mutex<GithubTransport<R>>: Send, Mutex<P>: Send, Mutex<A>: Send, C: Send,

§

impl<R, P, A, C> Sync for GithubBuildProvider<R, P, A, C>
where Mutex<GithubTransport<R>>: Sync, Mutex<P>: Sync, Mutex<A>: Sync, C: Sync,

§

impl<R, P, A, C> Unpin for GithubBuildProvider<R, P, A, C>

§

impl<R, P, A, C> UnsafeUnpin for GithubBuildProvider<R, P, A, C>

§

impl<R, P, A, C> UnwindSafe for GithubBuildProvider<R, P, A, C>

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, 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> 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.