Add a gate to a pipeline step
A gate is a check a change must pass. Gates sit in two places on a project's pipeline:
- On a step: a Merge, Start and merge or Release step runs its gates before the change goes into the next stage. A required gate that fails stops the step.
- After arrival: a stage with a branch runs its after-arrival gates once a change has landed and deployed there. The step out of that stage opens only when the required ones pass; a required one that fails keeps the next step shut, and its wait chip reads Verify failed.
Gates in a list run in order, one at a time. Out of the box, the merge step runs the project's Full gate command and each release step runs All checks on the release PR; no stage has after-arrival gates.
Who can do this: anyone who may edit the project. Others see the gates but can't change them.
Plan: gates are set in a project's custom pipeline, under Settings › CI Pipeline, which shows only where the organization's plan includes Custom pipelines. On a basic pipeline the gates are the pipeline's own (Choose a basic pipeline).
Add a gate to a step
-
In the sidebar, select Directory, then the Projects tab, and select the project's name.
-
In Settings, select CI Pipeline. Under Steps, select a Merge, Start and merge or Release step to open its settings. Its summary ends with how many gates it has, such as 1 gate.
-
Under Gates, select + Add gate and pick a kind:
Kind What it checks Command on the node Runs in the project's checkout. Exit 0 passes. CI workflow or pipeline GitHub Actions, GitLab CI, Azure Pipelines, Bitbucket. Webhook Answers pass or fail with a short report. Health probe Checks this stage's address. Open alerts Passes with no open incident. Ticket in Jira Passes when a ticket is in a state you pick. Ticket in ServiceNow Passes when a change request is in a state you pick. -
Fill in the new gate's form (below), give it a Name, then select Done.
-
Select Save at the foot of the tab. A gate's one-line summary reads Summary shows after Save until then.
A list holds up to 20 gates.
Add a gate after arrival
- In Settings › CI Pipeline, select After arrival at the foot of a stage card, or scroll to the After arrival section below Steps.
- Select the stage's name to open its list. An empty one says No gates: a change is verified on arrival.
- Select + Add gate, pick a kind, and fill in its form.
- Select Done, then Save.
After-arrival gates always run by themselves, so a ticket gate there needs a fixed ticket or query.
Each kind's fields
| Kind | Fields |
|---|---|
| Command on the node | Command: runs in the project's checkout on a node. Exit 0 passes. |
| CI workflow or pipeline | Run: Start a run (Jaah starts the workflow on the change), Wait for the run (waits for the run the forge started) or All checks (waits for every check on the change). Workflow or pipeline: pick one from the list, or Other: type its name. |
| Webhook | Address: an https:// address that answers with JSON giving result, pass or fail, and a report. Signing secret: a saved credential. |
| Health probe | Path: added to this stage's address, such as /health. Status from and Status to: the status codes that pass, such as 200 to 399. Tries in a row: each 10 s apart; all must pass. Page contains: text the page must hold. |
| Open alerts | Fail at: the lowest incident severity that fails the gate. Environment: empty means this stage's deploy environment. With no alert source connected, the gate always passes and says so. |
| Ticket | Which ticket: Ask when pressed (whoever presses the step types it) or Fixed ticket or query (passes when a match is in a state below). Login: a credential shared with the project, not a personal one. Ticket or JQL (Jira) or Ticket or encoded query (ServiceNow). Passes in: tick the states that pass. |
Every gate also has:
- Time limit: 1 minute to 6 hours, with its Unit. A run that takes longer fails.
- Retries: runs it again after a failure, up to 3 times.
- If it fails: Required stops the step; Advisory only warns.
A step that runs By itself can't use Ask when pressed: no one is there to type a ticket. On a hand-pressed release, Ask when pressed adds a Ticket field (Change ticket for ServiceNow) beside Release, and Release waits until the ticket typed is one the system knows.
Change a gate
Each row shows the gate's kind, name and summary, with chips for Off, Advisory, its time limit and Retry N. A row with a problem shows Needs a fix. On a row:
- Edit opens its form; Done closes it.
- Switch off keeps the gate but skips it when the list runs; Switch on brings it back.
- The up and down arrows, or dragging the row, change the order.
- ✕ removes it.
Nothing changes until you select Save.
See how the gates did
- On a merge: the task page's Merge gates section shows each gate's result once the merge lane has run them.
- On a release: with the Release step selected on the Tasks page, Checks on Dev (or the stage's name) lists the after-arrival results, and a failed release shows Checks before Production.
Each row reads Passed, Failed, Failed (advisory), Timed out, Off, Skipped, Running or Waiting, with how many attempts it took and how long, and the gate's report.
Related
- When a merge gate fails in the lane: Use the merge lane.
- How a change deploys before its after-arrival gates run: Set a stage's deploy target.
- Every other step rule: Set up a project's pipeline.
- Running a release: Release to production.