pub struct BashHookExecutor {
pub command: String,
pub env: BTreeMap<String, String>,
pub dispatcher: Option<Arc<dyn BashHookDispatcher>>,
}Expand description
Bash backend. Runs the configured command inside virtual_bash against
the session VFS. JSON payload is delivered to the script via
$EVERRUNS_HOOK_PAYLOAD_JSON (and the same JSON written to
$EVERRUNS_HOOK_PAYLOAD_PATH on the session VFS); the script writes a
JSON decision to stdout. Falls back to exit-code semantics when stdout is
empty (Git-hook compatibility).
This struct is backend-agnostic: it serializes the payload, hands it to a
BashHookDispatcher, and parses the dispatcher’s stdout/exit_code/stderr
into a HookOutcome. The production dispatcher
(crate::hook_dispatch::VirtualBashHookDispatcher) runs the command
through the same bashkit interpreter the virtual_bash capability uses.
Fields§
§command: StringCommand the user authored (validated non-empty).
env: BTreeMap<String, String>Extra env vars layered onto the executor’s default env.
dispatcher: Option<Arc<dyn BashHookDispatcher>>Sandbox dispatcher injected by the runtime. None keeps the type
constructible in unit tests; in production the capability collection
path supplies a real dispatcher.
Implementations§
Source§impl BashHookExecutor
impl BashHookExecutor
Sourcepub fn with_dispatcher(
command: String,
env: BTreeMap<String, String>,
dispatcher: Arc<dyn BashHookDispatcher>,
) -> Self
pub fn with_dispatcher( command: String, env: BTreeMap<String, String>, dispatcher: Arc<dyn BashHookDispatcher>, ) -> Self
Build an executor wired to the given dispatcher. This is the production constructor used by the capability collection path.
Trait Implementations§
Source§impl HookExecutor for BashHookExecutor
impl HookExecutor for BashHookExecutor
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: HookPayload,
opts: &'life1 ExecutorOpts,
) -> Pin<Box<dyn Future<Output = HookOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for BashHookExecutor
impl !UnwindSafe for BashHookExecutor
impl Freeze for BashHookExecutor
impl Send for BashHookExecutor
impl Sync for BashHookExecutor
impl Unpin for BashHookExecutor
impl UnsafeUnpin for BashHookExecutor
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request