pub struct GitHubActionsAdapter { /* private fields */ }Expand description
GitHub Actions compatible subscriber adapter.
Scans repositories for workflow YAML files, creates event handlers
from the on: triggers, and dispatches workflows when matching
events are received.
Implementations§
Source§impl GitHubActionsAdapter
impl GitHubActionsAdapter
Sourcepub fn new(subscriber: EventSubscriber, subject: Subject) -> Self
pub fn new(subscriber: EventSubscriber, subject: Subject) -> Self
Create a new GitHubActionsAdapter.
§Arguments
subscriber- Event subscriber for the event bussubject- Service identity for workflow dispatch
Sourcepub async fn load_repo(
&mut self,
repo_id: &str,
service: &WorkflowService,
) -> Result<()>
pub async fn load_repo( &mut self, repo_id: &str, service: &WorkflowService, ) -> Result<()>
Scan a repository for .github/workflows/*.yml, parse each,
register with WorkflowService, and build EventHandlers from triggers.
Generic (non-gate) loader: parses in Legacy
mode via WorkflowService::scan_repo. The merge gate opts into
strict mode via Self::load_repo_with (#1432).
Sourcepub async fn load_repo_with(
&mut self,
repo_id: &str,
service: &WorkflowService,
mode: ParseMode,
) -> Result<()>
pub async fn load_repo_with( &mut self, repo_id: &str, service: &WorkflowService, mode: ParseMode, ) -> Result<()>
Load a repository’s workflows with an explicit [ParseMode] (#1432).
This is the gate-specific boundary for strict selection: a merge
gate calls load_repo_with(repo, svc, ParseMode::Strict) so that a
workflow file using unsupported semantics (permissions:,
concurrency:, services:) is refused rather than silently loaded
with dropped keys. In [ParseMode::Legacy] (the default for the
generic adapter) unknown keys are tolerated, preserving non-gate
caller compatibility (#1432 non-goal).
The chosen mode, scan, stale-registration eviction, and registration
are one service-level atomic transition. Only after that transition
completes are this adapter’s handlers rebuilt. A stale handler can
therefore only resolve a surviving strict registration; a rejected
workflow already fails dispatch with WorkflowNotFound.
Sourcepub fn required_prefixes(&self) -> &[String]
pub fn required_prefixes(&self) -> &[String]
Get topic prefixes that need to be subscribed to.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GitHubActionsAdapter
impl !RefUnwindSafe for GitHubActionsAdapter
impl Send for GitHubActionsAdapter
impl Sync for GitHubActionsAdapter
impl Unpin for GitHubActionsAdapter
impl UnsafeUnpin for GitHubActionsAdapter
impl !UnwindSafe for GitHubActionsAdapter
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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