Index > workflow
Namespace: workflow
Grit workflow management utilities.
Interfaces
WorkflowContextConfig
Properties
Property | Type | Description |
---|---|---|
currentStepId | string | The current step ID, which may be nested via / |
currentWorkflowId | string | The workflow we are running |
currentWorkflowSettings | WorkflowSettings | The settings for the current workflow, merged automatically |
topDir | string | The root directory for the current workspace |
WorkflowSettings
Properties
Property | Type | Description |
---|---|---|
mode | "grit" | "bun" | - |
workspaceLocation ? | "local" | "remote" | "auto" | Allow using local repo context<br /><br />Default<br /><br />'auto' |
Type Aliases
HealthGauge
HealthGauge:
object
A title explaining the metric and a value between 0 and 100, representing how well the workflow is performing.
Type declaration
Member | Type | Description |
---|---|---|
data ? | object | Optional input that was used to compute this score<br />This can be useful for historical analysis |
description ? | string | - |
kind | "gauge" | - |
title | string | - |
value | number | - |
ProgressEstimate
ProgressEstimate:
object
A projection of ongoing workflow progress according to a named metric.
Type declaration
Member | Type |
---|---|
kind | "progress-estimate" |
name | string |
total | number |
ProgressIncrement
ProgressIncrement:
object
Type declaration
Member | Type |
---|---|
data ? | MatchResult |
kind | "progress-increment" |
name | string |
Functions
estimate
estimate(
data
):Promise
<void
>
Estimate total work for the current workflow, computed using workflow internal logic.
Parameters
Parameter | Type |
---|---|
data | ProgressEstimate |
Returns
Promise
< void
>
fail
fail(
settings
):Promise
<void
>
Fail the workflow for a specific reason.
Parameters
Parameter | Type |
---|---|
settings | object |
settings.message | string |
Returns
Promise
< void
>
increment
increment(
data
):Promise
<void
>
Increment the progress of the current workflow by one unit, according to a metric initialized with estimate.
Parameters
Parameter | Type |
---|---|
data | ProgressIncrement |
Returns
Promise
< void
>
markCheck
markCheck(
group
):Promise
<void
>
Mark a check that was run
Parameters
Parameter | Type |
---|---|
group | Omit < MetadataCheckItem , "__typename" | "kind" > |
Returns
Promise
< void
>
markGroup
markGroup(
group
):Promise
<void
>
Save a migration group to the current workflow
Parameters
Parameter | Type |
---|---|
group | Omit < MigrationGroup , "__typename" | "kind" > |
Returns
Promise
< void
>
markMatch
markMatch(
match
):Promise
<void
>
Save a match result to the current workflow
Parameters
Parameter | Type |
---|---|
match | MatchResult |
Returns
Promise
< void
>
maybe_fail
maybe_fail(
settings
):Promise
<void
>
Prompt the user with an error message and allow them to either abort or continue If the promise resolves, the user has chosen to continue the current workflow.
Parameters
Parameter | Type |
---|---|
settings | object |
settings.message | string |
Returns
Promise
< void
>
prompt
prompt<
T
>(settings
):Promise
<T
>
Prompt the user or outside system for input
Type parameters
Parameter |
---|
T extends string |
Parameters
Parameter | Type |
---|---|
settings | PromptSettings < T > |
Returns
Promise
< T
>
track
track(
data
):Promise
<void
>
Save health metadata for the current workflow, computed using workflow internal logic.
Parameters
Parameter | Type |
---|---|
data | HealthGauge |
Returns
Promise
< void
>
Generated using TypeDoc and typedoc-plugin-markdown