flowey_core::pipeline

Struct PipelineJob

Source
pub struct PipelineJob<'a> { /* private fields */ }

Implementations§

Source§

impl PipelineJob<'_>

Source

pub fn ado_set_pool(self, pool: impl AsRef<str>) -> Self

(ADO only) specify which agent pool this job will be run on.

Source

pub fn ado_set_pool_with_demands( self, pool: impl AsRef<str>, demands: Vec<String>, ) -> Self

(ADO only) specify which agent pool this job will be run on, with additional special runner demands.

Source

pub fn ado_new_named_variable( self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Self

(ADO only) Declare a job-level, named, read-only ADO variable.

name and value are both arbitrary strings, which may include ADO template expressions.

NOTE: Unless required by some particular third-party task, it’s strongly recommended to avoid using this method, and to simply use ReadVar::from_static to get a obtain a static variable.

DEVNOTE: In the future, this API may be updated to return a handle that will allow resolving the resulting AdoRuntimeVar, but for implementation expediency, this API does not currently do this. If you need to read the value of this variable at runtime, you may need to invoke AdoRuntimeVar::dangerous_from_global manually.

Source

pub fn ado_new_named_variables<K, V>( self, vars: impl IntoIterator<Item = (K, V)>, ) -> Self
where K: AsRef<str>, V: AsRef<str>,

(ADO only) Declare multiple job-level, named, read-only ADO variables at once.

This is a convenience method to streamline invoking Self::ado_new_named_variable multiple times.

NOTE: Unless required by some particular third-party task, it’s strongly recommended to avoid using this method, and to simply use ReadVar::from_static to get a obtain a static variable.

DEVNOTE: In the future, this API may be updated to return a handle that will allow resolving the resulting AdoRuntimeVar, but for implementation expediency, this API does not currently do this. If you need to read the value of this variable at runtime, you may need to invoke AdoRuntimeVar::dangerous_from_global manually.

Source

pub fn ado_override_job_id(self, name: impl AsRef<str>) -> Self

Overrides the id of the job.

Flowey typically generates a reasonable job ID but some use cases that depend on the ID may find it useful to override it to something custom.

Source

pub fn gh_set_pool(self, pool: GhRunner) -> Self

(GitHub Actions only) specify which Github runner this job will be run on.

Source

pub fn gh_dangerous_override_if(self, condition: impl AsRef<str>) -> Self

(GitHub Actions only) Manually override the if: condition for this particular job.

This is dangerous, as an improperly set if condition may break downstream flowey jobs which assume flowey is in control of the job’s scheduling logic.

See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idif for more info.

Source

pub fn gh_dangerous_global_env_var( self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Self

(GitHub Actions only) Declare a global job-level environment variable, visible to all downstream steps.

name and value are both arbitrary strings, which may include GitHub Actions template expressions.

This is dangerous, as it is easy to misuse this API in order to write a node which takes an implicit dependency on there being a global variable set on its behalf by the top-level pipeline code, making it difficult to “locally reason” about the behavior of a node simply by reading its code.

Whenever possible, nodes should “late bind” environment variables: accepting a compile-time / runtime flowey parameter, and then setting it prior to executing a child command that requires it.

Only use this API in exceptional cases, such as obtaining an environment variable whose value is determined by a job-level GitHub Actions expression evaluation.

Source

pub fn gh_grant_permissions<N: FlowNodeBase + 'static>( self, permissions: impl IntoIterator<Item = (GhPermission, GhPermissionValue)>, ) -> Self

(GitHub Actions only) Grant permissions required by nodes in the job.

For a given node handle, grant the specified permissions. The list provided must match the permissions specified within the node using requires_permission.

NOTE: While this method is called at a node-level for auditability, the emitted yaml grants permissions at the job-level.

This can lead to weird situations where node 1 might not specify a permission required according to Github Actions, but due to job-level granting of the permission by another node 2, the pipeline executes even though it wouldn’t if node 2 was removed.

For available permission scopes and their descriptions, see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions.

Source

pub fn apply_patchfn(self, patchfn: PatchFn) -> Self

Source

pub fn with_condition(self, cond: UseParameter<bool>) -> Self

Only run the job if the specified condition is true.

When running locally, the cond’s default value will be used to determine if the job will be run.

Source

pub fn dep_on<R: IntoRequest + 'static>( self, f: impl FnOnce(&mut PipelineJobCtx<'_>) -> R, ) -> Self

Add a flow node which will be run as part of the job.

Source

pub fn finish(self) -> PipelineJobHandle

Finish describing the pipeline job.

Source

pub fn get_platform(&self) -> FlowPlatform

Return the job’s platform.

Source

pub fn get_arch(&self) -> FlowArch

Return the job’s architecture.

Auto Trait Implementations§

§

impl<'a> Freeze for PipelineJob<'a>

§

impl<'a> !RefUnwindSafe for PipelineJob<'a>

§

impl<'a> !Send for PipelineJob<'a>

§

impl<'a> !Sync for PipelineJob<'a>

§

impl<'a> Unpin for PipelineJob<'a>

§

impl<'a> !UnwindSafe for PipelineJob<'a>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.