Skip to content

Commit 6030fec

Browse files
docs(site): fix setup: step ordering and gate conditioning in custom-steps diagram (#875)
1 parent 5fcb783 commit 6030fec

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

site/src/content/docs/reference/front-matter.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,9 @@ Custom steps are inserted at these points in the three-stage pipeline:
250250

251251
```mermaid
252252
flowchart TB
253-
subgraph SetupJob[Setup Job]
254-
S1[setup steps]
253+
subgraph SetupJob["Setup Job (optional)"]
255254
S2[Gate step]
256-
S3[Runtime setup]
255+
S1[setup steps]
257256
end
258257
subgraph AgentJob[Agent Job]
259258
A1[steps]
@@ -266,12 +265,14 @@ flowchart TB
266265
subgraph TeardownJob[Teardown Job]
267266
T1[teardown steps]
268267
end
269-
S1 --> S2 --> S3 --> A1 --> A2 --> A3 --> E1 --> T1
268+
S2 --> S1 --> A1 --> A2 --> A3 --> E1 --> T1
270269
```
271270

271+
The Setup job is only created when `on:` filters or `setup:` steps are configured. When both are present, the gate step runs first — `setup:` steps are conditioned on the gate passing.
272+
272273
| Field | Job | Position | Use Cases |
273274
|-------|-----|----------|-----------|
274-
| `setup` | Setup (separate job) | **Before** gate step and runtime setup | Pre-flight checks, credentials setup, external service initialization |
275+
| `setup` | Setup (separate job) | **After** gate step (conditioned on gate when filters active) | Pre-flight checks, credentials setup, external service initialization |
275276
| `steps` | Agent (inline) | **Before** agent runs | Generate context files, fetch external data, prepare workspace |
276277
| `post-steps` | Agent (inline) | **After** agent completes | Process agent outputs, run validation, upload diagnostics |
277278
| `teardown` | Teardown (separate job) | **After** safe outputs execute | Cleanup, notification, metrics collection |
@@ -319,7 +320,7 @@ post-steps:
319320

320321
### `setup:` — Pre-Flight Setup Job
321322

322-
Runs as a **separate job** before the Setup job's gate step. Use for infrastructure provisioning or external service preparation:
323+
Runs in the **Setup job** (a separate job that executes before the Agent job). When `on:` filters are configured, the gate step runs first and `setup:` steps are automatically conditioned on the gate passing — they are skipped if the trigger doesn't match your filters. When no filters are configured, `setup:` steps run unconditionally. Use for pre-flight infrastructure or workspace preparation the agent job depends on:
323324

324325
```yaml
325326
setup:
@@ -349,7 +350,8 @@ Teardown steps run even if the agent or executor jobs fail (condition: `always()
349350

350351
### Job Conditions
351352

352-
- **`setup`** and inline **`steps`** run unconditionally (subject to gate filters)
353+
- **`setup`** steps run unconditionally when no filters are configured; when `on:` filters are active, they are conditioned on the gate passing
354+
- **`steps`** (inline pre-agent) run unconditionally within the Agent job
353355
- **`post-steps`** run only if the agent job reaches that phase (condition: `always()` within the job)
354356
- **`teardown`** runs unconditionally after the executor job completes (condition: `always()`)
355357

0 commit comments

Comments
 (0)