Skip to main content
Version: v5.6.1

opschain triggers test

triggers

opschain triggers test <project>/<code> --event <event-id>

Dry-runs a trigger against a stored event — gate by gate, writing nothing. The server evaluates the trigger with the live engine's own match functions (v2 TriggerService.TestTrigger) and reports every gate:

  • enabled — would the trigger consider events at all;
  • subject/event match — does the event's subject and type match;
  • scope match — is the event inside the trigger's scope path;
  • each condition, marked ✓/✗ with the actual value the engine saw ((absent) when the event carries no value at that path);
  • the resolved action params — or the template error that resolving them raised.

Nothing fires and nothing is recorded. The verdict is scriptable: the command exits non-zero when the trigger would not fire, so it slots into CI checks. -o json|yaml prints the raw report document instead of the rendered gates.

Needs a server target (--server <url>, OPSCHAIN_SERVER, or the active context).

Flags​

FlagMeaning
--event <event-id>The stored event id to evaluate against (required).

Exit codes​

CodeMeaning
0The trigger would fire against the event.
1The trigger would NOT fire — or the command itself failed (trigger or event not found).
2Usage error — missing --event, malformed address, no server target.

Named errors​

  • trigger <project>/<code> would not fire against event <event-id> — the scriptable negative verdict, exit 1 (printed after the full gate report).
  • trigger "<code>" not found in project "<project>" — exit 1.

Example​

opschain triggers test demo/promote_on_success --event 0199c8aa-…
trigger demo/promote_on_success against event 0199c8aa-…:
enabled: yes
subject/event match: yes
scope match: yes
condition event.source.action eq web:deploy ✓ actual: web:deploy
action params: {
"workflow": "release"
}
verdict: would fire

See also​

  • opschain docs cli/triggers-firings — what actually happened, not what would.
  • opschain docs cli/events — finding the stored event id.
  • opschain learn 5.2 and opschain learn 5.4.