Skip to main content
The ladder · Lesson 21

21 Automations

Software Factory Engineer

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

Trigger
Rule
Run
Runs
a pull request event or a schedule
the rule: a pipeline, and whom it runs as
a work item it makes
every run with its state and events
  1. Trigger
    a pull request event or a schedule
  2. Rule
    the rule: a pipeline, and whom it runs as
  3. Run
    a work item it makes
  4. Runs
    every 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
  1. Rule
  2. Pull request
  3. Review run
  4. 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.

Walkthrough​

Scene 1 of 8 · Add an automation userWatched 0%

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.