21 Automations
Software Factory Engineer · beyond this factoryAcademy CRM Factory: an automation that reviews every pull request.
I want work to start without a person.
Automations
Concepts
So far every run started because you pressed a button.
- Automation — a rule of the project: on a trigger it makes a work item and runs a pipeline on it. Automations in the left column lists them.
- Trigger — what starts it: a pull request event (opened, changed, closed or merged) or a schedule.
- Automation user — a non-human user an automation runs as. It writes to the code host under its own identity and needs a coding agent account.
- Runs — every run of the project's automations, with its state.
- Pause — stops new runs from starting; Resume switches the automation on again.
What an automation is made of
- Triggera pull request event or a schedule
- Rulethe rule: a pipeline, and whom it runs as
- Runa work item it makes
- Runsevery run with its state and events
Figure 21.1 · What an automation is made of
Scenario
You add an automation user, make a review automation, open a pull request, and watch the review start by itself. Then you read the run and pause the automation.
From a rule to a review nobody started
- Rule
- Pull request
- Review run
- Pause
Figure 21.2 · From a rule to a review nobody started
Interface
The Automations page: two automations, one per row, with whom each runs as and its status.
Automations page
Figure 21.3 · The Automations page and its numbered places
- 1Automations: the project's automations and their runs.
- 2New automation: a new rule, made paused.
- 3Automations / Runs / Failed events: the rules, their runs, the events that failed.
- 4Can't write: an automation user with no coding agent account.
- 5Review every pull request: runs as you; 1 live run.
- 6Status: Paused or Active.
- 7⋯: Pause or Delete.
- 8Gear: project settings: Automation users.
Walkthrough
Scene 1 of 8 · 0:21
Add an automation user
Where: Automations page: ⑧ Gear · Automation users page: ① Automation users · ② Add automation user
The gear → Automation users → Add automation user: Name academy-reviewer → Save. It is saved Off. Version-control integration → the organization's Gitea, then switch it On: it posts as the integration's service account.
Terms
- Live run — a run that has not ended yet; the list counts them per automation.
- Done when — when a run ends: here, when the pull request is ready to merge, merged or closed.
- Failed events — events Swifter could not turn into a run. A failed pipeline run is not one.
- Review — the work item type of a pull request review: it reads code and commits nothing.