Stage rules
What a stage asks of a snapshot before it enters, what it must show before the next stage accepts it, and how a promotion spreads across the stage's deployments.
Each stage of a pipeline has a stage editor: the rules a snapshot must meet to enter the stage, what a snapshot must show in the stage before the next one accepts it, how snapshots arrive, and how a promotion spreads over the stage's deployments. The idea behind it is in Pipelines and promotion.
Stage rules are enforced. They are compiled into the same policy engine that judges your guardrails and judged every time a snapshot is about to arrive at a deployment in the stage's environment: a push, an auto-promotion, an ad hoc promotion, a step of a release and a held snapshot being released. The decision is stored with the version of the rules it read, so Activity can say which stage rule held a snapshot. A stage rule can add requirements but never removes one a guardrail sets; the strictest value wins.
Open a stage from the pipeline graph with the pencil on its card, or Pipelines › (a pipeline) › Stages › (a stage). Changes to a stage are saved with the pipeline as a new version (Save version), so versions and restore cover them. You need pipeline:manage to change a stage, and a pipeline you cannot read is a 404.
What is applied today
| Part of the stage | Applied |
|---|---|
| Gate rules (approval, ticket) and When windows | Yes, on every arrival into the stage's environment. See Rules for the facts each reads, and below for what is advice only. |
| Qualification rules: tests, soak, incidents, sign-off | Yes, as the stage's verdict on each snapshot it runs (Qualification and sign-off). They never hold a snapshot back from arriving, because the snapshot has to arrive to be judged. |
| A route that requires Qualified there | Yes. The stage after it asks that the snapshot qualified in the stage before, on every arrival; the web app calls such a snapshot "Ready for" the next stage. |
| Auto-promote arrival, with Which snapshot, If several arrive, Manual requests, Config-only changes and With several incoming routes | Yes (Auto-promotion, and below). |
| Rollout: all at once, one at a time, in waves, and what happens when a wave fails | Yes, when the promotion is a release. |
| Narrow by, When qualified, When rejected, and the ticket rule | Yes (below). |
| Reads for sign-off | Yes, as advice (below). |
Stored and not yet acted on
Two things on a stage are shown and not carried out: Reads for sign-off and an agent rule are advice only, and the approval rule does not open the approval request by itself. A request is opened for the approval requirements of a guardrail (and a stage's count is then read from the same request), so pair a stage's approval with a guardrail that asks for approvals on the same environment. See Approvals.
Everything else on a stage is acted on by the server: the arrival choices, the verdict choices, the rollout's failure handling, Narrow by, the ticket rule, the request form, Keep linked and what each route requires. Below says what each does.
How a snapshot arrives
Under Arrives by you choose how new snapshots get onto the stage's deployments. The first stage has no incoming route and so no choice: a read-only Sync row lists its deployments, each with its own setting (Automatic or By request) linking to that deployment's settings, and the arrival checks apply to every push. A deployment set to sync automatically still takes pushes to its own branch.
| Setting | Choices | Meaning |
|---|---|---|
| How | Auto-promote | A snapshot enters after it qualifies in the stage before it, which is the soak and the checks of that stage, with no one acting; see Auto-promotion. A guardrail, a freeze or an unreadable fact makes it wait, never skip. |
| By request | Wardn promotes nothing into the stage by itself; a person promotes. | |
| Which snapshot | Newest qualified upstream, Newest upstream, Same as upstream chose | Qualified upstream carries a snapshot when it qualifies. Newest upstream carries a snapshot as soon as it runs upstream, without waiting for a verdict (a route that requires Qualified there still holds it until it has). Same as upstream chose carries whatever upstream runs when the promotion gets its turn, so a snapshot upstream has since replaced or rolled back is not carried forward. |
| If several arrive | Replace the one in testing, Queue, finish testing first | Replace takes the new snapshot at once. Queue waits, looking again, until the stage has qualified or rejected the snapshot it runs. |
| Manual requests | on or off | Off refuses a person's promotion or release into the stage (409 promotion.requests_not_allowed); only the pipeline's own arrival moves snapshots in. A hotfix is how a person goes past it. |
| Config-only changes | on or off | On lets a snapshot that changes configuration only (no new image, no app added or removed) arrive by auto-promotion as soon as it runs upstream, and meets the route's Qualified there check without it. |
| With several incoming routes | All must pass, Any one | Appears when more than one route leads here. All asks for a snapshot that qualified in every stage a route requires it of; Any one asks for one of them. A route that adds no check leaves Any one with nothing to ask. |
Comes from lists the incoming routes drawn on the graph, with what each requires of the stage it leaves: Qualified there (the snapshot qualified in that stage), Ran there (its content ran in that stage's environment, whatever the stage made of it) or No requirement (nothing is asked, and a route that asks nothing leaves Any one with nothing to ask).
What the arrival choices do
Request form: a stage with a request form takes a release into it only when the form is filled: the title and the change type, change ticket, customer impact and rollback plan the promote form collects (400 release.request_form_incomplete names what is missing). A promotion by hand has no form, so it takes a reason instead (400 promotion.request_form_incomplete).
Keep linked: a stage kept linked to a stage preset follows the preset when it is saved: each pipeline with a linked stage gets a new version whose stage has the preset's settings and the new preset version, with a summary that says so (or a draft, where the pipeline's changes need a review). A stage someone edited was unlinked by the edit and is left alone.
Narrow by limits the stage to the deployments that meet every condition (a cluster, a cluster label such as region=us, or an app, each is or is not a value). A deployment it leaves out is not promoted into by the pipeline, is not offered by a release plan, and refuses a person's promotion with 409 promotion.not_in_stage.
Rules
Rules sit in three sections. Each row has a title, a note and settings, and an Always on row cannot be edited or removed. In the web app, Add check and Add approval are under Gate, Add rule is under Qualification, and Add window is under When; each opens Add a rule with a Type menu, a Rule title (at least 2 characters) and the settings its type needs.
| Section | Meaning |
|---|---|
| Gate | Checks and approvals before a snapshot enters. |
| Qualification | What a snapshot must show in this stage before later stages accept it. |
| When | Deploy windows. Freezes are not here: they come from guardrails. |
With no gate rules, a stage lets in whatever its guardrails allow. With no qualification rules, every snapshot counts as qualified as soon as it runs. The rule types are:
| Type | Section | Settings | Judged as |
|---|---|---|---|
approval | Gate | count, 1 to 20 (How many) | At least that many approvals on the snapshot's approval request, from people. |
incidents | Qualification | none | No open incident covers the deployment. A source that cannot be read leaves the check waiting. (Put in Gate through the API, it also holds arrivals.) |
ticket | Gate | status (Ticket status that lets a snapshot in) | The change ticket attached to the snapshot at the deployment is in that status, in its system's words, ignoring case. With no ticket attached the arrival waits for one; a ticket whose last check failed or is stale makes it wait, never pass (Change tickets). |
health | Gate | none | Shown only. Target health is always checked by the system. |
window | When | days (1 for Monday to 7 for Sunday), startMinute, endMinute (minutes into the day, the end after the start; the editor takes From and To times) | The weekday is in the list and the time is within the window, in the organization's time zone. Outside it, the snapshot is held. |
test | Qualification | none | At least one run of a suite against the snapshot, none failed or errored, none still running (Tests). |
soak | Qualification | seconds (Hours healthy in the editor) | At least that long healthy in the stage. |
signoff | Qualification | count, 1 to 20; allowIssues, accept a sign-off that notes known issues (off unless set); notAuthor, bar the snapshot's author (on unless set to false) | At least that many sign-offs, and no rejection. allowIssues and notAuthor are set through the API. |
agent | Gate | none | Shown only. |
The editor offers approval, ticket and health under Gate; test, soak, incidents and signoff under Qualification; and window under When. The API accepts a rule in any section and compiles what it can: a Qualification-section rule is read by qualification and not by the gate, so put soak, test and signoff in Qualification, as the editor does.
Wardn refuses to save a rule it cannot compile, such as an approval with no count, an empty window, a soak of zero or a ticket with no status, and answers 400 pipeline.stage.rule naming the rule. A stage holds at most 30 rules and a stage's configuration at most 64 KiB.
A rule that reads a fact Wardn cannot read right now makes the arrival wait, naming the fact, and never lets it through. Wardn treats an unknown as "not yet", never as "yes". A push, a release and an auto-promotion try again later. A rule that is not met is different: it holds the snapshot, which is stored and shown on the deployment's Snapshots tab but not applied, and Activity names the rule.
Qualification verdicts
The Qualification section is what makes a snapshot qualified, qualifying or rejected in this stage. The checks, the verdict and who may sign off are explained in Qualification and sign-off. In short: the soak is read from how long the snapshot has run healthy in the stage; tests are read from test runs made against that snapshot; the no-incident check reads incidents; and a sign-off is a person's decision under Approvals › Sign-offs.
Under Qualification, two choices say what the stage does with a verdict:
- When qualified: Notify the team channel or Do nothing.
- When rejected: Keep it running, mark rejected or Roll back to the last qualified.
Notify the team channel posts to the stage's notify channel in Slack (or the workspace's own channel when none is set) when a snapshot qualifies. Roll back to the last qualified puts the deployment back to the newest snapshot the stage qualified before, as a restore by the system: the guardrails that govern restores judge it, and what holds it is recorded with the deployment, never skipped. Keep it running, mark rejected leaves the snapshot where it is, marked rejected; the next stage does not accept it.
Rollout
Under Rollout, choose how a promotion spreads over the stage's deployments:
| Mode | Meaning |
|---|---|
| All at once | Every deployment in the stage gets the snapshot together. |
| In waves | Groups of deployments in turn. Up to 10 waves. |
| One deployment at a time | A single deployment, then the next. |
Each wave has a name, a target (a cluster label such as region=us, kept as the wave's selector), a note on how it is verified, and what lets the rollout continue: After a person confirms, Automatically or After an approval. A wave can carry its own soak. Wardn builds the waves of a release from this: each wave takes the deployments whose cluster carries its labels, deployments no wave takes go last in Everything else, and a wave that does not continue Automatically holds the release after it until someone resumes it. An ad hoc promotion and an auto-promotion do not use waves.
Around the waves:
| Setting | Choices |
|---|---|
| If a wave fails verification | Pause and alert, Roll back the wave, Roll back everything |
| Retries per deployment | 2 or none |
| Timeout per deployment | 15 minutes, 30 minutes or 1 hour |
What a failed wave does is applied: Pause and alert holds the release for a person; Roll back the wave puts back what the failed wave applied and ends the release as failed; Roll back everything puts back every wave that applied. A deployment that does not come up is tried again as often as Retries says before the wave is given up on, waits as long as Timeout says to come up, and a wave's own soak holds it after its deployments are up. The release reads its wave checks from its own settings (Waves and checks). A wave's order of deployments inside a single apply is a different thing, covered by Jobs and waves.
Narrow by
By default a stage covers every deployment of the pipeline's apps in its environment. Narrow by limits that with up to 10 conditions on Cluster, Cluster label or App, each with is or is not. A narrowed stage takes only the deployments that meet every condition: auto-promotion, a release plan and a person's promotion leave the others out (409 promotion.not_in_stage), and the Apps tab counts follow.
Request form and agents
- Request form is the template named for someone asking for a promotion into this stage. A release into the stage is taken only with the form filled (below).
- Reads for sign-off names the agent that reads each snapshot for the person who signs it off, or No agent. Its read is advice for the approver, shown on the sign-off page and counted by the Agent recommends filter, and is never a sign-off: no agent can sign off, and a stage's rules do not depend on it. The setting is stored per stage as
agents.read(modeofofforrecommend, and the agent'sagentId; recommend needs one). When a snapshot in the stage gets a verdict or a check changes, Wardn starts a read-only job for that agent (Agent jobs); a read made before the checks moved is stale and is made again. The id is stored as written and is not checked when you save. - Agents sets how far the Release agent may go in this stage: its autonomy, a cap, how many deployments an hour without a person, and what it may do. A guardrail's agent autonomy limit takes priority, and the editor shows a note when a guardrail lowers the cap.
Presets
Apply a preset at the top of the editor copies a stage preset's rules into the stage as a draft, which you review and save. Keep linked records which preset the stage came from. A linked stage is marked as following the preset until someone edits it, but it does not yet pick up later changes to the preset. See Presets.
Guardrails still apply
Under the rules the editor lists the guardrails that reach this stage's environment ("Guardrails also apply here"). A stage rule can add requirements but never remove one a guardrail sets. The strictest value always wins: with a guardrail asking for two approvals and a stage asking for one, two are needed. Because the stage's rules and your guardrails go through one engine, the Evaluator tab of Guardrails answers "what would happen" for a stage's rules too, and Test rules on a pipeline opens it with the context filled in.
Next
Qualification and sign-off
The verdicts a stage's qualification rules give, and who may sign off.
A QA stage with sign-off
Tests, a soak and a sign-off in QA, then a promotion to prod.
Guardrails
Rules that also hold a deploy, and the production branch rule.
Freezes
Keep changes out of environments for a period.
Related: Pipelines, Releases, Environments, Roadmap.
Delegating approvals
Pass your approval duty to a colleague for a period while you are away, scope it to a place, and see how both names stay on every approval.
Guardrails
Write rules that a snapshot must meet before it deploys, scope them to the places they protect, and use the production branch rule and its one-time bypass.