Gates

ConfigHub blocks particular kinds of actions in two different ways. Validation Errors are recorded by ConfigHub itself when a validating trigger does not pass, and block publishing a Release. Destroy Gates and Delete Gates are metadata you set to block destroying or deleting something; ConfigHub also sets the Released Delete Gate on Units a Release deploys. There are also non-blocking Validation Warnings.

Validation Errors are set by ConfigHub automatically when validating triggers do not pass on the most recent configuration data revision for a unit. They block publishing a Release that would bundle that revision, until the underlying issue causing the validation failure is addressed.

Two details are worth knowing:

  • They are checked against the revision being bundled, not only the unit's head revision. So cub release publish --revision <tag> evaluates the errors on the tagged revisions specifically.
  • A blocked publish is not terminal. The check re-runs the unit's triggers as it evaluates them, so once the underlying problem is fixed, publishing again succeeds.

These were called Apply Gates until the field was renamed to ValidationErrors — the old name predated the release model, from when configuration was pushed to a target rather than published. ApplyGates and ApplyWarnings are still returned by the API as deprecated read-only copies of ValidationErrors and ValidationWarnings, and still work in --where, --select, --columns and order_by, so nothing written against the old names has to change yet.

Validation Warnings work similarly to Validation Errors but are non-blocking. They are produced by validating triggers that have Warn set to true. When a trigger's validating function fails and the trigger is in warn mode, the failure is recorded as a Validation Warning rather than a Validation Error. Validation Warnings are visible in the UI and CLI but do not prevent a Release from being published. This is useful for advisory policies, soft constraints, or gradual policy rollouts where you want to surface issues without blocking deployments.

Both Validation Errors and Validation Warnings use a 3-part name format: <space-slug>/<trigger-slug>/<function-name>, naming the trigger that produced the error or warning as it was when the error or warning was recorded. When a trigger references an Invocation with several functions, each function gets its own error or warning, and its name carries the function's position in the Invocation, counting from 1: platform/checks/vet-celexpr:2. The unit also records the ID of the trigger behind each name, in ValidationTriggerIDs, so the trigger can still be found after it is renamed or moved; the names themselves are updated the next time the unit's triggers run. Detailed validation results (failure messages and details) are also stored alongside them. Triggers can include a Description field that explains what the trigger checks and how to fix failures; this is shown in the UI when hovering over one.

A special temporary entry, awaiting/triggers, is set when configuration data changes. It indicates that triggers have been enqueued for asynchronous evaluation and is automatically removed when all triggers complete. Many CLI commands support --wait to poll until it clears.

A Trigger that runs an external function on a Channel fails closed: while no bot holds the Channel, the Unit keeps its awaiting/triggers gate until the Trigger has run. See when a Channel's bot is unavailable.

Destroy Gates are metadata properties that can be explicitly set on units. The string associated with a Destroy Gate is intended to convey the reason that destruction is blocked and/or the stakeholder or component blocking it. A Unit's resources are destroyed when a Release stops carrying its configuration and the GitOps operator prunes what it no longer finds, so a Destroy Gate refuses whatever would take the configuration the latest Release deployed of the Unit out of what its Space's Target is served:

  • Publishing a Release that bundles the Unit empty, or leaves it out because it is Unreleasable or has moved to another Space. cub release publish --dry-run is refused the same way. Emptying the Unit with cub unit update --empty is not refused; the Release that would deliver the empty Unit is.
  • Withdrawing the Space's latest Release, when the Release served as latest in its place, the newest one published before it for the same Target, does not deploy the Unit, or when there is none. Withdrawing an older Release changes nothing served as latest, so a Destroy Gate does not refuse it.
  • Pruning an entity whose backing Unit has a Destroy Gate, with cub apply --prune or cub <entity> delete --from-backing-units.

Deleting and archiving the Unit take its configuration out of the next Release too. Those are refused by its Delete Gates, including the Released gate described below, rather than by its Destroy Gates. Anyone with permission to edit a Unit may add or remove its Destroy Gates.

Delete Gates are metadata properties that can be set explicitly on any entity in ConfigHub. The string associated with a Delete Gate is intended to convey the reason that delete operations are blocked and/or the stakeholder or component blocking the deletion. A Delete Gate refuses archiving the entity as well as deleting it. Adding or removing one requires Manage permission on the entity (see authorization).

ConfigHub sets one Delete Gate itself. Publishing a Release puts the Released gate on each Unit it bundles with configuration, and takes it off each Unit it bundles empty or leaves out because it is Unreleasable. Withdrawing the latest Release moves the gates to match the Release served in its place. While a Release deploys a Unit's resources, deleting or archiving the Unit is refused, so a Unit is retired by emptying it and publishing first, which removes its resources from the cluster when the operator prunes, and then deleting or archiving it:

cub unit update --space app-dev cache --empty
cub release publish app-dev
cub unit delete --space app-dev cache

The gate also keeps the Revisions a Release bundled: a deleted Unit has none left, so cub variant diff app-dev Release:7 could not show what Release 7 deployed of it, while an archived Unit keeps them, and the diff shows its configuration removed. You can remove the Released gate by hand, like any other, to delete a Unit a Release still deploys. We don't recommend it: the next Release then removes the Unit's resources without its Destroy Gates being consulted.

A Delete Gate on an entity residing in a space blocks deleting the space with --recursive. That includes the Released gate, so a Space whose Units have been released is deleted recursively once a Release has bundled them empty, or with --recursive-force. --recursive-force deletes the space and everything within it regardless of their gates, based on the principle that tenants within a space should not necessarily have the power to control the fate of the whole space. A Delete Gate on the space itself blocks both, so to protect the entities within a space, place a Delete Gate on the space as well. Delete Gates are separate from what other entities reference: see deleting referenced entities.