You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Execution Model Documentation for Action-Level Control (#756)
Add comprehensive documentation for gitStream's action-level execution
control, explaining how and when specific actions are automatically
skipped based on triggering events.
Copy file name to clipboardExpand all lines: docs/execution-model.md
+64Lines changed: 64 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,70 @@ If an automation block does not have explicit triggers configured, it will be tr
82
82
!!! Note
83
83
The `on` parameter can be used within individual automation blocks, while `triggers.include` and `triggers.exclude` can only be defined at the file level.
84
84
85
+
## Action-Level Execution Control
86
+
87
+
gitStream provides intelligent action-level execution control that automatically skips certain actions based on the original triggering event. This feature helps reduce noise and ensures that AI-powered and code-related actions only execute when there are actual code changes, improving efficiency across all supported providers (GitLab, Bitbucket, and GitHub).
88
+
89
+
### How It Works
90
+
91
+
When an automation is triggered, gitStream evaluates each action individually against the original triggering event. Some actions are automatically skipped if the triggering event is not relevant to their purpose.
92
+
93
+
!!! important "Explicit Triggers Override"
94
+
When explicit triggers are configured (using the `on` or `triggers` parameters), they take precedence over the automatic skip mechanism. This means actions will execute for all explicitly defined triggers, regardless of the action-level execution rules below.
95
+
96
+
### Action Execution Rules
97
+
98
+
The following table shows which actions are restricted to code-related triggering events:
99
+
100
+
<divclass="trigger-details"markdown=1>
101
+
| Action | Executes Only On | Behavior on Other Triggers |
|`add-code-comment`| Commit pushed, Creating a PR (not draft), PR ready for review | Skipped |
104
+
|`code-review`| Commit pushed, Creating a PR (not draft), PR ready for review | Skipped |
105
+
|`describe-changes`| Commit pushed, Creating a PR (not draft), PR ready for review | Skipped |
106
+
|`explain-code-experts`| Commit pushed, Creating a PR (not draft), PR ready for review | Skipped |
107
+
| All other actions | Current defaults (no restrictions) | Executed |
108
+
</div>
109
+
110
+
### Examples
111
+
112
+
#### Scenario: AI Code Review with Explicit Triggers
113
+
114
+
```yaml+jinja
115
+
automations:
116
+
ai_code_review:
117
+
on:
118
+
- commit
119
+
- label_added
120
+
if:
121
+
- true
122
+
run:
123
+
- action: code-review@v1 # Executes on both commit and label_added (explicit triggers override skip rules)
124
+
- action: add-label@v1 # Executes on both commit and label_added
125
+
args:
126
+
label: "reviewed"
127
+
```
128
+
129
+
In this example with explicit triggers:
130
+
- When triggered by a `commit` event: both actions execute
131
+
- When triggered by a `label_added` event: both actions execute (explicit triggers take precedence)
132
+
133
+
#### Scenario: No Explicit Triggers
134
+
135
+
```yaml+jinja
136
+
automations:
137
+
smart_review:
138
+
if:
139
+
- {{ files | length > 5 }}
140
+
run:
141
+
- action: describe-changes@v1 # Only executes on code-related events
142
+
- action: add-reviewers@v1 # Executes on all default triggers
143
+
args:
144
+
reviewers: ["expert1", "expert2"]
145
+
```
146
+
147
+
With implicit triggers (no explicit triggers configured), `describe-changes` will only execute when the automation is triggered by code changes, while `add-reviewers` follows the current default behavior.
148
+
85
149
**Note on Matching:**
86
150
87
151
- When using a `String` as the matching type, the values in `triggers.include.*` and `triggers.exclude.*` require exact matches. This means that the names of branches or repositories must exactly match the specified string to either trigger or prevent triggering the automation.
0 commit comments